diff --git a/constantine-go/constantine.go b/constantine-go/constantine.go index 8b336081..35b50257 100644 --- a/constantine-go/constantine.go +++ b/constantine-go/constantine.go @@ -720,7 +720,7 @@ func EvmSha256(inputs []byte) (result Bytes32, err error) { func EvmModexp(inputs []byte) (result []byte, err error) { var size C.uint64_t // Call Nim function to determine correct size to allocate for `result` - status := C.ctt_modexp_result_size(&size, + status := C.ctt_eth_evm_modexp_result_size(&size, (*C.byte)(getAddr(inputs)), (C.size_t)(len(inputs)), ) diff --git a/constantine-rust/constantine-ethereum-evm-precompiles/src/lib.rs b/constantine-rust/constantine-ethereum-evm-precompiles/src/lib.rs index 0891c1f2..5d5991c8 100644 --- a/constantine-rust/constantine-ethereum-evm-precompiles/src/lib.rs +++ b/constantine-rust/constantine-ethereum-evm-precompiles/src/lib.rs @@ -37,7 +37,7 @@ pub fn evm_modexp(inputs: &[u8]) -> Result, ctt_evm_status> { // Call Nim function to determine correct size to allocate for `result` unsafe { let mut size = 0u64; - let status = ctt_modexp_result_size( + let status = ctt_eth_evm_modexp_result_size( &mut size, inputs.as_ptr() as *const byte, inputs.len() as usize, diff --git a/constantine-rust/constantine-sys/src/bindings32.rs b/constantine-rust/constantine-sys/src/bindings32.rs index ab1f4eef..86d3adea 100644 --- a/constantine-rust/constantine-sys/src/bindings32.rs +++ b/constantine-rust/constantine-sys/src/bindings32.rs @@ -5200,7 +5200,7 @@ extern "C" { extern "C" { #[must_use] #[doc = " Helper for `eth_evm_modexp`. Returns the size required to be allocated based on the\n given input. Call this function first, then allocate space for the result buffer\n in the call to `eth_evm_modexp` based on this function's result.\n\n The size depends on the `modulusLen`, which is the third 32 bytes,\n `inputs == [baseLen { 32 bytes }, exponentLen { 32 bytes }, modulusLen { 32 bytes }, ... ]`\n in `inputs`.\n\n The associated modulus length in bytes is the size required by the\n result to `eth_evm_modexp`."] - pub fn ctt_modexp_result_size( + pub fn ctt_eth_evm_modexp_result_size( size: *mut u64, inputs: *const byte, inputs_len: usize, diff --git a/constantine-rust/constantine-sys/src/bindings64.rs b/constantine-rust/constantine-sys/src/bindings64.rs index 91d501cb..a331328b 100644 --- a/constantine-rust/constantine-sys/src/bindings64.rs +++ b/constantine-rust/constantine-sys/src/bindings64.rs @@ -5200,7 +5200,7 @@ extern "C" { extern "C" { #[must_use] #[doc = " Helper for `eth_evm_modexp`. Returns the size required to be allocated based on the\n given input. Call this function first, then allocate space for the result buffer\n in the call to `eth_evm_modexp` based on this function's result.\n\n The size depends on the `modulusLen`, which is the third 32 bytes,\n `inputs == [baseLen { 32 bytes }, exponentLen { 32 bytes }, modulusLen { 32 bytes }, ... ]`\n in `inputs`.\n\n The associated modulus length in bytes is the size required by the\n result to `eth_evm_modexp`."] - pub fn ctt_modexp_result_size( + pub fn ctt_eth_evm_modexp_result_size( size: *mut u64, inputs: *const byte, inputs_len: usize, diff --git a/constantine/ethereum_evm_precompiles.nim b/constantine/ethereum_evm_precompiles.nim index 34369401..4df7a22e 100644 --- a/constantine/ethereum_evm_precompiles.nim +++ b/constantine/ethereum_evm_precompiles.nim @@ -60,7 +60,7 @@ func eth_evm_sha256*(r: var openArray[byte], inputs: openArray[byte]): CttEVMSta sha256.hash(cast[ptr array[32, byte]](r[0].addr)[], inputs) return cttEVM_Success -func modexp_result_size*(size: var uint64, inputs: openArray[byte]): CttEVMStatus {.noInline, tags:[Alloca, Vartime], libPrefix: prefix_ffi, meter.} = +func eth_evm_modexp_result_size*(size: var uint64, inputs: openArray[byte]): CttEVMStatus {.noInline, tags:[Alloca, Vartime], libPrefix: prefix_ffi, meter.} = ## Helper for `eth_evm_modexp`. Returns the size required to be allocated based on the ## given input. Call this function first, then allocate space for the result buffer ## in the call to `eth_evm_modexp` based on the value stored in `size` after the call. diff --git a/include/constantine/protocols/ethereum_evm_precompiles.h b/include/constantine/protocols/ethereum_evm_precompiles.h index 62e8a97e..f281cc4d 100644 --- a/include/constantine/protocols/ethereum_evm_precompiles.h +++ b/include/constantine/protocols/ethereum_evm_precompiles.h @@ -72,7 +72,7 @@ ctt_evm_status ctt_eth_evm_sha256( * The associated modulus length in bytes is the size required by the * result to `eth_evm_modexp`. */ -ctt_evm_status ctt_modexp_result_size( +ctt_evm_status ctt_eth_evm_modexp_result_size( uint64_t* size, const byte* inputs, size_t inputs_len ) __attribute__((warn_unused_result));