From 4bb14988bbb749b4101f3ea36b714d52f7dd9d80 Mon Sep 17 00:00:00 2001 From: Plamen Hristov Date: Wed, 10 Apr 2024 19:09:20 +0300 Subject: [PATCH 01/18] experimental implementation with blst --- Cargo.lock | 52 +++ soroban-env-common/env.json | 64 ++++ soroban-env-host/src/host.rs | 120 +++++++ soroban-env-host/src/host/bls.rs | 582 +++++++++++++++++++++++++++++++ soroban-env-host/src/test/bls.rs | 0 5 files changed, 818 insertions(+) create mode 100644 soroban-env-host/src/host/bls.rs create mode 100644 soroban-env-host/src/test/bls.rs diff --git a/Cargo.lock b/Cargo.lock index 2715ced0a..0e83ed246 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -149,6 +149,18 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blst" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + [[package]] name = "bumpalo" version = "3.13.0" @@ -566,6 +578,12 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "group" version = "0.13.0" @@ -925,6 +943,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + [[package]] name = "num_enum" version = "0.7.1" @@ -1430,6 +1458,7 @@ version = "22.0.0" dependencies = [ "arbitrary", "backtrace", + "blst", "bytes-lit", "curve25519-dalek", "ecdsa", @@ -1689,6 +1718,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "time" version = "0.3.30" @@ -2143,3 +2181,17 @@ name = "zeroize" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/soroban-env-common/env.json b/soroban-env-common/env.json index 9b720650c..4b9a8c8a0 100644 --- a/soroban-env-common/env.json +++ b/soroban-env-common/env.json @@ -2047,6 +2047,70 @@ "return": "Void", "docs": "Verifies the `signature` using an ECDSA secp256r1 `public_key` on a 32-byte `msg_digest`. Warning: The `msg_digest` must be produced by a secure cryptographic hash function on the message, otherwise the attacker can potentially forge signatures. The `public_key` is expected to be 65 bytes in length, representing a SEC-1 encoded point in uncompressed format. The `signature` is the ECDSA signature `(r, s)` serialized as fixed-size big endian scalar values, both `r`, `s` must be non-zero and `s` must be in the lower range. ", "min_supported_protocol": 21 + }, + { + "export": "3", + "name": "bls_g1_add", + "args": [ + { + "name": "point1", + "type": "BytesObject" + }, + { + "name": "point2", + "type": "BytesObject" + } + ], + "return": "BytesObject", + "docs": "Adds two BLS12-381 G1 points given in bytes format and returns the resulting G1 point in bytes format." + }, + { + "export": "4", + "name": "bls_g1_mul", + "args": [ + { + "name": "point", + "type": "BytesObject" + }, + { + "name": "scalar", + "type": "BytesObject" + } + ], + "return": "BytesObject", + "docs": "Multiplies a BLS12-381 G1 point by a scalar, both given in bytes format, and returns the resulting G1 point in bytes format." + }, + { + "export": "5", + "name": "bls_g2_add", + "args": [ + { + "name": "point1", + "type": "BytesObject" + }, + { + "name": "point2", + "type": "BytesObject" + } + ], + "return": "BytesObject", + "docs": "Adds two BLS12-381 G2 points given in bytes format and returns the resulting G2 point in bytes format." + }, + { + "export": "6", + "name": "bls_g2_mul", + "args": [ + { + "name": "point", + "type": "BytesObject" + }, + { + "name": "scalar", + "type": "BytesObject" + } + ], + "return": "BytesObject", + "docs": "Multiplies a BLS12-381 G2 point by a scalar, both given in bytes format, and returns the resulting G2 point in bytes format." } ] }, diff --git a/soroban-env-host/src/host.rs b/soroban-env-host/src/host.rs index 549c0aeb3..c1317273c 100644 --- a/soroban-env-host/src/host.rs +++ b/soroban-env-host/src/host.rs @@ -2918,6 +2918,126 @@ impl VmCallerEnv for Host { Ok(res.into()) } + fn bls_g1_add( + &self, + _vmcaller: &mut VmCaller, + p0: BytesObject, + p1: BytesObject, + ) -> Result { + let p0_bytes = self.visit_obj(p0, |bytes: &ScBytes| { + bytes.as_slice().try_into().map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "invalid length for G1 point", + &[], + ) + }) + })?; + let p1_bytes = self.visit_obj(p1, |bytes: &ScBytes| { + bytes.as_slice().try_into().map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "invalid length for G1 point", + &[], + ) + }) + })?; + let result = self.bls_g1_add_raw_internal(&p0_bytes, &p1_bytes)?; + self.add_host_object(self.scbytes_from_vec(result.to_vec())?) + } + + fn bls_g1_mul( + &self, + _vmcaller: &mut VmCaller, + scalar: BytesObject, + p1: BytesObject, + ) -> Result { + let scalar_bytes = self.visit_obj(scalar, |bytes: &ScBytes| { + bytes.as_slice().try_into().map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "scalar value out of range for G1 multiplication", + &[], + ) + }) + })?; + let p1_bytes = self.visit_obj(p1, |bytes: &ScBytes| { + bytes.as_slice().try_into().map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "invalid length for G1 point", + &[], + ) + }) + })?; + let result = self.bls_g1_mul_raw_internal(scalar_bytes, &p1_bytes)?; + self.add_host_object(self.scbytes_from_vec(result.to_vec())?) + } + + fn bls_g2_add( + &self, + _vmcaller: &mut VmCaller, + p0: BytesObject, + p1: BytesObject, + ) -> Result { + let p0_bytes = self.visit_obj(p0, |bytes: &ScBytes| { + bytes.as_slice().try_into().map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "invalid length for G2 point", + &[], + ) + }) + })?; + let p1_bytes = self.visit_obj(p1, |bytes: &ScBytes| { + bytes.as_slice().try_into().map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "invalid length for G2 point", + &[], + ) + }) + })?; + let result = self.bls_g2_add_raw_internal(&p0_bytes, &p1_bytes)?; + self.add_host_object(self.scbytes_from_vec(result.to_vec())?) + } + + fn bls_g2_mul( + &self, + _vmcaller: &mut VmCaller, + scalar: BytesObject, + p1: BytesObject, + ) -> Result { + let scalar_bytes = self.visit_obj(scalar, |bytes: &ScBytes| { + bytes.as_slice().try_into().map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "scalar value out of range for G2 multiplication", + &[], + ) + }) + })?; + let p1_bytes = self.visit_obj(p1, |bytes: &ScBytes| { + bytes.as_slice().try_into().map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "invalid length for G2 point", + &[], + ) + }) + })?; + let result = self.bls_g2_mul_raw_internal(scalar_bytes, &p1_bytes)?; + self.add_host_object(self.scbytes_from_vec(result.to_vec())?) + } + // endregion: "crypto" module functions // region: "test" module functions diff --git a/soroban-env-host/src/host/bls.rs b/soroban-env-host/src/host/bls.rs new file mode 100644 index 000000000..908d80842 --- /dev/null +++ b/soroban-env-host/src/host/bls.rs @@ -0,0 +1,582 @@ +#![allow(dead_code)] +use crate::host::prng::SEED_BYTES; +use crate::{ + budget::AsBudget, + err, + xdr::{ContractCostType, Hash, ScBytes, ScErrorCode, ScErrorType}, + BytesObject, Error, Host, HostError, U32Val, Val, +}; +use blst::{ + blst_fr, blst_fr_from_scalar, blst_lendian_from_scalar, blst_p1, blst_p1_add, blst_p1_affine, + blst_p1_affine_in_g1, blst_p1_from_affine, blst_p1_mult, blst_p1_on_curve, blst_p1_serialize, + blst_p1_uncompress, blst_p2, blst_p2_add, blst_p2_affine, blst_p2_affine_in_g2, + blst_p2_deserialize, blst_p2_from_affine, blst_p2_mult, blst_p2_on_curve, blst_p2_serialize, + blst_scalar, blst_scalar_fr_check, blst_scalar_from_fr, + blst_scalar_from_lendian, BLST_ERROR, +}; +use hex_literal::hex; +use hmac::{Hmac, Mac}; +use rand::RngCore; +use rand_chacha::ChaCha20Rng; +use sha2::Sha256; +use sha3::Keccak256; + +use super::metered_clone::MeteredContainer; + +pub const BLST_G1_UNCOMPRESSED_SIZE: usize = 96; +pub const BLST_G2_UNCOMPRESSED_SIZE: usize = 192; +pub const BLS_SCALAR_SIZE: usize = 32; +pub const BLST_RESULT_SIZE: usize = 255; + +impl Host { + // Ed25519 functions + pub(crate) fn ed25519_signature_from_bytesobj_input( + &self, + name: &'static str, + sig: BytesObject, + ) -> Result { + self.fixed_length_bytes_from_bytesobj_input::(name, sig) + } + + pub(crate) fn ed25519_pub_key_from_bytes( + &self, + bytes: &[u8], + ) -> Result { + self.charge_budget(ContractCostType::ComputeEd25519PubKey, None)?; + let vk_bytes = bytes.try_into().map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "invalid length of ed25519 public key", + &[Val::from_u32(bytes.len() as u32).into()], + ) + })?; + ed25519_dalek::VerifyingKey::from_bytes(vk_bytes).map_err(|_| { + err!( + self, + (ScErrorType::Crypto, ScErrorCode::InvalidInput), + "invalid ed25519 public key", + bytes + ) + }) + } + + pub(crate) fn ed25519_pub_key_from_bytesobj_input( + &self, + k: BytesObject, + ) -> Result { + self.visit_obj(k, |bytes: &ScBytes| { + self.ed25519_pub_key_from_bytes(bytes.as_slice()) + }) + } + + pub(crate) fn verify_sig_ed25519_internal( + &self, + payload: &[u8], + verifying_key: &ed25519_dalek::VerifyingKey, + sig: &ed25519_dalek::Signature, + ) -> Result<(), HostError> { + let _span = tracy_span!("ed25519 verify"); + self.charge_budget( + ContractCostType::VerifyEd25519Sig, + Some(payload.len() as u64), + )?; + verifying_key.verify_strict(payload, sig).map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "failed ED25519 verification", + &[], + ) + }) + } + + // ECDSA secp256k1 functions + + pub(crate) fn secp256k1_signature_from_bytes( + &self, + bytes: &[u8], + ) -> Result { + use k256::elliptic_curve::scalar::IsHigh; + self.charge_budget(ContractCostType::ComputeEcdsaSecp256k1Sig, None)?; + let sig: k256::ecdsa::Signature = + k256::ecdsa::Signature::try_from(bytes).map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "invalid ECDSA-secp256k1 signature", + &[], + ) + })?; + if sig.s().is_high().into() { + Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "ECDSA-secp256k1 signature 's' part is not normalized to low form", + &[], + )) + } else { + Ok(sig) + } + } + + pub(crate) fn secp256k1_signature_from_bytesobj_input( + &self, + k: BytesObject, + ) -> Result { + self.visit_obj(k, |bytes: &ScBytes| { + self.secp256k1_signature_from_bytes(bytes.as_slice()) + }) + } + + // NB: not metered as it's a trivial constant cost, just converting a byte to a byte, + // and always done exactly once as part of the secp256k1 recovery path. + pub(crate) fn secp256k1_recovery_id_from_u32val( + &self, + recovery_id: U32Val, + ) -> Result { + let rid32: u32 = u32::from(recovery_id); + if rid32 > k256::ecdsa::RecoveryId::MAX as u32 { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "invalid ECDSA-secp256k1 recovery ID", + &[recovery_id.to_val()], + )); + } + k256::ecdsa::RecoveryId::try_from(rid32 as u8).map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "invalid ECDSA-secp256k1 recovery ID", + &[recovery_id.to_val()], + ) + }) + } + + pub(crate) fn recover_key_ecdsa_secp256k1_internal( + &self, + hash: &Hash, + sig: &k256::ecdsa::Signature, + rid: k256::ecdsa::RecoveryId, + ) -> Result { + let _span = tracy_span!("secp256k1 recover"); + self.charge_budget(ContractCostType::RecoverEcdsaSecp256k1Key, None)?; + let recovered_key = + k256::ecdsa::VerifyingKey::recover_from_prehash(hash.as_slice(), &sig, rid).map_err( + |_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "ECDSA-secp256k1 signature recovery failed", + &[], + ) + }, + )?; + let rk = ScBytes::from(crate::xdr::BytesM::try_from( + recovered_key + .to_encoded_point(/*compress:*/ false) + .as_bytes(), + )?); + self.add_host_object(rk) + } + + // SHA256 functions + + pub(crate) fn sha256_hash_from_bytesobj_input( + &self, + x: BytesObject, + ) -> Result, HostError> { + self.visit_obj(x, |bytes: &ScBytes| { + let hash = sha256_hash_from_bytes(bytes.as_slice(), self)?; + if hash.len() != 32 { + return Err(err!( + self, + (ScErrorType::Object, ScErrorCode::UnexpectedSize), + "expected 32-byte BytesObject for sha256 hash, got different size", + hash.len() + )); + } + Ok(hash) + }) + } + + // Keccak256/SHA3 functions + pub(crate) fn keccak256_hash_from_bytes_raw( + &self, + bytes: &[u8], + ) -> Result<[u8; 32], HostError> { + let _span = tracy_span!("keccak256"); + self.charge_budget( + ContractCostType::ComputeKeccak256Hash, + Some(bytes.len() as u64), + )?; + Ok(::digest(bytes).into()) + } + + pub(crate) fn keccak256_hash_from_bytes(&self, bytes: &[u8]) -> Result, HostError> { + Vec::::charge_bulk_init_cpy(32, self.as_budget())?; + self.keccak256_hash_from_bytes_raw(bytes) + .map(|x| x.to_vec()) + } + + pub(crate) fn keccak256_hash_from_bytesobj_input( + &self, + x: BytesObject, + ) -> Result, HostError> { + self.visit_obj(x, |bytes: &ScBytes| { + let hash = self.keccak256_hash_from_bytes(bytes.as_slice())?; + if hash.len() != 32 { + return Err(err!( + self, + (ScErrorType::Object, ScErrorCode::UnexpectedSize), + "expected 32-byte BytesObject for keccak256 hash, got different size", + hash.len() + )); + } + Ok(hash) + }) + } + + pub(crate) fn bls_g1_add_raw_internal( + &self, + p0: &[u8; BLST_G1_UNCOMPRESSED_SIZE], + p1: &[u8; BLST_G1_UNCOMPRESSED_SIZE], + ) -> Result<[u8; BLST_G1_UNCOMPRESSED_SIZE], HostError> { + let p0 = decode_p1(p0).ok_or_else(|| self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "Failed to decode p0", + &[], + ))?; + let p1 = decode_p1(p1).ok_or_else(|| self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "Failed to decode p1", + &[], + ))?; + let mut res = blst_p1::default(); + let mut out = [0u8; BLST_G1_UNCOMPRESSED_SIZE]; + + unsafe { blst_p1_add(&mut res, &p0, &p1) }; + + unsafe { + blst_p1_serialize(out.as_mut_ptr(), &res); + } + + Ok(out) + } + + pub(crate) fn bls_g1_mul_raw_internal( + &self, + scalar: &[u8; BLS_SCALAR_SIZE], + p1: &[u8; BLST_G1_UNCOMPRESSED_SIZE], + ) -> Result<[u8; BLST_G1_UNCOMPRESSED_SIZE], HostError> { + let p1 = decode_p1(p1).ok_or_else(|| self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "Failed to decode p1", + &[], + ))?; + let scalar_ftr = scalar_fr_from_bytes(scalar).ok_or_else(|| self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "Failed to decode scalar", + &[], + ))?; + let scalar = bls_fr_to_bytes(scalar_ftr); + let mut res = blst_p1::default(); + let mut out = [0u8; BLST_G1_UNCOMPRESSED_SIZE]; + unsafe { blst_p1_mult(&mut res, &p1, scalar.as_ptr(), BLST_RESULT_SIZE) }; + + unsafe { + blst_p1_serialize(out.as_mut_ptr(), &res); + } + + Ok(out) + } + + pub(crate) fn bls_g1_mul_raw_exp( + &self, + scalars: &[u8], + p_n: &[u8], + ) -> Result<[u8; BLST_G1_UNCOMPRESSED_SIZE], HostError> { + if let Some(value) = self.validate_points_input(&p_n, BLST_G1_UNCOMPRESSED_SIZE) { + return Err(value); + } + + let mut res = blst_p1::default(); + let mut out = [0u8; BLST_G1_UNCOMPRESSED_SIZE]; + for (i, chunk) in p_n.chunks_exact(BLST_G1_UNCOMPRESSED_SIZE).enumerate() { + let p1 = decode_p1(chunk.try_into().unwrap()).ok_or_else(|| self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "Failed to decode chunk", + &[], + ))?; + let mut tmp = blst_p1::default(); + let scalar = scalars[i]; + unsafe { blst_p1_mult(&mut tmp, &p1, &scalar, BLST_RESULT_SIZE) }; + unsafe { blst_p1_add(&mut res, &res, &tmp) }; + } + + unsafe { + blst_p1_serialize(out.as_mut_ptr(), &res); + } + + Ok(out) + } + + pub(crate) fn bls_g2_add_raw_internal( + &self, + p0: &[u8; BLST_G2_UNCOMPRESSED_SIZE], + p1: &[u8; BLST_G2_UNCOMPRESSED_SIZE], + ) -> Result<[u8; BLST_G2_UNCOMPRESSED_SIZE], HostError> { + let p0 = decode_p2(p0).ok_or_else(|| self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "Failed to decode p0", + &[], + ))?; + let p1 = decode_p2(p1).ok_or_else(|| self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "Failed to decode p1", + &[], + ))?; + let mut res = blst_p2::default(); + let mut out = [0u8; BLST_G2_UNCOMPRESSED_SIZE]; + + unsafe { blst_p2_add(&mut res, &p0, &p1) }; + + unsafe { + blst_p2_serialize(out.as_mut_ptr(), &res); + } + + Ok(out) + } + + pub(crate) fn bls_g2_mul_raw_internal( + &self, + scalar: &[u8; BLS_SCALAR_SIZE], + p1: &[u8; BLST_G2_UNCOMPRESSED_SIZE], + ) -> Result<[u8; BLST_G2_UNCOMPRESSED_SIZE], HostError> { + let p1 = decode_p2(p1).ok_or_else(|| self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "Failed to decode p1", + &[], + ))?; + let scalar_ftr = scalar_fr_from_bytes(scalar).ok_or_else(|| self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "Failed to decode scalar", + &[], + ))?; + let scalar = bls_fr_to_bytes(scalar_ftr); + let mut res = blst_p2::default(); + let mut out = [0u8; BLST_G2_UNCOMPRESSED_SIZE]; + unsafe { blst_p2_mult(&mut res, &p1, scalar.as_ptr(), BLST_RESULT_SIZE) }; + + unsafe { + blst_p2_serialize(out.as_mut_ptr(), &res); + } + Ok(out) + } + + pub(crate) fn bls_g2_mul_raw_exp_internal( + &self, + scalars: &[u8], + p_n: &[u8], + ) -> Result<[u8; BLST_G2_UNCOMPRESSED_SIZE], HostError> { + if let Some(value) = self.validate_points_input(&p_n, BLST_G2_UNCOMPRESSED_SIZE) { + return Err(value); + } + + let mut res = blst_p2::default(); + let mut out = [0u8; BLST_G2_UNCOMPRESSED_SIZE]; + for (i, chunk) in p_n.chunks_exact(BLST_G2_UNCOMPRESSED_SIZE).enumerate() { + let p2 = decode_p2(chunk.try_into().unwrap()).ok_or_else(|| self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "Failed to decode chunk", + &[], + ))?; + let mut tmp = blst_p2::default(); + let scalar = scalars[i]; + unsafe { blst_p2_mult(&mut tmp, &p2, &scalar, BLST_RESULT_SIZE) }; + unsafe { blst_p2_add(&mut res, &res, &tmp) }; + } + + unsafe { + blst_p2_serialize(out.as_mut_ptr(), &res); + } + + Ok(out) + } + fn validate_points_input(&self, p_n: &&[u8], size: usize) -> Option { + if p_n.len() % size != 0 { + return Some(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!("number of points bytes should divisible by {}", size).as_str(), + &[Val::from_u32(p_n.len() as u32).into()], + )); + } + None + } +} + +pub(crate) fn sha256_hash_from_bytes_raw( + bytes: &[u8], + budget: impl AsBudget, +) -> Result<[u8; 32], HostError> { + let _span = tracy_span!("sha256"); + budget.as_budget().charge( + ContractCostType::ComputeSha256Hash, + Some(bytes.len() as u64), + )?; + Ok(::digest(bytes).into()) +} + +pub(crate) fn sha256_hash_from_bytes( + bytes: &[u8], + budget: impl AsBudget, +) -> Result, HostError> { + Vec::::charge_bulk_init_cpy(32, budget.clone())?; + sha256_hash_from_bytes_raw(bytes, budget).map(|x| x.to_vec()) +} + +pub(crate) fn chacha20_fill_bytes( + rng: &mut ChaCha20Rng, + dest: &mut [u8], + budget: impl AsBudget, +) -> Result<(), HostError> { + tracy_span!("chacha20"); + budget + .as_budget() + .charge(ContractCostType::ChaCha20DrawBytes, Some(dest.len() as u64))?; + rng.fill_bytes(dest); + Ok(()) +} + +// It is possible that a user-provided PRNG seed (either in a test or, more +// worryingly, in a production environment) is biased: it might be all zero, or +// all copies of a single byte, or otherwise statistically unlike a uniformly +// random bitstream with roughly 50-50 zero and one bits. +// +// Unfortunately the security properties of the stream cipher ChaCha used in the +// PRNG (being "indistinguishable from uniform random") are based on the +// assumption of an _unbiased_ seed. +// +// So we run any seed through HMAC-SHA256 here, with a constant uniform random +// salt, as an unbiasing step (this is the "randomness-extractor" phase of HKDF, +// which is the only part relevant to our needs, we don't need multiple keys). + +pub(crate) fn unbias_prng_seed( + seed: &[u8; SEED_BYTES as usize], + budget: impl AsBudget, +) -> Result<[u8; SEED_BYTES as usize], HostError> { + tracy_span!("unbias_prng_seed"); + + // Salt is fixed and must not be changed; it is effectively "part of the + // protocol" and must be the same for all implementations. + // + // Note: salt is a "public random value", intended to be statistically + // similar to a 32-byte draw on /dev/random but done in a transparent and + // reproducible way. In this case we use the Stellar Public Network ID, + // `sha256("Public Global Stellar Network ; September 2015")`. + // + // This number as a bitstring has 137 zeroes and 119 ones, which is within + // the range we get when taking 32-byte samples from /dev/random (feel free + // to check this yourself). + + const SALT: [u8; 32] = hex!("7ac33997544e3175d266bd022439b22cdb16508c01163f26e5cb2a3e1045a979"); + + // Running HMAC will run SHA256 2 times on 64 bytes each time (32-byte salt + // concatenated with 32-byte input). + budget + .as_budget() + .bulk_charge(ContractCostType::ComputeSha256Hash, 2, Some(64))?; + + let mut hmac = Hmac::::new_from_slice(&SALT) + .map_err(|_| Error::from_type_and_code(ScErrorType::Context, ScErrorCode::InternalError))?; + hmac.update(seed); + Ok(hmac.finalize().into_bytes().into()) +} + +pub fn bls_fr_to_bytes(scalar_fr: blst_fr) -> Option<[u8; BLS_SCALAR_SIZE]> { + let mut scalar = blst_scalar::default(); + let mut out = [0u8; BLS_SCALAR_SIZE]; + + unsafe { + blst_scalar_from_fr(&mut scalar, &scalar_fr); + blst_lendian_from_scalar(out.as_mut_ptr(), &scalar); + } + + Some(out) +} + +pub fn scalar_fr_from_bytes(bytes: &[u8; BLS_SCALAR_SIZE]) -> Option { + let mut scalar = blst_scalar::default(); + unsafe { + blst_scalar_from_lendian(&mut scalar, bytes.as_ptr()); + if blst_scalar_fr_check(&scalar) { + let mut fr = blst_fr::default(); + blst_fr_from_scalar(&mut fr, &scalar); + Some(fr) + } else { + None + } + } +} + +pub fn decode_p1_affine(bytes: &[u8; BLST_G1_UNCOMPRESSED_SIZE]) -> Option { + let mut raw = blst_p1_affine::default(); + unsafe { + if blst_p1_uncompress(&mut raw, bytes.as_ptr()) == BLST_ERROR::BLST_SUCCESS && blst_p1_affine_in_g1(&raw) { + Some(raw) + } else { + None + } + } +} + +pub fn decode_p1(bytes: &[u8; BLST_G1_UNCOMPRESSED_SIZE]) -> Option { + decode_p1_affine(bytes).and_then(|p1_affine| { + let mut raw = blst_p1::default(); + unsafe { + blst_p1_from_affine(&mut raw, &p1_affine); + if blst_p1_on_curve(&raw) { + Some(raw) + } else { + None + } + } + }) +} + +pub fn decode_p2_affine(bytes: &[u8; BLST_G2_UNCOMPRESSED_SIZE]) -> Option { + let mut raw = blst_p2_affine::default(); + unsafe { + if blst_p2_deserialize(&mut raw, bytes.as_ptr()) == BLST_ERROR::BLST_SUCCESS && blst_p2_affine_in_g2(&raw) { + Some(raw) + } else { + None + } + } +} + +pub fn decode_p2(bytes: &[u8; BLST_G2_UNCOMPRESSED_SIZE]) -> Option { + decode_p2_affine(bytes).and_then(|p2_affine| { + let mut raw = blst_p2::default(); + unsafe { + blst_p2_from_affine(&mut raw, &p2_affine); + if blst_p2_on_curve(&raw) { + Some(raw) + } else { + None + } + } + }) +} diff --git a/soroban-env-host/src/test/bls.rs b/soroban-env-host/src/test/bls.rs new file mode 100644 index 000000000..e69de29bb From a4b46972ca8e81e12dcd1f6eac012ea4dbb204d0 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Fri, 6 Sep 2024 11:51:28 -0400 Subject: [PATCH 02/18] Preliminary setup, remove blst code, refactor `cryoto` into own module --- .../cost_types/compute_sha256_hash.rs | 2 +- .../src/cost_runner/cost_types/prng.rs | 2 +- .../src/{host/crypto.rs => crypto/mod.rs} | 3 +- soroban-env-host/src/e2e_invoke.rs | 2 +- soroban-env-host/src/host.rs | 3 +- soroban-env-host/src/host/bls.rs | 582 ------------------ soroban-env-host/src/host/data_helper.rs | 2 +- soroban-env-host/src/host/lifecycle.rs | 3 +- soroban-env-host/src/host/metered_xdr.rs | 2 +- soroban-env-host/src/host/prng.rs | 7 +- soroban-env-host/src/lib.rs | 4 +- soroban-env-host/src/test/bls.rs | 0 soroban-env-host/src/test/lifecycle.rs | 2 +- 13 files changed, 14 insertions(+), 600 deletions(-) rename soroban-env-host/src/{host/crypto.rs => crypto/mod.rs} (99%) delete mode 100644 soroban-env-host/src/host/bls.rs delete mode 100644 soroban-env-host/src/test/bls.rs diff --git a/soroban-env-host/src/cost_runner/cost_types/compute_sha256_hash.rs b/soroban-env-host/src/cost_runner/cost_types/compute_sha256_hash.rs index d90d0367d..1ed5e338b 100644 --- a/soroban-env-host/src/cost_runner/cost_types/compute_sha256_hash.rs +++ b/soroban-env-host/src/cost_runner/cost_types/compute_sha256_hash.rs @@ -2,7 +2,7 @@ use std::hint::black_box; use crate::{ cost_runner::{CostRunner, CostType}, - host::crypto::sha256_hash_from_bytes_raw, + crypto::sha256_hash_from_bytes_raw, xdr::ContractCostType::ComputeSha256Hash, }; diff --git a/soroban-env-host/src/cost_runner/cost_types/prng.rs b/soroban-env-host/src/cost_runner/cost_types/prng.rs index 2eab68486..d0840c571 100644 --- a/soroban-env-host/src/cost_runner/cost_types/prng.rs +++ b/soroban-env-host/src/cost_runner/cost_types/prng.rs @@ -4,7 +4,7 @@ use rand_chacha::ChaCha20Rng; use crate::{ cost_runner::{CostRunner, CostType}, - host::crypto::chacha20_fill_bytes, + crypto::chacha20_fill_bytes, xdr::ContractCostType::ChaCha20DrawBytes, }; diff --git a/soroban-env-host/src/host/crypto.rs b/soroban-env-host/src/crypto/mod.rs similarity index 99% rename from soroban-env-host/src/host/crypto.rs rename to soroban-env-host/src/crypto/mod.rs index b7dc03de7..a62b77e2c 100644 --- a/soroban-env-host/src/host/crypto.rs +++ b/soroban-env-host/src/crypto/mod.rs @@ -1,4 +1,4 @@ -use super::metered_clone::MeteredContainer; +use crate::host::metered_clone::MeteredContainer; use crate::host::prng::SEED_BYTES; use crate::{ budget::AsBudget, @@ -17,6 +17,7 @@ use sha3::Keccak256; use ecdsa::{signature::hazmat::PrehashVerifier, PrimeCurve, Signature, SignatureSize}; use elliptic_curve::CurveArithmetic; use generic_array::ArrayLength; +pub(crate) mod bls12_381; impl Host { // Ed25519 functions diff --git a/soroban-env-host/src/e2e_invoke.rs b/soroban-env-host/src/e2e_invoke.rs index 2150d6bd5..b327d85fe 100644 --- a/soroban-env-host/src/e2e_invoke.rs +++ b/soroban-env-host/src/e2e_invoke.rs @@ -14,10 +14,10 @@ use crate::{ }; use crate::{ budget::{AsBudget, Budget}, + crypto::sha256_hash_from_bytes, events::Events, fees::LedgerEntryRentChange, host::{ - crypto::sha256_hash_from_bytes, metered_clone::{MeteredAlloc, MeteredClone, MeteredContainer, MeteredIterator}, metered_xdr::{metered_from_xdr_with_budget, metered_write_xdr}, TraceHook, diff --git a/soroban-env-host/src/host.rs b/soroban-env-host/src/host.rs index c1317273c..a4a4b6548 100644 --- a/soroban-env-host/src/host.rs +++ b/soroban-env-host/src/host.rs @@ -24,7 +24,6 @@ use crate::{ mod comparison; mod conversion; -pub(crate) mod crypto; mod data_helper; mod declared_size; pub(crate) mod error; @@ -38,7 +37,7 @@ pub(crate) mod metered_map; pub(crate) mod metered_vector; pub(crate) mod metered_xdr; mod num; -mod prng; +pub(crate) mod prng; pub(crate) mod trace; mod validity; diff --git a/soroban-env-host/src/host/bls.rs b/soroban-env-host/src/host/bls.rs deleted file mode 100644 index 908d80842..000000000 --- a/soroban-env-host/src/host/bls.rs +++ /dev/null @@ -1,582 +0,0 @@ -#![allow(dead_code)] -use crate::host::prng::SEED_BYTES; -use crate::{ - budget::AsBudget, - err, - xdr::{ContractCostType, Hash, ScBytes, ScErrorCode, ScErrorType}, - BytesObject, Error, Host, HostError, U32Val, Val, -}; -use blst::{ - blst_fr, blst_fr_from_scalar, blst_lendian_from_scalar, blst_p1, blst_p1_add, blst_p1_affine, - blst_p1_affine_in_g1, blst_p1_from_affine, blst_p1_mult, blst_p1_on_curve, blst_p1_serialize, - blst_p1_uncompress, blst_p2, blst_p2_add, blst_p2_affine, blst_p2_affine_in_g2, - blst_p2_deserialize, blst_p2_from_affine, blst_p2_mult, blst_p2_on_curve, blst_p2_serialize, - blst_scalar, blst_scalar_fr_check, blst_scalar_from_fr, - blst_scalar_from_lendian, BLST_ERROR, -}; -use hex_literal::hex; -use hmac::{Hmac, Mac}; -use rand::RngCore; -use rand_chacha::ChaCha20Rng; -use sha2::Sha256; -use sha3::Keccak256; - -use super::metered_clone::MeteredContainer; - -pub const BLST_G1_UNCOMPRESSED_SIZE: usize = 96; -pub const BLST_G2_UNCOMPRESSED_SIZE: usize = 192; -pub const BLS_SCALAR_SIZE: usize = 32; -pub const BLST_RESULT_SIZE: usize = 255; - -impl Host { - // Ed25519 functions - pub(crate) fn ed25519_signature_from_bytesobj_input( - &self, - name: &'static str, - sig: BytesObject, - ) -> Result { - self.fixed_length_bytes_from_bytesobj_input::(name, sig) - } - - pub(crate) fn ed25519_pub_key_from_bytes( - &self, - bytes: &[u8], - ) -> Result { - self.charge_budget(ContractCostType::ComputeEd25519PubKey, None)?; - let vk_bytes = bytes.try_into().map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "invalid length of ed25519 public key", - &[Val::from_u32(bytes.len() as u32).into()], - ) - })?; - ed25519_dalek::VerifyingKey::from_bytes(vk_bytes).map_err(|_| { - err!( - self, - (ScErrorType::Crypto, ScErrorCode::InvalidInput), - "invalid ed25519 public key", - bytes - ) - }) - } - - pub(crate) fn ed25519_pub_key_from_bytesobj_input( - &self, - k: BytesObject, - ) -> Result { - self.visit_obj(k, |bytes: &ScBytes| { - self.ed25519_pub_key_from_bytes(bytes.as_slice()) - }) - } - - pub(crate) fn verify_sig_ed25519_internal( - &self, - payload: &[u8], - verifying_key: &ed25519_dalek::VerifyingKey, - sig: &ed25519_dalek::Signature, - ) -> Result<(), HostError> { - let _span = tracy_span!("ed25519 verify"); - self.charge_budget( - ContractCostType::VerifyEd25519Sig, - Some(payload.len() as u64), - )?; - verifying_key.verify_strict(payload, sig).map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "failed ED25519 verification", - &[], - ) - }) - } - - // ECDSA secp256k1 functions - - pub(crate) fn secp256k1_signature_from_bytes( - &self, - bytes: &[u8], - ) -> Result { - use k256::elliptic_curve::scalar::IsHigh; - self.charge_budget(ContractCostType::ComputeEcdsaSecp256k1Sig, None)?; - let sig: k256::ecdsa::Signature = - k256::ecdsa::Signature::try_from(bytes).map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "invalid ECDSA-secp256k1 signature", - &[], - ) - })?; - if sig.s().is_high().into() { - Err(self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "ECDSA-secp256k1 signature 's' part is not normalized to low form", - &[], - )) - } else { - Ok(sig) - } - } - - pub(crate) fn secp256k1_signature_from_bytesobj_input( - &self, - k: BytesObject, - ) -> Result { - self.visit_obj(k, |bytes: &ScBytes| { - self.secp256k1_signature_from_bytes(bytes.as_slice()) - }) - } - - // NB: not metered as it's a trivial constant cost, just converting a byte to a byte, - // and always done exactly once as part of the secp256k1 recovery path. - pub(crate) fn secp256k1_recovery_id_from_u32val( - &self, - recovery_id: U32Val, - ) -> Result { - let rid32: u32 = u32::from(recovery_id); - if rid32 > k256::ecdsa::RecoveryId::MAX as u32 { - return Err(self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "invalid ECDSA-secp256k1 recovery ID", - &[recovery_id.to_val()], - )); - } - k256::ecdsa::RecoveryId::try_from(rid32 as u8).map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "invalid ECDSA-secp256k1 recovery ID", - &[recovery_id.to_val()], - ) - }) - } - - pub(crate) fn recover_key_ecdsa_secp256k1_internal( - &self, - hash: &Hash, - sig: &k256::ecdsa::Signature, - rid: k256::ecdsa::RecoveryId, - ) -> Result { - let _span = tracy_span!("secp256k1 recover"); - self.charge_budget(ContractCostType::RecoverEcdsaSecp256k1Key, None)?; - let recovered_key = - k256::ecdsa::VerifyingKey::recover_from_prehash(hash.as_slice(), &sig, rid).map_err( - |_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "ECDSA-secp256k1 signature recovery failed", - &[], - ) - }, - )?; - let rk = ScBytes::from(crate::xdr::BytesM::try_from( - recovered_key - .to_encoded_point(/*compress:*/ false) - .as_bytes(), - )?); - self.add_host_object(rk) - } - - // SHA256 functions - - pub(crate) fn sha256_hash_from_bytesobj_input( - &self, - x: BytesObject, - ) -> Result, HostError> { - self.visit_obj(x, |bytes: &ScBytes| { - let hash = sha256_hash_from_bytes(bytes.as_slice(), self)?; - if hash.len() != 32 { - return Err(err!( - self, - (ScErrorType::Object, ScErrorCode::UnexpectedSize), - "expected 32-byte BytesObject for sha256 hash, got different size", - hash.len() - )); - } - Ok(hash) - }) - } - - // Keccak256/SHA3 functions - pub(crate) fn keccak256_hash_from_bytes_raw( - &self, - bytes: &[u8], - ) -> Result<[u8; 32], HostError> { - let _span = tracy_span!("keccak256"); - self.charge_budget( - ContractCostType::ComputeKeccak256Hash, - Some(bytes.len() as u64), - )?; - Ok(::digest(bytes).into()) - } - - pub(crate) fn keccak256_hash_from_bytes(&self, bytes: &[u8]) -> Result, HostError> { - Vec::::charge_bulk_init_cpy(32, self.as_budget())?; - self.keccak256_hash_from_bytes_raw(bytes) - .map(|x| x.to_vec()) - } - - pub(crate) fn keccak256_hash_from_bytesobj_input( - &self, - x: BytesObject, - ) -> Result, HostError> { - self.visit_obj(x, |bytes: &ScBytes| { - let hash = self.keccak256_hash_from_bytes(bytes.as_slice())?; - if hash.len() != 32 { - return Err(err!( - self, - (ScErrorType::Object, ScErrorCode::UnexpectedSize), - "expected 32-byte BytesObject for keccak256 hash, got different size", - hash.len() - )); - } - Ok(hash) - }) - } - - pub(crate) fn bls_g1_add_raw_internal( - &self, - p0: &[u8; BLST_G1_UNCOMPRESSED_SIZE], - p1: &[u8; BLST_G1_UNCOMPRESSED_SIZE], - ) -> Result<[u8; BLST_G1_UNCOMPRESSED_SIZE], HostError> { - let p0 = decode_p1(p0).ok_or_else(|| self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "Failed to decode p0", - &[], - ))?; - let p1 = decode_p1(p1).ok_or_else(|| self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "Failed to decode p1", - &[], - ))?; - let mut res = blst_p1::default(); - let mut out = [0u8; BLST_G1_UNCOMPRESSED_SIZE]; - - unsafe { blst_p1_add(&mut res, &p0, &p1) }; - - unsafe { - blst_p1_serialize(out.as_mut_ptr(), &res); - } - - Ok(out) - } - - pub(crate) fn bls_g1_mul_raw_internal( - &self, - scalar: &[u8; BLS_SCALAR_SIZE], - p1: &[u8; BLST_G1_UNCOMPRESSED_SIZE], - ) -> Result<[u8; BLST_G1_UNCOMPRESSED_SIZE], HostError> { - let p1 = decode_p1(p1).ok_or_else(|| self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "Failed to decode p1", - &[], - ))?; - let scalar_ftr = scalar_fr_from_bytes(scalar).ok_or_else(|| self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "Failed to decode scalar", - &[], - ))?; - let scalar = bls_fr_to_bytes(scalar_ftr); - let mut res = blst_p1::default(); - let mut out = [0u8; BLST_G1_UNCOMPRESSED_SIZE]; - unsafe { blst_p1_mult(&mut res, &p1, scalar.as_ptr(), BLST_RESULT_SIZE) }; - - unsafe { - blst_p1_serialize(out.as_mut_ptr(), &res); - } - - Ok(out) - } - - pub(crate) fn bls_g1_mul_raw_exp( - &self, - scalars: &[u8], - p_n: &[u8], - ) -> Result<[u8; BLST_G1_UNCOMPRESSED_SIZE], HostError> { - if let Some(value) = self.validate_points_input(&p_n, BLST_G1_UNCOMPRESSED_SIZE) { - return Err(value); - } - - let mut res = blst_p1::default(); - let mut out = [0u8; BLST_G1_UNCOMPRESSED_SIZE]; - for (i, chunk) in p_n.chunks_exact(BLST_G1_UNCOMPRESSED_SIZE).enumerate() { - let p1 = decode_p1(chunk.try_into().unwrap()).ok_or_else(|| self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "Failed to decode chunk", - &[], - ))?; - let mut tmp = blst_p1::default(); - let scalar = scalars[i]; - unsafe { blst_p1_mult(&mut tmp, &p1, &scalar, BLST_RESULT_SIZE) }; - unsafe { blst_p1_add(&mut res, &res, &tmp) }; - } - - unsafe { - blst_p1_serialize(out.as_mut_ptr(), &res); - } - - Ok(out) - } - - pub(crate) fn bls_g2_add_raw_internal( - &self, - p0: &[u8; BLST_G2_UNCOMPRESSED_SIZE], - p1: &[u8; BLST_G2_UNCOMPRESSED_SIZE], - ) -> Result<[u8; BLST_G2_UNCOMPRESSED_SIZE], HostError> { - let p0 = decode_p2(p0).ok_or_else(|| self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "Failed to decode p0", - &[], - ))?; - let p1 = decode_p2(p1).ok_or_else(|| self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "Failed to decode p1", - &[], - ))?; - let mut res = blst_p2::default(); - let mut out = [0u8; BLST_G2_UNCOMPRESSED_SIZE]; - - unsafe { blst_p2_add(&mut res, &p0, &p1) }; - - unsafe { - blst_p2_serialize(out.as_mut_ptr(), &res); - } - - Ok(out) - } - - pub(crate) fn bls_g2_mul_raw_internal( - &self, - scalar: &[u8; BLS_SCALAR_SIZE], - p1: &[u8; BLST_G2_UNCOMPRESSED_SIZE], - ) -> Result<[u8; BLST_G2_UNCOMPRESSED_SIZE], HostError> { - let p1 = decode_p2(p1).ok_or_else(|| self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "Failed to decode p1", - &[], - ))?; - let scalar_ftr = scalar_fr_from_bytes(scalar).ok_or_else(|| self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "Failed to decode scalar", - &[], - ))?; - let scalar = bls_fr_to_bytes(scalar_ftr); - let mut res = blst_p2::default(); - let mut out = [0u8; BLST_G2_UNCOMPRESSED_SIZE]; - unsafe { blst_p2_mult(&mut res, &p1, scalar.as_ptr(), BLST_RESULT_SIZE) }; - - unsafe { - blst_p2_serialize(out.as_mut_ptr(), &res); - } - Ok(out) - } - - pub(crate) fn bls_g2_mul_raw_exp_internal( - &self, - scalars: &[u8], - p_n: &[u8], - ) -> Result<[u8; BLST_G2_UNCOMPRESSED_SIZE], HostError> { - if let Some(value) = self.validate_points_input(&p_n, BLST_G2_UNCOMPRESSED_SIZE) { - return Err(value); - } - - let mut res = blst_p2::default(); - let mut out = [0u8; BLST_G2_UNCOMPRESSED_SIZE]; - for (i, chunk) in p_n.chunks_exact(BLST_G2_UNCOMPRESSED_SIZE).enumerate() { - let p2 = decode_p2(chunk.try_into().unwrap()).ok_or_else(|| self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "Failed to decode chunk", - &[], - ))?; - let mut tmp = blst_p2::default(); - let scalar = scalars[i]; - unsafe { blst_p2_mult(&mut tmp, &p2, &scalar, BLST_RESULT_SIZE) }; - unsafe { blst_p2_add(&mut res, &res, &tmp) }; - } - - unsafe { - blst_p2_serialize(out.as_mut_ptr(), &res); - } - - Ok(out) - } - fn validate_points_input(&self, p_n: &&[u8], size: usize) -> Option { - if p_n.len() % size != 0 { - return Some(self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - format!("number of points bytes should divisible by {}", size).as_str(), - &[Val::from_u32(p_n.len() as u32).into()], - )); - } - None - } -} - -pub(crate) fn sha256_hash_from_bytes_raw( - bytes: &[u8], - budget: impl AsBudget, -) -> Result<[u8; 32], HostError> { - let _span = tracy_span!("sha256"); - budget.as_budget().charge( - ContractCostType::ComputeSha256Hash, - Some(bytes.len() as u64), - )?; - Ok(::digest(bytes).into()) -} - -pub(crate) fn sha256_hash_from_bytes( - bytes: &[u8], - budget: impl AsBudget, -) -> Result, HostError> { - Vec::::charge_bulk_init_cpy(32, budget.clone())?; - sha256_hash_from_bytes_raw(bytes, budget).map(|x| x.to_vec()) -} - -pub(crate) fn chacha20_fill_bytes( - rng: &mut ChaCha20Rng, - dest: &mut [u8], - budget: impl AsBudget, -) -> Result<(), HostError> { - tracy_span!("chacha20"); - budget - .as_budget() - .charge(ContractCostType::ChaCha20DrawBytes, Some(dest.len() as u64))?; - rng.fill_bytes(dest); - Ok(()) -} - -// It is possible that a user-provided PRNG seed (either in a test or, more -// worryingly, in a production environment) is biased: it might be all zero, or -// all copies of a single byte, or otherwise statistically unlike a uniformly -// random bitstream with roughly 50-50 zero and one bits. -// -// Unfortunately the security properties of the stream cipher ChaCha used in the -// PRNG (being "indistinguishable from uniform random") are based on the -// assumption of an _unbiased_ seed. -// -// So we run any seed through HMAC-SHA256 here, with a constant uniform random -// salt, as an unbiasing step (this is the "randomness-extractor" phase of HKDF, -// which is the only part relevant to our needs, we don't need multiple keys). - -pub(crate) fn unbias_prng_seed( - seed: &[u8; SEED_BYTES as usize], - budget: impl AsBudget, -) -> Result<[u8; SEED_BYTES as usize], HostError> { - tracy_span!("unbias_prng_seed"); - - // Salt is fixed and must not be changed; it is effectively "part of the - // protocol" and must be the same for all implementations. - // - // Note: salt is a "public random value", intended to be statistically - // similar to a 32-byte draw on /dev/random but done in a transparent and - // reproducible way. In this case we use the Stellar Public Network ID, - // `sha256("Public Global Stellar Network ; September 2015")`. - // - // This number as a bitstring has 137 zeroes and 119 ones, which is within - // the range we get when taking 32-byte samples from /dev/random (feel free - // to check this yourself). - - const SALT: [u8; 32] = hex!("7ac33997544e3175d266bd022439b22cdb16508c01163f26e5cb2a3e1045a979"); - - // Running HMAC will run SHA256 2 times on 64 bytes each time (32-byte salt - // concatenated with 32-byte input). - budget - .as_budget() - .bulk_charge(ContractCostType::ComputeSha256Hash, 2, Some(64))?; - - let mut hmac = Hmac::::new_from_slice(&SALT) - .map_err(|_| Error::from_type_and_code(ScErrorType::Context, ScErrorCode::InternalError))?; - hmac.update(seed); - Ok(hmac.finalize().into_bytes().into()) -} - -pub fn bls_fr_to_bytes(scalar_fr: blst_fr) -> Option<[u8; BLS_SCALAR_SIZE]> { - let mut scalar = blst_scalar::default(); - let mut out = [0u8; BLS_SCALAR_SIZE]; - - unsafe { - blst_scalar_from_fr(&mut scalar, &scalar_fr); - blst_lendian_from_scalar(out.as_mut_ptr(), &scalar); - } - - Some(out) -} - -pub fn scalar_fr_from_bytes(bytes: &[u8; BLS_SCALAR_SIZE]) -> Option { - let mut scalar = blst_scalar::default(); - unsafe { - blst_scalar_from_lendian(&mut scalar, bytes.as_ptr()); - if blst_scalar_fr_check(&scalar) { - let mut fr = blst_fr::default(); - blst_fr_from_scalar(&mut fr, &scalar); - Some(fr) - } else { - None - } - } -} - -pub fn decode_p1_affine(bytes: &[u8; BLST_G1_UNCOMPRESSED_SIZE]) -> Option { - let mut raw = blst_p1_affine::default(); - unsafe { - if blst_p1_uncompress(&mut raw, bytes.as_ptr()) == BLST_ERROR::BLST_SUCCESS && blst_p1_affine_in_g1(&raw) { - Some(raw) - } else { - None - } - } -} - -pub fn decode_p1(bytes: &[u8; BLST_G1_UNCOMPRESSED_SIZE]) -> Option { - decode_p1_affine(bytes).and_then(|p1_affine| { - let mut raw = blst_p1::default(); - unsafe { - blst_p1_from_affine(&mut raw, &p1_affine); - if blst_p1_on_curve(&raw) { - Some(raw) - } else { - None - } - } - }) -} - -pub fn decode_p2_affine(bytes: &[u8; BLST_G2_UNCOMPRESSED_SIZE]) -> Option { - let mut raw = blst_p2_affine::default(); - unsafe { - if blst_p2_deserialize(&mut raw, bytes.as_ptr()) == BLST_ERROR::BLST_SUCCESS && blst_p2_affine_in_g2(&raw) { - Some(raw) - } else { - None - } - } -} - -pub fn decode_p2(bytes: &[u8; BLST_G2_UNCOMPRESSED_SIZE]) -> Option { - decode_p2_affine(bytes).and_then(|p2_affine| { - let mut raw = blst_p2::default(); - unsafe { - blst_p2_from_affine(&mut raw, &p2_affine); - if blst_p2_on_curve(&raw) { - Some(raw) - } else { - None - } - } - }) -} diff --git a/soroban-env-host/src/host/data_helper.rs b/soroban-env-host/src/host/data_helper.rs index 4d6870623..62c3c0e62 100644 --- a/soroban-env-host/src/host/data_helper.rs +++ b/soroban-env-host/src/host/data_helper.rs @@ -525,7 +525,7 @@ impl Host { } #[cfg(any(test, feature = "testutils"))] -use super::crypto; +use crate::crypto; #[cfg(any(test, feature = "testutils"))] use crate::storage::{AccessType, Footprint}; diff --git a/soroban-env-host/src/host/lifecycle.rs b/soroban-env-host/src/host/lifecycle.rs index b513a3309..1b570fe94 100644 --- a/soroban-env-host/src/host/lifecycle.rs +++ b/soroban-env-host/src/host/lifecycle.rs @@ -1,5 +1,5 @@ use crate::{ - err, + crypto, err, host::{ metered_clone::{MeteredAlloc, MeteredClone}, metered_write_xdr, ContractReentryMode, @@ -307,7 +307,6 @@ impl Host { } } -use super::crypto; use super::frame::CallParams; #[cfg(any(test, feature = "testutils"))] use super::ContractFunctionSet; diff --git a/soroban-env-host/src/host/metered_xdr.rs b/soroban-env-host/src/host/metered_xdr.rs index 8221292a3..77aa77d8e 100644 --- a/soroban-env-host/src/host/metered_xdr.rs +++ b/soroban-env-host/src/host/metered_xdr.rs @@ -1,6 +1,6 @@ use crate::{ budget::Budget, - host::crypto::sha256_hash_from_bytes_raw, + crypto::sha256_hash_from_bytes_raw, xdr::{ContractCostType, Limited, ReadXdr, ScBytes, ScErrorCode, ScErrorType, WriteXdr}, BytesObject, Host, HostError, DEFAULT_XDR_RW_LIMITS, }; diff --git a/soroban-env-host/src/host/prng.rs b/soroban-env-host/src/host/prng.rs index 6a9bd01d5..c122fc337 100644 --- a/soroban-env-host/src/host/prng.rs +++ b/soroban-env-host/src/host/prng.rs @@ -1,10 +1,7 @@ -use super::{ - crypto::{chacha20_fill_bytes, unbias_prng_seed}, - declared_size::DeclaredSizeForMetering, - metered_clone::MeteredContainer, -}; +use super::{declared_size::DeclaredSizeForMetering, metered_clone::MeteredContainer}; use crate::{ budget::Budget, + crypto::{chacha20_fill_bytes, unbias_prng_seed}, host::metered_clone::MeteredClone, host_object::HostVec, xdr::{ContractCostType, ScBytes, ScErrorCode, ScErrorType}, diff --git a/soroban-env-host/src/lib.rs b/soroban-env-host/src/lib.rs index e5dafaea9..072fde116 100644 --- a/soroban-env-host/src/lib.rs +++ b/soroban-env-host/src/lib.rs @@ -26,11 +26,11 @@ mod macros; pub mod budget; pub mod events; pub use events::diagnostic::DiagnosticLevel; +mod builtin_contracts; +pub(crate) mod crypto; mod host; pub(crate) mod host_object; -mod builtin_contracts; - pub mod auth; pub mod vm; pub use vm::Vm; diff --git a/soroban-env-host/src/test/bls.rs b/soroban-env-host/src/test/bls.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/soroban-env-host/src/test/lifecycle.rs b/soroban-env-host/src/test/lifecycle.rs index 84c1e2bbd..e3110e269 100644 --- a/soroban-env-host/src/test/lifecycle.rs +++ b/soroban-env-host/src/test/lifecycle.rs @@ -680,7 +680,7 @@ mod cap_54_55_56 { use soroban_test_wasms::UPLOAD_CONTRACT; use crate::{ - host::crypto::sha256_hash_from_bytes, + crypto::sha256_hash_from_bytes, storage::{FootprintMap, StorageMap}, test::observe::ObservedHost, testutils::wasm::wasm_module_with_a_bit_of_everything, From 0245e31239fe8bba430ecc6abc0619632a6faf40 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Fri, 6 Sep 2024 11:58:00 -0400 Subject: [PATCH 03/18] bls12-381 host functions implementation --- Cargo.lock | 250 +++++-- Cargo.toml | 3 +- cackle.toml | 36 + soroban-builtin-sdk-macros/Cargo.toml | 2 +- soroban-env-common/env.json | 220 +++++- soroban-env-common/src/num.rs | 12 + soroban-env-host/Cargo.toml | 11 +- .../22/test__bls12_381__g1_add.json | 92 +++ .../22/test__bls12_381__g1_msm.json | 362 ++++++++++ .../22/test__bls12_381__g1_mul.json | 28 + .../22/test__bls12_381__g2_add.json | 92 +++ .../22/test__bls12_381__g2_msm.json | 302 ++++++++ .../22/test__bls12_381__g2_mul.json | 28 + .../22/test__bls12_381__hash_to_g1.json | 58 ++ .../22/test__bls12_381__hash_to_g2.json | 58 ++ .../22/test__bls12_381__map_fp2_to_g2.json | 92 +++ .../22/test__bls12_381__map_fp_to_g1.json | 92 +++ .../22/test__bls12_381__pairing.json | 122 ++++ ..._with_wrong_arg_type_bls12_381_fr_pow.json | 189 +++++ ..._object_handle_bls12_381_g1_add_arg_0.json | 29 + ..._object_handle_bls12_381_g1_add_arg_1.json | 29 + ..._object_handle_bls12_381_g1_msm_arg_0.json | 29 + ..._object_handle_bls12_381_g1_msm_arg_1.json | 29 + ..._object_handle_bls12_381_g1_mul_arg_0.json | 29 + ..._object_handle_bls12_381_g2_add_arg_0.json | 29 + ..._object_handle_bls12_381_g2_add_arg_1.json | 29 + ..._object_handle_bls12_381_g2_msm_arg_0.json | 29 + ..._object_handle_bls12_381_g2_msm_arg_1.json | 29 + ..._object_handle_bls12_381_g2_mul_arg_0.json | 29 + ...ect_handle_bls12_381_hash_to_g1_arg_0.json | 29 + ...ect_handle_bls12_381_hash_to_g1_arg_1.json | 29 + ...ect_handle_bls12_381_hash_to_g2_arg_0.json | 29 + ...ect_handle_bls12_381_hash_to_g2_arg_1.json | 29 + ..._handle_bls12_381_map_fp2_to_g2_arg_0.json | 29 + ...t_handle_bls12_381_map_fp_to_g1_arg_0.json | 29 + ...e_bls12_381_multi_pairing_check_arg_0.json | 29 + ...e_bls12_381_multi_pairing_check_arg_1.json | 29 + soroban-env-host/src/budget.rs | 207 ++++++ soroban-env-host/src/crypto/bls12_381.rs | 665 ++++++++++++++++++ soroban-env-host/src/host.rs | 285 +++++--- soroban-env-host/src/host/num.rs | 17 + soroban-env-host/src/test/budget_metering.rs | 161 +++-- soroban-env-host/src/test/hostile.rs | 23 + soroban-env-macros/Cargo.toml | 2 +- 44 files changed, 3692 insertions(+), 239 deletions(-) create mode 100644 soroban-env-host/observations/22/test__bls12_381__g1_add.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__g1_msm.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__g1_mul.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__g2_add.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__g2_msm.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__g2_mul.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__pairing.json create mode 100644 soroban-env-host/observations/22/test__dispatch__dispatch_with_wrong_arg_type_bls12_381_fr_pow.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_1.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_1.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_mul_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_1.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_1.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_mul_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_1.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_1.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp2_to_g2_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp_to_g1_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_1.json create mode 100644 soroban-env-host/src/crypto/bls12_381.rs diff --git a/Cargo.lock b/Cargo.lock index 0e83ed246..19801a4ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,6 +77,124 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + [[package]] name = "arrayvec" version = "0.7.4" @@ -110,12 +228,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base32" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa" - [[package]] name = "base64" version = "0.13.1" @@ -149,18 +261,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "blst" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" -dependencies = [ - "cc", - "glob", - "threadpool", - "zeroize", -] - [[package]] name = "bumpalo" version = "3.13.0" @@ -182,7 +282,7 @@ dependencies = [ "num-bigint", "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -303,7 +403,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -327,7 +427,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 2.0.39", ] [[package]] @@ -338,9 +438,15 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn", + "syn 2.0.39", ] +[[package]] +name = "data-encoding" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + [[package]] name = "der" version = "0.7.6" @@ -361,6 +467,17 @@ dependencies = [ "serde", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_arbitrary" version = "1.3.2" @@ -369,7 +486,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -578,12 +695,6 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - [[package]] name = "group" version = "0.13.0" @@ -601,6 +712,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.14.1" @@ -710,9 +830,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.11.0" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -910,7 +1030,7 @@ checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -943,16 +1063,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "num_enum" version = "0.7.1" @@ -971,7 +1081,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -1303,7 +1413,7 @@ checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -1343,7 +1453,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -1422,7 +1532,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -1457,8 +1567,11 @@ name = "soroban-env-host" version = "22.0.0" dependencies = [ "arbitrary", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", "backtrace", - "blst", "bytes-lit", "curve25519-dalek", "ecdsa", @@ -1484,6 +1597,7 @@ dependencies = [ "rand_chacha", "rustversion", "sec1", + "serde", "serde_json", "sha2", "sha3", @@ -1517,7 +1631,7 @@ dependencies = [ "serde", "serde_json", "stellar-xdr", - "syn", + "syn 2.0.39", ] [[package]] @@ -1592,19 +1706,19 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stellar-strkey" -version = "0.0.8" +version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12d2bf45e114117ea91d820a846fd1afbe3ba7d717988fee094ce8227a3bf8bd" +checksum = "5e3aa3ed00e70082cb43febc1c2afa5056b9bb3e348bbb43d0cd0aa88a611144" dependencies = [ - "base32", "crate-git-revision", + "data-encoding", "thiserror", ] [[package]] name = "stellar-xdr" version = "22.0.0" -source = "git+https://github.com/stellar/rs-stellar-xdr?rev=39d7dbb0c12bd422ee43a6e2e3277789da4eaac8#39d7dbb0c12bd422ee43a6e2e3277789da4eaac8" +source = "git+https://github.com/stellar/rs-stellar-xdr?rev=5315f4c583784860c0accbb8d3bd234055a19751#5315f4c583784860c0accbb8d3bd234055a19751" dependencies = [ "arbitrary", "base64 0.13.1", @@ -1639,6 +1753,17 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.39" @@ -1699,7 +1824,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -1718,15 +1843,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - [[package]] name = "time" version = "0.3.30" @@ -1792,7 +1908,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -1921,7 +2037,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-shared", ] @@ -1943,7 +2059,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2173,7 +2289,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] [[package]] @@ -2193,5 +2309,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.39", ] diff --git a/Cargo.toml b/Cargo.toml index 82ab4d2b1..422c36e85 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ wasmparser = "=0.116.1" [workspace.dependencies.stellar-xdr] version = "=22.0.0" git = "https://github.com/stellar/rs-stellar-xdr" -rev = "39d7dbb0c12bd422ee43a6e2e3277789da4eaac8" +rev = "5315f4c583784860c0accbb8d3bd234055a19751" default-features = false [workspace.dependencies.wasmi] @@ -47,7 +47,6 @@ rev = "122a74a7c491929e5ac9de876099154ef7c06d06" features = ["no-hash-maps"] # [patch."https://github.com/stellar/rs-stellar-xdr"] -# [patch.crates-io] # stellar-xdr = { path = "../rs-stellar-xdr" } # [patch."https://github.com/stellar/wasmi"] # soroban-wasmi = { path = "../wasmi/crates/wasmi/" } diff --git a/cackle.toml b/cackle.toml index 6a4bb6214..44b49184e 100644 --- a/cackle.toml +++ b/cackle.toml @@ -17,6 +17,7 @@ include = [ [api.hash] include = [ "core::hash", + "derivative::hash", "std::collections::HashMap", "std::collections::hash", "std::sys::unix::rand::hashmap_random_keys", @@ -400,6 +401,10 @@ allow_apis = [ "hash", "thread", ] +build.allow_apis = [ + "env", + "process", +] [pkg.soroban-wasmi] allow_unsafe = true @@ -499,3 +504,34 @@ allow_unsafe = true [pkg.arrayvec] allow_unsafe = true + +[pkg.ark-serialize-derive] +allow_proc_macro = true + +[pkg.zeroize_derive] +allow_proc_macro = true + +[pkg.ark-ff-macros] +allow_proc_macro = true + +[pkg.derivative] +allow_proc_macro = true +allow_apis = [ + "hash", +] + +[pkg.ark-ff-asm] +allow_proc_macro = true + +[pkg.num-bigint] +build.allow_apis = [ + "env", + "fs", +] +allow_unsafe = true + +[pkg.data-encoding] +allow_unsafe = true + +[pkg.ark-ff] +allow_unsafe = true diff --git a/soroban-builtin-sdk-macros/Cargo.toml b/soroban-builtin-sdk-macros/Cargo.toml index 46c937b3c..b48b1add0 100644 --- a/soroban-builtin-sdk-macros/Cargo.toml +++ b/soroban-builtin-sdk-macros/Cargo.toml @@ -16,7 +16,7 @@ proc-macro = true syn = {version="2.0.39",features=["full"]} quote = "1.0.33" proc-macro2 = "1.0.69" -itertools = "0.11.0" +itertools = "0.10.5" [package.metadata.docs.rs] all-features = true diff --git a/soroban-env-common/env.json b/soroban-env-common/env.json index 4b9a8c8a0..f2589226b 100644 --- a/soroban-env-common/env.json +++ b/soroban-env-common/env.json @@ -2049,8 +2049,8 @@ "min_supported_protocol": 21 }, { - "export": "3", - "name": "bls_g1_add", + "export": "4", + "name": "bls12_381_g1_add", "args": [ { "name": "point1", @@ -2062,11 +2062,12 @@ } ], "return": "BytesObject", - "docs": "Adds two BLS12-381 G1 points given in bytes format and returns the resulting G1 point in bytes format." + "docs": "Adds two BLS12-381 G1 points given in bytes format and returns the resulting G1 point in bytes format. G1 serialization format: `be_bytes(X) || be_bytes(Y)` and the most significant three bits of X encodes flags, i.e. bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]", + "min_supported_protocol": 22 }, { - "export": "4", - "name": "bls_g1_mul", + "export": "5", + "name": "bls12_381_g1_mul", "args": [ { "name": "point", @@ -2074,15 +2075,63 @@ }, { "name": "scalar", + "type": "U256Val" + } + ], + "return": "BytesObject", + "docs": "Multiplies a BLS12-381 G1 point by a scalar, and returns the resulting G1 point in bytes format.", + "min_supported_protocol": 22 + }, + { + "export": "6", + "name": "bls12_381_g1_msm", + "args": [ + { + "name": "vp", + "type": "VecObject" + }, + { + "name": "vs", + "type": "VecObject" + } + ], + "return": "BytesObject", + "docs": "Performs multi-scalar-multiplication (inner product) on a vector of BLS12-381 G1 points by a vector of scalars, and returns the resulting G1 point in bytes format.", + "min_supported_protocol": 22 + }, + { + "export": "7", + "name": "bls12_381_map_fp_to_g1", + "args": [ + { + "name": "fp", "type": "BytesObject" } ], "return": "BytesObject", - "docs": "Multiplies a BLS12-381 G1 point by a scalar, both given in bytes format, and returns the resulting G1 point in bytes format." + "docs": "Maps a BLS12-381 field element (Fp) to G1 point. The input is a BytesObject containing Fp serialized in big-endian order", + "min_supported_protocol": 22 }, { - "export": "5", - "name": "bls_g2_add", + "export": "8", + "name": "bls12_381_hash_to_g1", + "args": [ + { + "name": "msg", + "type": "BytesObject" + }, + { + "name": "dst", + "type": "BytesObject" + } + ], + "return": "BytesObject", + "docs": "Hashes a message to a BLS12-381 G1 point, with implementation following the specification in [Hashing to Elliptic Curves](https://datatracker.ietf.org/doc/html/rfc9380) (ciphersuite 'BLS12381G1_XMD:SHA-256_SSWU_RO_'). `dst` is the domain separation tag that will be concatenated with the `msg` during hashing, it is intended to keep hashing inputs of different applications separate. It is required `0 < len(dst_bytes) < 256`. DST **must** be chosen with care to avoid compromising the application's security properties. Refer to section 3.1 in the RFC on requirements of DST.", + "min_supported_protocol": 22 + }, + { + "export": "9", + "name": "bls12_381_g2_add", "args": [ { "name": "point1", @@ -2094,11 +2143,12 @@ } ], "return": "BytesObject", - "docs": "Adds two BLS12-381 G2 points given in bytes format and returns the resulting G2 point in bytes format." + "docs": "Adds two BLS12-381 G2 points given in bytes format and returns the resulting G2 point in bytes format. G2 serialization format: be_bytes(X_c1) || be_bytes(X_c0) || be_bytes(Y_c1) || be_bytes(Y_c0), and the most significant three bits of X_c1 are flags i.e. bits(X_c1) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]", + "min_supported_protocol": 22 }, { - "export": "6", - "name": "bls_g2_mul", + "export": "a", + "name": "bls12_381_g2_mul", "args": [ { "name": "point", @@ -2106,11 +2156,157 @@ }, { "name": "scalar", + "type": "U256Val" + } + ], + "return": "BytesObject", + "docs": "Multiplies a BLS12-381 G2 point by a scalar, and returns the resulting G2 point in bytes format.", + "min_supported_protocol": 22 + }, + { + "export": "b", + "name": "bls12_381_g2_msm", + "args": [ + { + "name": "vp", + "type": "VecObject" + }, + { + "name": "vs", + "type": "VecObject" + } + ], + "return": "BytesObject", + "docs": "Performs multi-scalar-multiplication (inner product) on a BLS12-381 G2 point by a vector of scalars, and returns the resulting G2 point in bytes format.", + "min_supported_protocol": 22 + }, + { + "export": "c", + "name": "bls12_381_map_fp2_to_g2", + "args": [ + { + "name": "fp2", "type": "BytesObject" } ], "return": "BytesObject", - "docs": "Multiplies a BLS12-381 G2 point by a scalar, both given in bytes format, and returns the resulting G2 point in bytes format." + "docs": "Maps a BLS12-381 quadratic extension field element (Fp2) to G2 point. Fp2 serialization format: be_bytes(c1) || be_bytes(c0)", + "min_supported_protocol": 22 + }, + { + "export": "d", + "name": "bls12_381_hash_to_g2", + "args": [ + { + "name": "msg", + "type": "BytesObject" + }, + { + "name": "dst", + "type": "BytesObject" + } + ], + "return": "BytesObject", + "docs": "Hashes a message to a BLS12-381 G2 point, with implementation following the specification in [Hashing to Elliptic Curves](https://datatracker.ietf.org/doc/html/rfc9380) (ciphersuite 'BLS12381G2_XMD:SHA-256_SSWU_RO_'). `dst` is the domain separation tag that will be concatenated with the `msg` during hashing, it is intended to keep hashing inputs of different applications separate. It is required `0 < len(dst_bytes) < 256`. DST **must** be chosen with care to avoid compromising the application's security properties. Refer to section 3.1 in the RFC on requirements of DST.", + "min_supported_protocol": 22 + }, + { + "export": "e", + "name": "bls12_381_multi_pairing_check", + "args": [ + { + "name": "vp1", + "type": "VecObject" + }, + { + "name": "vp2", + "type": "VecObject" + } + ], + "return": "Bool", + "docs": "performs pairing operation on a vector of `G1` and a vector of `G2` points, return true if the result equals `1_fp12`", + "min_supported_protocol": 22 + }, + { + "export": "f", + "name": "bls12_381_fr_add", + "args": [ + { + "name": "lhs", + "type": "U256Val" + }, + { + "name": "rhs", + "type": "U256Val" + } + ], + "return": "U256Val", + "docs": "performs addition `(lhs + rhs) mod r` between two BLS12-381 scalar elements", + "min_supported_protocol": 22 + }, + { + "export": "g", + "name": "bls12_381_fr_sub", + "args": [ + { + "name": "lhs", + "type": "U256Val" + }, + { + "name": "rhs", + "type": "U256Val" + } + ], + "return": "U256Val", + "docs": "performs subtraction `(lhs - rhs) mod r` between two BLS12-381 scalar elements", + "min_supported_protocol": 22 + }, + { + "export": "h", + "name": "bls12_381_fr_mul", + "args": [ + { + "name": "lhs", + "type": "U256Val" + }, + { + "name": "rhs", + "type": "U256Val" + } + ], + "return": "U256Val", + "docs": "performs multiplication `(lhs * rhs) mod r` between two BLS12-381 scalar elements", + "min_supported_protocol": 22 + }, + { + "export": "i", + "name": "bls12_381_fr_pow", + "args": [ + { + "name": "lhs", + "type": "U256Val" + }, + { + "name": "rhs", + "type": "U64Val" + } + ], + "return": "U256Val", + "docs": "performs exponentiation of a BLS12-381 scalar element with a u64 exponent i.e. `lhs.exp(rhs) mod r`", + "min_supported_protocol": 22 + }, + { + "export": "j", + "name": "bls12_381_fr_inv", + "args": [ + { + "name": "lhs", + "type": "U256Val" + } + ], + "return": "U256Val", + "docs": "performs inversion of a BLS12-381 scalar element", + "min_supported_protocol": 22 } ] }, diff --git a/soroban-env-common/src/num.rs b/soroban-env-common/src/num.rs index ffd9326d4..cd58a5127 100644 --- a/soroban-env-common/src/num.rs +++ b/soroban-env-common/src/num.rs @@ -230,6 +230,12 @@ impl TryFrom for I128Small { } } +impl From for u64 { + fn from(value: U256Small) -> Self { + value.0.get_body() + } +} + impl TryFrom for U256Small { type Error = ConversionError; fn try_from(value: U256) -> Result { @@ -243,6 +249,12 @@ impl TryFrom for U256Small { } } +impl From for i64 { + fn from(value: I256Small) -> Self { + value.0.get_signed_body() + } +} + impl TryFrom for I256Small { type Error = ConversionError; fn try_from(value: I256) -> Result { diff --git a/soroban-env-host/Cargo.toml b/soroban-env-host/Cargo.toml index da1db8f61..5c1982a68 100644 --- a/soroban-env-host/Cargo.toml +++ b/soroban-env-host/Cargo.toml @@ -18,7 +18,7 @@ soroban-builtin-sdk-macros = { workspace = true } soroban-env-common = { workspace = true, features = ["std", "wasmi", "shallow-val-hash"] } wasmi = { workspace = true } wasmparser = { workspace = true } -stellar-strkey = "0.0.8" +stellar-strkey = "0.0.9" static_assertions = "1.1.0" sha2 = "0.10.8" hex-literal = "0.4.1" @@ -67,13 +67,17 @@ sha3 = "0.10.8" # which requires "4.1.3". We will need to pin to this version once Core is # updated to the new env version. curve25519-dalek = { version = ">=4.1.1", default-features = false, features = ["digest"]} +ark-bls12-381 = { version = "0.4.0"} +ark-serialize = { version = "0.4.2"} +ark-ff = { version = "0.4.2"} +ark-ec = { version = "0.4.2"} [target.'cfg(not(target_family = "wasm"))'.dependencies] tracy-client = { version = "0.16.4", features = ["enable", "timer-fallback"], default-features = false, optional = true } [dev-dependencies] hex = "0.4.3" -itertools = "0.11.0" +itertools = "0.10.5" tabwriter = "1.3.0" thousands = "0.2.0" soroban-env-macros = { workspace = true } @@ -88,6 +92,7 @@ more-asserts = "0.3.1" pretty_assertions = "1.4.0" backtrace = "0.3.69" serde_json = "1.0.108" +serde = "1.0.192" arbitrary = "1.3.2" lstsq = "0.5.0" nalgebra = { version = "0.32.3", default-features = false, features = ["std"]} @@ -100,7 +105,7 @@ p256 = {version = "0.13.2", default-features = false, features = ["alloc"]} [dev-dependencies.stellar-xdr] version = "=22.0.0" git = "https://github.com/stellar/rs-stellar-xdr" -rev = "39d7dbb0c12bd422ee43a6e2e3277789da4eaac8" +rev = "5315f4c583784860c0accbb8d3bd234055a19751" default-features = false features = ["arbitrary"] diff --git a/soroban-env-host/observations/22/test__bls12_381__g1_add.json b/soroban-env-host/observations/22/test__bls12_381__g1_add.json new file mode 100644 index 000000000..79514920f --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__g1_add.json @@ -0,0 +1,92 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_insert(Bytes(obj#3), U32(96), U32(0))": "cpu:3524, mem:128, objs:-/2@ed0b37be", + " 2 ret bytes_insert -> Ok(Bytes(obj#5))": "cpu:4692, mem:305, objs:-/3@bea4ca12", + " 3 call bls12_381_g1_add(Bytes(obj#5), Bytes(obj#1))": "", + " 4 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:4875", + " 5 call bytes_del(Bytes(obj#7), U32(95))": "cpu:6637, mem:369, objs:-/4@eac0b36a", + " 6 ret bytes_del -> Ok(Bytes(obj#9))": "cpu:7847, mem:545, objs:-/5@b60c4bf2", + " 7 call bls12_381_g1_add(Bytes(obj#9), Bytes(obj#1))": "", + " 8 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:8030", + " 9 call bytes_get(Bytes(obj#11), U32(0))": "cpu:9792, mem:609, objs:-/6@815f60e", + " 10 ret bytes_get -> Ok(U32(0))": "cpu:9914", + " 11 call bytes_put(Bytes(obj#11), U32(0), U32(128))": "", + " 12 ret bytes_put -> Ok(Bytes(obj#13))": "cpu:11082, mem:785, objs:-/7@47368e87", + " 13 call bls12_381_g1_add(Bytes(obj#13), Bytes(obj#1))": "", + " 14 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:11265", + " 15 call bytes_get(Bytes(obj#15), U32(0))": "cpu:13027, mem:849, objs:-/8@df0e6ac3", + " 16 ret bytes_get -> Ok(U32(0))": "cpu:13149", + " 17 call bytes_put(Bytes(obj#15), U32(0), U32(64))": "", + " 18 ret bytes_put -> Ok(Bytes(obj#17))": "cpu:14317, mem:1025, objs:-/9@da30bd7b", + " 19 call bls12_381_g1_add(Bytes(obj#17), Bytes(obj#1))": "", + " 20 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:14500", + " 21 call bytes_get(Bytes(obj#19), U32(0))": "cpu:16262, mem:1089, objs:-/10@ae2703c0", + " 22 ret bytes_get -> Ok(U32(0))": "cpu:16384", + " 23 call bytes_put(Bytes(obj#19), U32(0), U32(32))": "", + " 24 ret bytes_put -> Ok(Bytes(obj#21))": "cpu:17552, mem:1265, objs:-/11@3be8899", + " 25 call bls12_381_g1_add(Bytes(obj#21), Bytes(obj#1))": "", + " 26 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:17735", + " 27 call bls12_381_g1_add(Bytes(obj#25), Bytes(obj#1))": "cpu:21259, mem:1393, objs:-/13@2f190ca5", + " 28 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:755713", + " 29 call bls12_381_g1_add(Bytes(obj#29), Bytes(obj#1))": "cpu:759237, mem:1521, objs:-/15@6a6ff748", + " 30 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:1493691", + " 31 call bytes_insert(Bytes(obj#33), U32(96), U32(0))": "cpu:1497215, mem:1649, objs:-/17@466c1d02", + " 32 ret bytes_insert -> Ok(Bytes(obj#35))": "cpu:1498383, mem:1826, objs:-/18@b978e08e", + " 33 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#35))": "", + " 34 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:2232898", + " 35 call bytes_del(Bytes(obj#37), U32(95))": "cpu:2234660, mem:1890, objs:-/19@147c5316", + " 36 ret bytes_del -> Ok(Bytes(obj#39))": "cpu:2235870, mem:2066, objs:-/20@17175fb3", + " 37 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#39))": "", + " 38 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:2970385", + " 39 call bytes_get(Bytes(obj#41), U32(0))": "cpu:2972147, mem:2130, objs:-/21@a0e83378", + " 40 ret bytes_get -> Ok(U32(0))": "cpu:2972269", + " 41 call bytes_put(Bytes(obj#41), U32(0), U32(128))": "", + " 42 ret bytes_put -> Ok(Bytes(obj#43))": "cpu:2973437, mem:2306, objs:-/22@13b81969", + " 43 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#43))": "", + " 44 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:3707952", + " 45 call bytes_get(Bytes(obj#45), U32(0))": "cpu:3709714, mem:2370, objs:-/23@ef4f6d88", + " 46 ret bytes_get -> Ok(U32(0))": "cpu:3709836", + " 47 call bytes_put(Bytes(obj#45), U32(0), U32(64))": "", + " 48 ret bytes_put -> Ok(Bytes(obj#47))": "cpu:3711004, mem:2546, objs:-/24@4e30c0f9", + " 49 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#47))": "", + " 50 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:4445519", + " 51 call bytes_get(Bytes(obj#49), U32(0))": "cpu:4447281, mem:2610, objs:-/25@b2e3dac2", + " 52 ret bytes_get -> Ok(U32(0))": "cpu:4447403", + " 53 call bytes_put(Bytes(obj#49), U32(0), U32(32))": "", + " 54 ret bytes_put -> Ok(Bytes(obj#51))": "cpu:4448571, mem:2786, objs:-/26@5c6f9d9a", + " 55 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#51))": "", + " 56 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:5183086", + " 57 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#55))": "cpu:5186610, mem:2914, objs:-/28@d7f6df3c", + " 58 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:6655396", + " 59 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#59))": "cpu:6658920, mem:3042, objs:-/30@4bba4cc6", + " 60 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:8127706", + " 61 call bls12_381_g1_add(Bytes(obj#61), Bytes(obj#63))": "cpu:8131230, mem:3170, objs:-/32@fad360ae", + " 62 ret bls12_381_g1_add -> Ok(Bytes(obj#65))": "cpu:9702170, mem:3234, objs:-/33@cc2ca130", + " 63 call obj_cmp(Bytes(obj#61), Bytes(obj#65))": "", + " 64 ret obj_cmp -> Ok(0)": "cpu:9702470", + " 65 call bls12_381_g1_add(Bytes(obj#69), Bytes(obj#67))": "cpu:9705994, mem:3362, objs:-/35@c4905e8d", + " 66 ret bls12_381_g1_add -> Ok(Bytes(obj#71))": "cpu:11276934, mem:3426, objs:-/36@7d2daf56", + " 67 call obj_cmp(Bytes(obj#67), Bytes(obj#71))": "", + " 68 ret obj_cmp -> Ok(0)": "cpu:11277234", + " 69 call bls12_381_g1_add(Bytes(obj#73), Bytes(obj#75))": "cpu:11280758, mem:3554, objs:-/38@7fe06cb0", + " 70 ret bls12_381_g1_add -> Ok(Bytes(obj#77))": "cpu:12851698, mem:3618, objs:-/39@9453ad33", + " 71 call bls12_381_g1_add(Bytes(obj#75), Bytes(obj#73))": "", + " 72 ret bls12_381_g1_add -> Ok(Bytes(obj#79))": "cpu:14422638, mem:3682, objs:-/40@2e48dea9", + " 73 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "", + " 74 ret obj_cmp -> Ok(0)": "cpu:14422938", + " 75 call bls12_381_g1_add(Bytes(obj#81), Bytes(obj#83))": "cpu:14428224, mem:3874, objs:-/43@25c037a2", + " 76 ret bls12_381_g1_add -> Ok(Bytes(obj#87))": "cpu:15999164, mem:3938, objs:-/44@a152c6f1", + " 77 call bls12_381_g1_add(Bytes(obj#87), Bytes(obj#85))": "", + " 78 ret bls12_381_g1_add -> Ok(Bytes(obj#89))": "cpu:17570104, mem:4002, objs:-/45@4a05f35", + " 79 call bls12_381_g1_add(Bytes(obj#83), Bytes(obj#85))": "", + " 80 ret bls12_381_g1_add -> Ok(Bytes(obj#91))": "cpu:19141044, mem:4066, objs:-/46@d032b224", + " 81 call bls12_381_g1_add(Bytes(obj#81), Bytes(obj#91))": "", + " 82 ret bls12_381_g1_add -> Ok(Bytes(obj#93))": "cpu:20711984, mem:4130, objs:-/47@2914ad5d", + " 83 call obj_cmp(Bytes(obj#89), Bytes(obj#93))": "", + " 84 ret obj_cmp -> Ok(0)": "cpu:20712284", + " 85 call bls12_381_g1_add(Bytes(obj#95), Bytes(obj#97))": "cpu:21450140, mem:4258, objs:-/49@35cf21f2", + " 86 ret bls12_381_g1_add -> Ok(Bytes(obj#99))": "cpu:23021080, mem:4322, objs:-/50@203bb175", + " 87 call obj_cmp(Bytes(obj#99), Bytes(obj#101))": "cpu:23022842, mem:4386, objs:-/51@72363613", + " 88 ret obj_cmp -> Ok(0)": "cpu:23023142", + " 89 end": "cpu:23023142, mem:4386, prngs:-/-, objs:-/51@72363613, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g1_msm.json b/soroban-env-host/observations/22/test__bls12_381__g1_msm.json new file mode 100644 index 000000000..c1405000d --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__g1_msm.json @@ -0,0 +1,362 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call vec_new()": "", + " 2 ret vec_new -> Ok(Vec(obj#1))": "cpu:501, mem:64, objs:-/1@3e25b2a0", + " 3 call vec_new()": "", + " 4 ret vec_new -> Ok(Vec(obj#3))": "cpu:1002, mem:128, objs:-/2@14339b3d", + " 5 call bls12_381_g1_msm(Vec(obj#1), Vec(obj#3))": "", + " 6 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1246", + " 7 call bytes_new_from_slice(96)": "cpu:1907", + " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:2892, mem:304, objs:-/3@f987415", + " 9 call bytes_new_from_slice(96)": "cpu:3553", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:4538, mem:480, objs:-/4@f550cb25", + " 11 call vec_new_from_slice(2)": "", + " 12 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:5625, mem:576, objs:-/5@27393823", + " 13 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:6126, mem:640, objs:-/6@cdf18d51", + " 15 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", + " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:6627, mem:704, objs:-/7@32ea1191", + " 17 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", + " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:7128, mem:768, objs:-/8@212b406c", + " 19 call vec_new_from_slice(3)": "", + " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:8278, mem:872, objs:-/9@478d08d6", + " 21 call bls12_381_g1_msm(Vec(obj#9), Vec(obj#17))": "", + " 22 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:8522", + " 23 call vec_new_from_slice(3)": "cpu:15570, mem:1128, objs:-/13@a6af80ce", + " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:16720, mem:1232, objs:-/14@d54cb669", + " 25 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:17221, mem:1296, objs:-/15@6141f20f", + " 27 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", + " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:17722, mem:1360, objs:-/16@cf8fa86b", + " 29 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", + " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:18223, mem:1424, objs:-/17@fb010bfc", + " 31 call vec_new_from_slice(3)": "", + " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:19373, mem:1528, objs:-/18@e177307b", + " 33 call bls12_381_g1_msm(Vec(obj#27), Vec(obj#35))": "", + " 34 call vec_len(Vec(obj#27))": "cpu:19617", + " 35 ret vec_len -> Ok(U32(3))": "cpu:19739", + " 36 call vec_len(Vec(obj#35))": "cpu:1488934, mem:1832", + " 37 ret vec_len -> Ok(U32(3))": "cpu:1489056", + " 38 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1495728, mem:1944", + " 39 call vec_new_from_slice(3)": "cpu:1497490, mem:2008, objs:-/19@bb4c10e0", + " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:1498640, mem:2112, objs:-/20@edfb14a3", + " 41 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:1499141, mem:2176, objs:-/21@262b1fca", + " 43 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", + " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:1499642, mem:2240, objs:-/22@f7594d43", + " 45 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", + " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:1500143, mem:2304, objs:-/23@f2575ba5", + " 47 call vec_new_from_slice(3)": "", + " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:1501293, mem:2408, objs:-/24@2704baa1", + " 49 call bls12_381_g1_msm(Vec(obj#39), Vec(obj#47))": "", + " 50 call vec_len(Vec(obj#39))": "cpu:1501537", + " 51 ret vec_len -> Ok(U32(3))": "cpu:1501659", + " 52 call vec_len(Vec(obj#47))": "cpu:3705186, mem:2712", + " 53 ret vec_len -> Ok(U32(3))": "cpu:3705308", + " 54 ret bls12_381_g1_msm -> Ok(Bytes(obj#49))": "cpu:8492487, mem:120694, objs:-/25@1e7410d5", + " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:8494249, mem:120758, objs:-/26@54de0ee8", + " 56 ret obj_cmp -> Ok(0)": "cpu:8494549", + " 57 call bytes_new_from_slice(96)": "cpu:8495210", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:8496195, mem:120934, objs:-/27@de262326", + " 59 call bytes_new_from_slice(96)": "cpu:8496856", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:8497841, mem:121110, objs:-/28@3c763a82", + " 61 call bytes_new_from_slice(96)": "cpu:8498502", + " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:8499487, mem:121286, objs:-/29@4d732bc8", + " 63 call vec_new_from_slice(3)": "", + " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:8500637, mem:121390, objs:-/30@32f23a1e", + " 65 call vec_new_from_slice(3)": "", + " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:8501604, mem:121494, objs:-/31@28c74935", + " 67 call bls12_381_g1_msm(Vec(obj#59), Vec(obj#61))": "", + " 68 call vec_len(Vec(obj#59))": "cpu:8501848", + " 69 ret vec_len -> Ok(U32(3))": "cpu:8501970", + " 70 call vec_len(Vec(obj#61))": "cpu:10705497, mem:121798", + " 71 ret vec_len -> Ok(U32(3))": "cpu:10705619", + " 72 ret bls12_381_g1_msm -> Ok(Bytes(obj#63))": "cpu:15492615, mem:239780, objs:-/32@9bf95036", + " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:15494377, mem:239844, objs:-/33@f03a2a69", + " 74 ret obj_cmp -> Ok(0)": "cpu:15494677", + " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:15498201, mem:239972, objs:-/35@bb07e5a", + " 76 ret obj_cmp -> Ok(-1)": "cpu:15498501", + " 77 call vec_new_from_slice(2)": "cpu:16234595, mem:240036, objs:-/36@416423f7", + " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:16235682, mem:240132, objs:-/37@8add02ae", + " 79 call vec_new_from_slice(2)": "", + " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:16236647, mem:240228, objs:-/38@8f72dcef", + " 81 call bls12_381_g1_msm(Vec(obj#73), Vec(obj#75))": "", + " 82 call vec_len(Vec(obj#73))": "cpu:16236891", + " 83 ret vec_len -> Ok(U32(2))": "cpu:16237013", + " 84 call vec_len(Vec(obj#75))": "cpu:17706196, mem:240436", + " 85 ret vec_len -> Ok(U32(2))": "cpu:17706318", + " 86 ret bls12_381_g1_msm -> Ok(Bytes(obj#77))": "cpu:21738209, mem:355615, objs:-/39@980fb6be", + " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:21739971, mem:355679, objs:-/40@9d054362", + " 88 ret obj_cmp -> Ok(0)": "cpu:21740271", + " 89 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "cpu:7048, mem:256, objs:-/44@b02e8718", + " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:7549, mem:320, objs:-/45@e290dabe", + " 91 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 92 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:8050, mem:384, objs:-/46@b8a3e3e0", + " 93 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 94 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:8551, mem:448, objs:-/47@ccad87bb", + " 95 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 96 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:9052, mem:512, objs:-/48@a3d80b5e", + " 97 call vec_new_from_slice(4)": "", + " 98 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:10265, mem:624, objs:-/49@930b5e85", + " 99 call vec_new_from_slice(4)": "", + " 100 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:11478, mem:736, objs:-/50@b445fb7b", + " 101 call bls12_381_g1_msm(Vec(obj#97), Vec(obj#99))": "", + " 102 call vec_len(Vec(obj#97))": "cpu:11722", + " 103 ret vec_len -> Ok(U32(4))": "cpu:11844", + " 104 call vec_len(Vec(obj#99))": "cpu:2949715, mem:1136", + " 105 ret vec_len -> Ok(U32(4))": "cpu:2949837", + " 106 ret bls12_381_g1_msm -> Ok(Bytes(obj#101))": "cpu:8492182, mem:121921, objs:-/51@15c6fada", + " 107 call vec_new_from_slice(4)": "", + " 108 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:8493395, mem:122033, objs:-/52@329b96ba", + " 109 call vec_new_from_slice(4)": "", + " 110 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:8494608, mem:122145, objs:-/53@a190f17c", + " 111 call bls12_381_g1_msm(Vec(obj#103), Vec(obj#105))": "", + " 112 call vec_len(Vec(obj#103))": "cpu:8494852", + " 113 ret vec_len -> Ok(U32(4))": "cpu:8494974", + " 114 call vec_len(Vec(obj#105))": "cpu:11432845, mem:122545", + " 115 ret vec_len -> Ok(U32(4))": "cpu:11432967", + " 116 ret bls12_381_g1_msm -> Ok(Bytes(obj#107))": "cpu:16975312, mem:243330, objs:-/54@253f5e82", + " 117 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", + " 118 ret obj_cmp -> Ok(0)": "cpu:16975612", + " 119 call vec_new_from_slice(4)": "", + " 120 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:16976825, mem:243442, objs:-/55@ab90985a", + " 121 call vec_new_from_slice(4)": "", + " 122 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:16978038, mem:243554, objs:-/56@37997c1f", + " 123 call bls12_381_g1_msm(Vec(obj#109), Vec(obj#111))": "", + " 124 call vec_len(Vec(obj#109))": "cpu:16978282", + " 125 ret vec_len -> Ok(U32(4))": "cpu:16978404", + " 126 call vec_len(Vec(obj#111))": "cpu:19916275, mem:243954", + " 127 ret vec_len -> Ok(U32(4))": "cpu:19916397", + " 128 ret bls12_381_g1_msm -> Ok(Bytes(obj#113))": "cpu:25458742, mem:364739, objs:-/57@45f9aef8", + " 129 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", + " 130 ret obj_cmp -> Ok(0)": "cpu:25459042", + " 131 call vec_new_from_slice(4)": "", + " 132 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:25460255, mem:364851, objs:-/58@922a4b40", + " 133 call vec_new_from_slice(4)": "", + " 134 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:25461468, mem:364963, objs:-/59@8dd0ef66", + " 135 call bls12_381_g1_msm(Vec(obj#115), Vec(obj#117))": "", + " 136 call vec_len(Vec(obj#115))": "cpu:25461712", + " 137 ret vec_len -> Ok(U32(4))": "cpu:25461834", + " 138 call vec_len(Vec(obj#117))": "cpu:28399705, mem:365363", + " 139 ret vec_len -> Ok(U32(4))": "cpu:28399827", + " 140 ret bls12_381_g1_msm -> Ok(Bytes(obj#119))": "cpu:33942172, mem:486148, objs:-/60@8bdaca17", + " 141 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", + " 142 ret obj_cmp -> Ok(0)": "cpu:33942472", + " 143 call vec_new_from_slice(4)": "", + " 144 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:33943685, mem:486260, objs:-/61@df7f799", + " 145 call vec_new_from_slice(4)": "", + " 146 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:33944898, mem:486372, objs:-/62@f4da3e99", + " 147 call bls12_381_g1_msm(Vec(obj#121), Vec(obj#123))": "", + " 148 call vec_len(Vec(obj#121))": "cpu:33945142", + " 149 ret vec_len -> Ok(U32(4))": "cpu:33945264", + " 150 call vec_len(Vec(obj#123))": "cpu:36883135, mem:486772", + " 151 ret vec_len -> Ok(U32(4))": "cpu:36883257", + " 152 ret bls12_381_g1_msm -> Ok(Bytes(obj#125))": "cpu:42425602, mem:607557, objs:-/63@35eabd26", + " 153 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", + " 154 ret obj_cmp -> Ok(0)": "cpu:42425902", + " 155 call vec_new_from_slice(4)": "", + " 156 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:42427115, mem:607669, objs:-/64@6c5d9f29", + " 157 call vec_new_from_slice(4)": "", + " 158 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:42428328, mem:607781, objs:-/65@496e95da", + " 159 call bls12_381_g1_msm(Vec(obj#127), Vec(obj#129))": "", + " 160 call vec_len(Vec(obj#127))": "cpu:42428572", + " 161 ret vec_len -> Ok(U32(4))": "cpu:42428694", + " 162 call vec_len(Vec(obj#129))": "cpu:45366565, mem:608181", + " 163 ret vec_len -> Ok(U32(4))": "cpu:45366687", + " 164 ret bls12_381_g1_msm -> Ok(Bytes(obj#131))": "cpu:50909032, mem:728966, objs:-/66@5ca7aeea", + " 165 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", + " 166 ret obj_cmp -> Ok(0)": "cpu:50909332", + " 167 call vec_new_from_slice(4)": "", + " 168 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:50910545, mem:729078, objs:-/67@4a92bac5", + " 169 call vec_new_from_slice(4)": "", + " 170 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:50911758, mem:729190, objs:-/68@d3b0b9d1", + " 171 call bls12_381_g1_msm(Vec(obj#133), Vec(obj#135))": "", + " 172 call vec_len(Vec(obj#133))": "cpu:50912002", + " 173 ret vec_len -> Ok(U32(4))": "cpu:50912124", + " 174 call vec_len(Vec(obj#135))": "cpu:53849995, mem:729590", + " 175 ret vec_len -> Ok(U32(4))": "cpu:53850117", + " 176 ret bls12_381_g1_msm -> Ok(Bytes(obj#137))": "cpu:59392462, mem:850375, objs:-/69@cb830a6b", + " 177 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", + " 178 ret obj_cmp -> Ok(0)": "cpu:59392762", + " 179 call vec_new_from_slice(4)": "", + " 180 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:59393975, mem:850487, objs:-/70@a6b0753a", + " 181 call vec_new_from_slice(4)": "", + " 182 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:59395188, mem:850599, objs:-/71@79e58678", + " 183 call bls12_381_g1_msm(Vec(obj#139), Vec(obj#141))": "", + " 184 call vec_len(Vec(obj#139))": "cpu:59395432", + " 185 ret vec_len -> Ok(U32(4))": "cpu:59395554", + " 186 call vec_len(Vec(obj#141))": "cpu:62333425, mem:850999", + " 187 ret vec_len -> Ok(U32(4))": "cpu:62333547", + " 188 ret bls12_381_g1_msm -> Ok(Bytes(obj#143))": "cpu:67875892, mem:971784, objs:-/72@e635821a", + " 189 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", + " 190 ret obj_cmp -> Ok(0)": "cpu:67876192", + " 191 call vec_new_from_slice(4)": "", + " 192 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:67877405, mem:971896, objs:-/73@e9ef5fe0", + " 193 call vec_new_from_slice(4)": "", + " 194 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:67878618, mem:972008, objs:-/74@322908e2", + " 195 call bls12_381_g1_msm(Vec(obj#145), Vec(obj#147))": "", + " 196 call vec_len(Vec(obj#145))": "cpu:67878862", + " 197 ret vec_len -> Ok(U32(4))": "cpu:67878984", + " 198 call vec_len(Vec(obj#147))": "cpu:70816855, mem:972408", + " 199 ret vec_len -> Ok(U32(4))": "cpu:70816977", + " 200 ret bls12_381_g1_msm -> Ok(Bytes(obj#149))": "cpu:76359322, mem:1093193, objs:-/75@36a9773b", + " 201 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", + " 202 ret obj_cmp -> Ok(0)": "cpu:76359622", + " 203 call vec_new_from_slice(4)": "", + " 204 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:76360835, mem:1093305, objs:-/76@2f819631", + " 205 call vec_new_from_slice(4)": "", + " 206 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:76362048, mem:1093417, objs:-/77@e275a1fc", + " 207 call bls12_381_g1_msm(Vec(obj#151), Vec(obj#153))": "", + " 208 call vec_len(Vec(obj#151))": "cpu:76362292", + " 209 ret vec_len -> Ok(U32(4))": "cpu:76362414", + " 210 call vec_len(Vec(obj#153))": "cpu:79300285, mem:1093817", + " 211 ret vec_len -> Ok(U32(4))": "cpu:79300407", + " 212 ret bls12_381_g1_msm -> Ok(Bytes(obj#155))": "cpu:84842752, mem:1214602, objs:-/78@b6e9921d", + " 213 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", + " 214 ret obj_cmp -> Ok(0)": "cpu:84843052", + " 215 call vec_new_from_slice(4)": "", + " 216 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:84844265, mem:1214714, objs:-/79@c816d3a2", + " 217 call vec_new_from_slice(4)": "", + " 218 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:84845478, mem:1214826, objs:-/80@d30bb3da", + " 219 call bls12_381_g1_msm(Vec(obj#157), Vec(obj#159))": "", + " 220 call vec_len(Vec(obj#157))": "cpu:84845722", + " 221 ret vec_len -> Ok(U32(4))": "cpu:84845844", + " 222 call vec_len(Vec(obj#159))": "cpu:87783715, mem:1215226", + " 223 ret vec_len -> Ok(U32(4))": "cpu:87783837", + " 224 ret bls12_381_g1_msm -> Ok(Bytes(obj#161))": "cpu:93326182, mem:1336011, objs:-/81@807a3d69", + " 225 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", + " 226 ret obj_cmp -> Ok(0)": "cpu:93326482", + " 227 call bytes_new_from_slice(96)": "cpu:661, mem:0", + " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:1646, mem:176, objs:-/82@564277db", + " 229 call bytes_new_from_slice(96)": "cpu:2307", + " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:3292, mem:352, objs:-/83@e2a51f5f", + " 231 call bytes_new_from_slice(96)": "cpu:3953", + " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:4938, mem:528, objs:-/84@935c1ff5", + " 233 call bytes_new_from_slice(96)": "cpu:5599", + " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:6584, mem:704, objs:-/85@9f799d28", + " 235 call bytes_new_from_slice(96)": "cpu:7245", + " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:8230, mem:880, objs:-/86@2110ea71", + " 237 call bytes_new_from_slice(96)": "cpu:8891", + " 238 ret bytes_new_from_slice -> Ok(Bytes(obj#173))": "cpu:9876, mem:1056, objs:-/87@a31f3f5d", + " 239 call bytes_new_from_slice(96)": "cpu:10537", + " 240 ret bytes_new_from_slice -> Ok(Bytes(obj#175))": "cpu:11522, mem:1232, objs:-/88@dab27ae", + " 241 call bytes_new_from_slice(96)": "cpu:12183", + " 242 ret bytes_new_from_slice -> Ok(Bytes(obj#177))": "cpu:13168, mem:1408, objs:-/89@14ab5c53", + " 243 call bytes_new_from_slice(96)": "cpu:13829", + " 244 ret bytes_new_from_slice -> Ok(Bytes(obj#179))": "cpu:14814, mem:1584, objs:-/90@cee21a21", + " 245 call bytes_new_from_slice(96)": "cpu:15475", + " 246 ret bytes_new_from_slice -> Ok(Bytes(obj#181))": "cpu:16460, mem:1760, objs:-/91@ff89dba1", + " 247 call vec_new_from_slice(10)": "", + " 248 ret vec_new_from_slice -> Ok(Vec(obj#183))": "cpu:18051, mem:1920, objs:-/92@faa48f5", + " 249 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 250 ret obj_from_u256_pieces -> Ok(U256(obj#185))": "cpu:18552, mem:1984, objs:-/93@b4b734d", + " 251 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", + " 252 ret obj_from_u256_pieces -> Ok(U256(obj#187))": "cpu:19053, mem:2048, objs:-/94@7ae7ea62", + " 253 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", + " 254 ret obj_from_u256_pieces -> Ok(U256(obj#189))": "cpu:19554, mem:2112, objs:-/95@e434c126", + " 255 call obj_from_u256_pieces(12052668375261465624, 1115056820630111376, 18258964384967382160, 2376171010711085994)": "", + " 256 ret obj_from_u256_pieces -> Ok(U256(obj#191))": "cpu:20055, mem:2176, objs:-/96@183d8ea4", + " 257 call obj_from_u256_pieces(8424913463146644043, 9405616456888726852, 9448465455624499961, 13755081130528028509)": "", + " 258 ret obj_from_u256_pieces -> Ok(U256(obj#193))": "cpu:20556, mem:2240, objs:-/97@32535bd6", + " 259 call obj_from_u256_pieces(15932224105337669142, 15525077366759919847, 6907659503856715709, 14782459034950873929)": "", + " 260 ret obj_from_u256_pieces -> Ok(U256(obj#195))": "cpu:21057, mem:2304, objs:-/98@ccf04083", + " 261 call obj_from_u256_pieces(17479366267685995856, 2356981524146247225, 7204796457943508788, 837992310336682530)": "", + " 262 ret obj_from_u256_pieces -> Ok(U256(obj#197))": "cpu:21558, mem:2368, objs:-/99@8af3c26a", + " 263 call obj_from_u256_pieces(8412423812554252592, 7175749094301908688, 722094618885055393, 391155872238797487)": "", + " 264 ret obj_from_u256_pieces -> Ok(U256(obj#199))": "cpu:22059, mem:2432, objs:-/100@9dc760bc", + " 265 call obj_from_u256_pieces(828146814120262544, 5182432132645548012, 9145903145685500019, 15514783195400236392)": "", + " 266 ret obj_from_u256_pieces -> Ok(U256(obj#201))": "cpu:22560, mem:2496, objs:-/101@3290cab6", + " 267 call obj_from_u256_pieces(6220368034795741091, 7710193708629148312, 14360099323855569558, 5217142916942598430)": "", + " 268 ret obj_from_u256_pieces -> Ok(U256(obj#203))": "cpu:23061, mem:2560, objs:-/102@d4af0c4e", + " 269 call vec_new_from_slice(10)": "", + " 270 ret vec_new_from_slice -> Ok(Vec(obj#205))": "cpu:24652, mem:2720, objs:-/103@3eb62ff6", + " 271 call bls12_381_g1_msm(Vec(obj#183), Vec(obj#205))": "", + " 272 call vec_len(Vec(obj#183))": "cpu:24896", + " 273 ret vec_len -> Ok(U32(10))": "cpu:25018", + " 274 call vec_len(Vec(obj#205))": "cpu:7368953, mem:3696", + " 275 ret vec_len -> Ok(U32(10))": "cpu:7369075", + " 276 ret bls12_381_g1_msm -> Ok(Bytes(obj#207))": "cpu:17442415, mem:141298, objs:-/104@fdb04eb5", + " 277 call vec_get(Vec(obj#183), U32(0))": "cpu:17444177, mem:141362, objs:-/105@ec4ddb12", + " 278 ret vec_get -> Ok(Bytes(obj#163))": "cpu:17444403", + " 279 call vec_get(Vec(obj#205), U32(0))": "", + " 280 ret vec_get -> Ok(U256(obj#185))": "cpu:17444629", + " 281 call bls12_381_g1_mul(Bytes(obj#163), U256(obj#185))": "", + " 282 ret bls12_381_g1_mul -> Ok(Bytes(obj#211))": "cpu:20734588, mem:141426, objs:-/106@cc7eaa6b", + " 283 call bls12_381_g1_add(Bytes(obj#209), Bytes(obj#211))": "", + " 284 ret bls12_381_g1_add -> Ok(Bytes(obj#213))": "cpu:22305528, mem:141490, objs:-/107@3a1a670c", + " 285 call vec_get(Vec(obj#183), U32(1))": "", + " 286 ret vec_get -> Ok(Bytes(obj#165))": "cpu:22305754", + " 287 call vec_get(Vec(obj#205), U32(1))": "", + " 288 ret vec_get -> Ok(U256(obj#187))": "cpu:22305980", + " 289 call bls12_381_g1_mul(Bytes(obj#165), U256(obj#187))": "", + " 290 ret bls12_381_g1_mul -> Ok(Bytes(obj#215))": "cpu:25595939, mem:141554, objs:-/108@6e42150e", + " 291 call bls12_381_g1_add(Bytes(obj#213), Bytes(obj#215))": "", + " 292 ret bls12_381_g1_add -> Ok(Bytes(obj#217))": "cpu:27166879, mem:141618, objs:-/109@6a2aded5", + " 293 call vec_get(Vec(obj#183), U32(2))": "", + " 294 ret vec_get -> Ok(Bytes(obj#167))": "cpu:27167105", + " 295 call vec_get(Vec(obj#205), U32(2))": "", + " 296 ret vec_get -> Ok(U256(obj#189))": "cpu:27167331", + " 297 call bls12_381_g1_mul(Bytes(obj#167), U256(obj#189))": "", + " 298 ret bls12_381_g1_mul -> Ok(Bytes(obj#219))": "cpu:30457290, mem:141682, objs:-/110@dc6ffdf8", + " 299 call bls12_381_g1_add(Bytes(obj#217), Bytes(obj#219))": "", + " 300 ret bls12_381_g1_add -> Ok(Bytes(obj#221))": "cpu:32028230, mem:141746, objs:-/111@52ea29b3", + " 301 call vec_get(Vec(obj#183), U32(3))": "", + " 302 ret vec_get -> Ok(Bytes(obj#169))": "cpu:32028456", + " 303 call vec_get(Vec(obj#205), U32(3))": "", + " 304 ret vec_get -> Ok(U256(obj#191))": "cpu:32028682", + " 305 call bls12_381_g1_mul(Bytes(obj#169), U256(obj#191))": "", + " 306 ret bls12_381_g1_mul -> Ok(Bytes(obj#223))": "cpu:35318641, mem:141810, objs:-/112@cc74967e", + " 307 call bls12_381_g1_add(Bytes(obj#221), Bytes(obj#223))": "", + " 308 ret bls12_381_g1_add -> Ok(Bytes(obj#225))": "cpu:36889581, mem:141874, objs:-/113@36be824", + " 309 call vec_get(Vec(obj#183), U32(4))": "", + " 310 ret vec_get -> Ok(Bytes(obj#171))": "cpu:36889807", + " 311 call vec_get(Vec(obj#205), U32(4))": "", + " 312 ret vec_get -> Ok(U256(obj#193))": "cpu:36890033", + " 313 call bls12_381_g1_mul(Bytes(obj#171), U256(obj#193))": "", + " 314 ret bls12_381_g1_mul -> Ok(Bytes(obj#227))": "cpu:40179992, mem:141938, objs:-/114@7a253d36", + " 315 call bls12_381_g1_add(Bytes(obj#225), Bytes(obj#227))": "", + " 316 ret bls12_381_g1_add -> Ok(Bytes(obj#229))": "cpu:41750932, mem:142002, objs:-/115@99fe060a", + " 317 call vec_get(Vec(obj#183), U32(5))": "", + " 318 ret vec_get -> Ok(Bytes(obj#173))": "cpu:41751158", + " 319 call vec_get(Vec(obj#205), U32(5))": "", + " 320 ret vec_get -> Ok(U256(obj#195))": "cpu:41751384", + " 321 call bls12_381_g1_mul(Bytes(obj#173), U256(obj#195))": "", + " 322 ret bls12_381_g1_mul -> Ok(Bytes(obj#231))": "cpu:45041343, mem:142066, objs:-/116@a9d3bff3", + " 323 call bls12_381_g1_add(Bytes(obj#229), Bytes(obj#231))": "", + " 324 ret bls12_381_g1_add -> Ok(Bytes(obj#233))": "cpu:46612283, mem:142130, objs:-/117@17c7b36e", + " 325 call vec_get(Vec(obj#183), U32(6))": "", + " 326 ret vec_get -> Ok(Bytes(obj#175))": "cpu:46612509", + " 327 call vec_get(Vec(obj#205), U32(6))": "", + " 328 ret vec_get -> Ok(U256(obj#197))": "cpu:46612735", + " 329 call bls12_381_g1_mul(Bytes(obj#175), U256(obj#197))": "", + " 330 ret bls12_381_g1_mul -> Ok(Bytes(obj#235))": "cpu:49902694, mem:142194, objs:-/118@1df5bedb", + " 331 call bls12_381_g1_add(Bytes(obj#233), Bytes(obj#235))": "", + " 332 ret bls12_381_g1_add -> Ok(Bytes(obj#237))": "cpu:51473634, mem:142258, objs:-/119@aa439247", + " 333 call vec_get(Vec(obj#183), U32(7))": "", + " 334 ret vec_get -> Ok(Bytes(obj#177))": "cpu:51473860", + " 335 call vec_get(Vec(obj#205), U32(7))": "", + " 336 ret vec_get -> Ok(U256(obj#199))": "cpu:51474086", + " 337 call bls12_381_g1_mul(Bytes(obj#177), U256(obj#199))": "", + " 338 ret bls12_381_g1_mul -> Ok(Bytes(obj#239))": "cpu:54764045, mem:142322, objs:-/120@9af9e040", + " 339 call bls12_381_g1_add(Bytes(obj#237), Bytes(obj#239))": "", + " 340 ret bls12_381_g1_add -> Ok(Bytes(obj#241))": "cpu:56334985, mem:142386, objs:-/121@c40edba", + " 341 call vec_get(Vec(obj#183), U32(8))": "", + " 342 ret vec_get -> Ok(Bytes(obj#179))": "cpu:56335211", + " 343 call vec_get(Vec(obj#205), U32(8))": "", + " 344 ret vec_get -> Ok(U256(obj#201))": "cpu:56335437", + " 345 call bls12_381_g1_mul(Bytes(obj#179), U256(obj#201))": "", + " 346 ret bls12_381_g1_mul -> Ok(Bytes(obj#243))": "cpu:59625396, mem:142450, objs:-/122@1ece2a5b", + " 347 call bls12_381_g1_add(Bytes(obj#241), Bytes(obj#243))": "", + " 348 ret bls12_381_g1_add -> Ok(Bytes(obj#245))": "cpu:61196336, mem:142514, objs:-/123@dd3ac0cb", + " 349 call vec_get(Vec(obj#183), U32(9))": "", + " 350 ret vec_get -> Ok(Bytes(obj#181))": "cpu:61196562", + " 351 call vec_get(Vec(obj#205), U32(9))": "", + " 352 ret vec_get -> Ok(U256(obj#203))": "cpu:61196788", + " 353 call bls12_381_g1_mul(Bytes(obj#181), U256(obj#203))": "", + " 354 ret bls12_381_g1_mul -> Ok(Bytes(obj#247))": "cpu:64486747, mem:142578, objs:-/124@804c4396", + " 355 call bls12_381_g1_add(Bytes(obj#245), Bytes(obj#247))": "", + " 356 ret bls12_381_g1_add -> Ok(Bytes(obj#249))": "cpu:66057687, mem:142642, objs:-/125@24d96742", + " 357 call obj_cmp(Bytes(obj#249), Bytes(obj#207))": "", + " 358 ret obj_cmp -> Ok(0)": "cpu:66057987", + " 359 end": "cpu:66057987, mem:142642, prngs:-/-, objs:-/125@24d96742, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g1_mul.json b/soroban-env-host/observations/22/test__bls12_381__g1_mul.json new file mode 100644 index 000000000..077ed8879 --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__g1_mul.json @@ -0,0 +1,28 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call obj_from_u256_pieces(0, 0, 0, 0)": "cpu:1762, mem:64, objs:-/1@2142c5f5", + " 2 ret obj_from_u256_pieces -> Ok(U256(obj#3))": "cpu:2263, mem:128, objs:-/2@a8ecc130", + " 3 call bls12_381_g1_mul(Bytes(obj#1), U256(obj#3))": "", + " 4 ret bls12_381_g1_mul -> Ok(Bytes(obj#5))": "cpu:3292222, mem:192, objs:-/3@ee8b49", + " 5 call obj_cmp(Bytes(obj#5), Bytes(obj#7))": "cpu:3293984, mem:256, objs:-/4@ccb573fe", + " 6 ret obj_cmp -> Ok(0)": "cpu:3294284", + " 7 call bls12_381_g1_mul(Bytes(obj#9), U256(1))": "cpu:3296046, mem:320, objs:-/5@2c88203b", + " 8 ret bls12_381_g1_mul -> Ok(Bytes(obj#11))": "cpu:6585883, mem:384, objs:-/6@b1c17ed5", + " 9 call obj_cmp(Bytes(obj#11), Bytes(obj#9))": "", + " 10 ret obj_cmp -> Ok(0)": "cpu:6586183", + " 11 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "cpu:6587945, mem:448, objs:-/7@5f0fa973", + " 12 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:6588446, mem:512, objs:-/8@ef6d15a2", + " 13 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#17))": "cpu:6588947, mem:576, objs:-/9@65c757ad", + " 15 call bls12_381_g1_mul(Bytes(obj#13), U256(obj#15))": "", + " 16 ret bls12_381_g1_mul -> Ok(Bytes(obj#19))": "cpu:9878906, mem:640, objs:-/10@b54fc463", + " 17 call bls12_381_g1_mul(Bytes(obj#19), U256(obj#17))": "", + " 18 ret bls12_381_g1_mul -> Ok(Bytes(obj#21))": "cpu:13168865, mem:704, objs:-/11@41723b30", + " 19 call bls12_381_g1_mul(Bytes(obj#13), U256(obj#17))": "", + " 20 ret bls12_381_g1_mul -> Ok(Bytes(obj#23))": "cpu:16458824, mem:768, objs:-/12@7f57c0b", + " 21 call bls12_381_g1_mul(Bytes(obj#23), U256(obj#15))": "", + " 22 ret bls12_381_g1_mul -> Ok(Bytes(obj#25))": "cpu:19748783, mem:832, objs:-/13@7e13d5d7", + " 23 call obj_cmp(Bytes(obj#21), Bytes(obj#25))": "", + " 24 ret obj_cmp -> Ok(0)": "cpu:19749083", + " 25 end": "cpu:19749083, mem:832, prngs:-/-, objs:-/13@7e13d5d7, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g2_add.json b/soroban-env-host/observations/22/test__bls12_381__g2_add.json new file mode 100644 index 000000000..b9a5003a3 --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__g2_add.json @@ -0,0 +1,92 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_insert(Bytes(obj#3), U32(192), U32(0))": "cpu:6168, mem:128, objs:-/2@7a834a03", + " 2 ret bytes_insert -> Ok(Bytes(obj#5))": "cpu:7360, mem:401, objs:-/3@ea823cd2", + " 3 call bls12_381_g2_add(Bytes(obj#5), Bytes(obj#1))": "", + " 4 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:7543", + " 5 call bytes_del(Bytes(obj#7), U32(191))": "cpu:10627, mem:465, objs:-/4@13da096b", + " 6 ret bytes_del -> Ok(Bytes(obj#9))": "cpu:11861, mem:737, objs:-/5@a77bc7b5", + " 7 call bls12_381_g2_add(Bytes(obj#9), Bytes(obj#1))": "", + " 8 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:12044", + " 9 call bytes_get(Bytes(obj#11), U32(0))": "cpu:15128, mem:801, objs:-/6@7c9b95c3", + " 10 ret bytes_get -> Ok(U32(4))": "cpu:15250", + " 11 call bytes_put(Bytes(obj#11), U32(0), U32(132))": "", + " 12 ret bytes_put -> Ok(Bytes(obj#13))": "cpu:16442, mem:1073, objs:-/7@29e01e22", + " 13 call bls12_381_g2_add(Bytes(obj#13), Bytes(obj#1))": "", + " 14 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:16625", + " 15 call bytes_get(Bytes(obj#15), U32(0))": "cpu:19709, mem:1137, objs:-/8@35a3ec44", + " 16 ret bytes_get -> Ok(U32(4))": "cpu:19831", + " 17 call bytes_put(Bytes(obj#15), U32(0), U32(68))": "", + " 18 ret bytes_put -> Ok(Bytes(obj#17))": "cpu:21023, mem:1409, objs:-/9@264a288a", + " 19 call bls12_381_g2_add(Bytes(obj#17), Bytes(obj#1))": "", + " 20 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:21206", + " 21 call bytes_get(Bytes(obj#19), U32(0))": "cpu:24290, mem:1473, objs:-/10@326c7a6e", + " 22 ret bytes_get -> Ok(U32(4))": "cpu:24412", + " 23 call bytes_put(Bytes(obj#19), U32(0), U32(36))": "", + " 24 ret bytes_put -> Ok(Bytes(obj#21))": "cpu:25604, mem:1745, objs:-/11@65530b6b", + " 25 call bls12_381_g2_add(Bytes(obj#21), Bytes(obj#1))": "", + " 26 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:25787", + " 27 call bls12_381_g2_add(Bytes(obj#25), Bytes(obj#1))": "cpu:31955, mem:1873, objs:-/13@58ec5dc0", + " 28 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:1099510", + " 29 call bls12_381_g2_add(Bytes(obj#29), Bytes(obj#1))": "cpu:1105678, mem:2001, objs:-/15@77a6d140", + " 30 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:2173233", + " 31 call bytes_insert(Bytes(obj#33), U32(192), U32(0))": "cpu:2179401, mem:2129, objs:-/17@16506b89", + " 32 ret bytes_insert -> Ok(Bytes(obj#35))": "cpu:2180593, mem:2402, objs:-/18@41ebd242", + " 33 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#35))": "", + " 34 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:3248209", + " 35 call bytes_del(Bytes(obj#37), U32(191))": "cpu:3251293, mem:2466, objs:-/19@3a23070d", + " 36 ret bytes_del -> Ok(Bytes(obj#39))": "cpu:3252527, mem:2738, objs:-/20@c984b39b", + " 37 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#39))": "", + " 38 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:4320143", + " 39 call bytes_get(Bytes(obj#41), U32(0))": "cpu:4323227, mem:2802, objs:-/21@2dead73e", + " 40 ret bytes_get -> Ok(U32(4))": "cpu:4323349", + " 41 call bytes_put(Bytes(obj#41), U32(0), U32(132))": "", + " 42 ret bytes_put -> Ok(Bytes(obj#43))": "cpu:4324541, mem:3074, objs:-/22@a2251eea", + " 43 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#43))": "", + " 44 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:5392157", + " 45 call bytes_get(Bytes(obj#45), U32(0))": "cpu:5395241, mem:3138, objs:-/23@a6007beb", + " 46 ret bytes_get -> Ok(U32(4))": "cpu:5395363", + " 47 call bytes_put(Bytes(obj#45), U32(0), U32(68))": "", + " 48 ret bytes_put -> Ok(Bytes(obj#47))": "cpu:5396555, mem:3410, objs:-/24@c75f9a54", + " 49 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#47))": "", + " 50 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:6464171", + " 51 call bytes_get(Bytes(obj#49), U32(0))": "cpu:6467255, mem:3474, objs:-/25@145e2bba", + " 52 ret bytes_get -> Ok(U32(4))": "cpu:6467377", + " 53 call bytes_put(Bytes(obj#49), U32(0), U32(36))": "", + " 54 ret bytes_put -> Ok(Bytes(obj#51))": "cpu:6468569, mem:3746, objs:-/26@bbe552fc", + " 55 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#51))": "", + " 56 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:7536185", + " 57 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#55))": "cpu:7542353, mem:3874, objs:-/28@dc9af8d6", + " 58 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:9677341", + " 59 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#59))": "cpu:9683509, mem:4002, objs:-/30@aac50928", + " 60 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:11818497", + " 61 call bls12_381_g2_add(Bytes(obj#61), Bytes(obj#63))": "cpu:11824665, mem:4130, objs:-/32@e5f05cac", + " 62 ret bls12_381_g2_add -> Ok(Bytes(obj#65))": "cpu:14088747, mem:4194, objs:-/33@213340fe", + " 63 call obj_cmp(Bytes(obj#61), Bytes(obj#65))": "", + " 64 ret obj_cmp -> Ok(0)": "cpu:14089059", + " 65 call bls12_381_g2_add(Bytes(obj#69), Bytes(obj#67))": "cpu:14095227, mem:4322, objs:-/35@24fef9c7", + " 66 ret bls12_381_g2_add -> Ok(Bytes(obj#71))": "cpu:16359309, mem:4386, objs:-/36@74f33d01", + " 67 call obj_cmp(Bytes(obj#67), Bytes(obj#71))": "", + " 68 ret obj_cmp -> Ok(0)": "cpu:16359621", + " 69 call bls12_381_g2_add(Bytes(obj#73), Bytes(obj#75))": "cpu:16365789, mem:4514, objs:-/38@e23e07b5", + " 70 ret bls12_381_g2_add -> Ok(Bytes(obj#77))": "cpu:18629871, mem:4578, objs:-/39@d7a98b6a", + " 71 call bls12_381_g2_add(Bytes(obj#75), Bytes(obj#73))": "", + " 72 ret bls12_381_g2_add -> Ok(Bytes(obj#79))": "cpu:20893953, mem:4642, objs:-/40@5f1971a2", + " 73 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "", + " 74 ret obj_cmp -> Ok(0)": "cpu:20894265", + " 75 call bls12_381_g2_add(Bytes(obj#81), Bytes(obj#83))": "cpu:20903517, mem:4834, objs:-/43@3c78a27e", + " 76 ret bls12_381_g2_add -> Ok(Bytes(obj#87))": "cpu:23167599, mem:4898, objs:-/44@30e1ea1", + " 77 call bls12_381_g2_add(Bytes(obj#87), Bytes(obj#85))": "", + " 78 ret bls12_381_g2_add -> Ok(Bytes(obj#89))": "cpu:25431681, mem:4962, objs:-/45@9d8c0cf8", + " 79 call bls12_381_g2_add(Bytes(obj#83), Bytes(obj#85))": "", + " 80 ret bls12_381_g2_add -> Ok(Bytes(obj#91))": "cpu:27695763, mem:5026, objs:-/46@1c8474f0", + " 81 call bls12_381_g2_add(Bytes(obj#81), Bytes(obj#91))": "", + " 82 ret bls12_381_g2_add -> Ok(Bytes(obj#93))": "cpu:29959845, mem:5090, objs:-/47@3be4f98e", + " 83 call obj_cmp(Bytes(obj#89), Bytes(obj#93))": "", + " 84 ret obj_cmp -> Ok(0)": "cpu:29960157", + " 85 call bls12_381_g2_add(Bytes(obj#95), Bytes(obj#97))": "cpu:31033758, mem:5218, objs:-/49@a05cc0e8", + " 86 ret bls12_381_g2_add -> Ok(Bytes(obj#99))": "cpu:33297840, mem:5282, objs:-/50@ffa9bc11", + " 87 call obj_cmp(Bytes(obj#99), Bytes(obj#101))": "cpu:33300924, mem:5346, objs:-/51@9d61095a", + " 88 ret obj_cmp -> Ok(0)": "cpu:33301236", + " 89 end": "cpu:33301236, mem:5346, prngs:-/-, objs:-/51@9d61095a, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g2_msm.json b/soroban-env-host/observations/22/test__bls12_381__g2_msm.json new file mode 100644 index 000000000..ac77d383f --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__g2_msm.json @@ -0,0 +1,302 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call vec_new()": "", + " 2 ret vec_new -> Ok(Vec(obj#1))": "cpu:501, mem:64, objs:-/1@3e25b2a0", + " 3 call vec_new()": "", + " 4 ret vec_new -> Ok(Vec(obj#3))": "cpu:1002, mem:128, objs:-/2@14339b3d", + " 5 call bls12_381_g2_msm(Vec(obj#1), Vec(obj#3))": "", + " 6 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1246", + " 7 call bytes_new_from_slice(192)": "cpu:1907", + " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:2916, mem:400, objs:-/3@bd2bad33", + " 9 call bytes_new_from_slice(192)": "cpu:3577", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:4586, mem:672, objs:-/4@84c0214b", + " 11 call vec_new_from_slice(2)": "", + " 12 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:5673, mem:768, objs:-/5@e2867bea", + " 13 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:6174, mem:832, objs:-/6@244a4716", + " 15 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", + " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:6675, mem:896, objs:-/7@c7c96da7", + " 17 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", + " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:7176, mem:960, objs:-/8@a5e0a3fd", + " 19 call vec_new_from_slice(3)": "", + " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:8326, mem:1064, objs:-/9@2a1f5271", + " 21 call bls12_381_g2_msm(Vec(obj#9), Vec(obj#17))": "", + " 22 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:8570", + " 23 call vec_new_from_slice(3)": "cpu:20906, mem:1320, objs:-/13@e77c0ee9", + " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:22056, mem:1424, objs:-/14@9ff18891", + " 25 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:22557, mem:1488, objs:-/15@233f8d03", + " 27 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", + " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:23058, mem:1552, objs:-/16@706b91ae", + " 29 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", + " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:23559, mem:1616, objs:-/17@41f28884", + " 31 call vec_new_from_slice(3)": "", + " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:24709, mem:1720, objs:-/18@7a8c084", + " 33 call bls12_381_g2_msm(Vec(obj#27), Vec(obj#35))": "", + " 34 call vec_len(Vec(obj#27))": "cpu:24953", + " 35 ret vec_len -> Ok(U32(3))": "cpu:25075", + " 36 call vec_len(Vec(obj#35))": "cpu:2160508, mem:2312", + " 37 ret vec_len -> Ok(U32(3))": "cpu:2160630", + " 38 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:2167302, mem:2424", + " 39 call vec_new_from_slice(3)": "cpu:2170386, mem:2488, objs:-/19@96bcbe6d", + " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:2171536, mem:2592, objs:-/20@2b984ac", + " 41 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:2172037, mem:2656, objs:-/21@fecd7791", + " 43 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", + " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:2172538, mem:2720, objs:-/22@fbcd29df", + " 45 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", + " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:2173039, mem:2784, objs:-/23@9bd2dcf2", + " 47 call vec_new_from_slice(3)": "", + " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:2174189, mem:2888, objs:-/24@a5686071", + " 49 call bls12_381_g2_msm(Vec(obj#39), Vec(obj#47))": "", + " 50 call vec_len(Vec(obj#39))": "cpu:2174433", + " 51 ret vec_len -> Ok(U32(3))": "cpu:2174555", + " 52 call vec_len(Vec(obj#47))": "cpu:5377421, mem:3480", + " 53 ret vec_len -> Ok(U32(3))": "cpu:5377543", + " 54 ret bls12_381_g2_msm -> Ok(Bytes(obj#49))": "cpu:20781898, mem:231622, objs:-/25@98d566d6", + " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:20784982, mem:231686, objs:-/26@36ea69e7", + " 56 ret obj_cmp -> Ok(0)": "cpu:20785294", + " 57 call bytes_new_from_slice(192)": "cpu:20785955", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:20786964, mem:231958, objs:-/27@1438f5d7", + " 59 call bytes_new_from_slice(192)": "cpu:20787625", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:20788634, mem:232230, objs:-/28@23130a55", + " 61 call bytes_new_from_slice(192)": "cpu:20789295", + " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:20790304, mem:232502, objs:-/29@59c6b86b", + " 63 call vec_new_from_slice(3)": "", + " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:20791454, mem:232606, objs:-/30@e2b0ab5f", + " 65 call vec_new_from_slice(3)": "", + " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:20792421, mem:232710, objs:-/31@b828c2db", + " 67 call bls12_381_g2_msm(Vec(obj#59), Vec(obj#61))": "", + " 68 call vec_len(Vec(obj#59))": "cpu:20792665", + " 69 ret vec_len -> Ok(U32(3))": "cpu:20792787", + " 70 call vec_len(Vec(obj#61))": "cpu:23995653, mem:233302", + " 71 ret vec_len -> Ok(U32(3))": "cpu:23995775", + " 72 ret bls12_381_g2_msm -> Ok(Bytes(obj#63))": "cpu:39399947, mem:461444, objs:-/32@5666e6e6", + " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:39403031, mem:461508, objs:-/33@278fef74", + " 74 ret obj_cmp -> Ok(0)": "cpu:39403343", + " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:39409511, mem:461636, objs:-/35@a12d75b5", + " 76 ret obj_cmp -> Ok(-1)": "cpu:39409823", + " 77 call vec_new_from_slice(2)": "cpu:40480340, mem:461700, objs:-/36@6f0e35f0", + " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:40481427, mem:461796, objs:-/37@71a8099", + " 79 call vec_new_from_slice(2)": "", + " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:40482392, mem:461892, objs:-/38@ac162eb3", + " 81 call bls12_381_g2_msm(Vec(obj#73), Vec(obj#75))": "", + " 82 call vec_len(Vec(obj#73))": "cpu:40482636", + " 83 ret vec_len -> Ok(U32(2))": "cpu:40482758", + " 84 call vec_len(Vec(obj#75))": "cpu:42618167, mem:462292", + " 85 ret vec_len -> Ok(U32(2))": "cpu:42618289", + " 86 ret bls12_381_g2_msm -> Ok(Bytes(obj#77))": "cpu:55601187, mem:687631, objs:-/39@5464952e", + " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:55604271, mem:687695, objs:-/40@f0952b2", + " 88 ret obj_cmp -> Ok(0)": "cpu:55604583", + " 89 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "cpu:55616919, mem:687951, objs:-/44@b333c2af", + " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:55617420, mem:688015, objs:-/45@3ff9e222", + " 91 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 92 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:55617921, mem:688079, objs:-/46@2ff8d751", + " 93 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 94 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:55618422, mem:688143, objs:-/47@345f6187", + " 95 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 96 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:55618923, mem:688207, objs:-/48@57ca0b1f", + " 97 call vec_new_from_slice(4)": "", + " 98 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:55620136, mem:688319, objs:-/49@659ce14b", + " 99 call vec_new_from_slice(4)": "", + " 100 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:55621349, mem:688431, objs:-/50@13fab837", + " 101 call bls12_381_g2_msm(Vec(obj#97), Vec(obj#99))": "", + " 102 call vec_len(Vec(obj#97))": "cpu:55621593", + " 103 ret vec_len -> Ok(U32(4))": "cpu:55621715", + " 104 call vec_len(Vec(obj#99))": "cpu:59892038, mem:689215", + " 105 ret vec_len -> Ok(U32(4))": "cpu:59892160", + " 106 ret bls12_381_g2_msm -> Ok(Bytes(obj#101))": "cpu:77717850, mem:920160, objs:-/51@bcecd339", + " 107 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 108 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:1213, mem:112, objs:-/52@b6aec1e2", + " 109 call vec_new_from_slice(4)": "", + " 110 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:2426, mem:224, objs:-/53@a14e2ca7", + " 111 call bls12_381_g2_msm(Vec(obj#103), Vec(obj#105))": "", + " 112 call vec_len(Vec(obj#103))": "cpu:2670", + " 113 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 114 call vec_len(Vec(obj#105))": "cpu:4273115, mem:1008", + " 115 ret vec_len -> Ok(U32(4))": "cpu:4273237", + " 116 ret bls12_381_g2_msm -> Ok(Bytes(obj#107))": "cpu:22098927, mem:231953, objs:-/54@77da79e9", + " 117 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", + " 118 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 119 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 120 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:1213, mem:112, objs:-/55@76e853f9", + " 121 call vec_new_from_slice(4)": "", + " 122 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:2426, mem:224, objs:-/56@2aeeef8c", + " 123 call bls12_381_g2_msm(Vec(obj#109), Vec(obj#111))": "", + " 124 call vec_len(Vec(obj#109))": "cpu:2670", + " 125 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 126 call vec_len(Vec(obj#111))": "cpu:4273115, mem:1008", + " 127 ret vec_len -> Ok(U32(4))": "cpu:4273237", + " 128 ret bls12_381_g2_msm -> Ok(Bytes(obj#113))": "cpu:22098927, mem:231953, objs:-/57@bdc6cf65", + " 129 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", + " 130 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 131 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 132 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:1213, mem:112, objs:-/58@c0ed5bdc", + " 133 call vec_new_from_slice(4)": "", + " 134 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:2426, mem:224, objs:-/59@db0d275e", + " 135 call bls12_381_g2_msm(Vec(obj#115), Vec(obj#117))": "", + " 136 call vec_len(Vec(obj#115))": "cpu:2670", + " 137 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 138 call vec_len(Vec(obj#117))": "cpu:4273115, mem:1008", + " 139 ret vec_len -> Ok(U32(4))": "cpu:4273237", + " 140 ret bls12_381_g2_msm -> Ok(Bytes(obj#119))": "cpu:22098927, mem:231953, objs:-/60@29fa32a5", + " 141 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", + " 142 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 143 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 144 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:1213, mem:112, objs:-/61@6ae7e674", + " 145 call vec_new_from_slice(4)": "", + " 146 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:2426, mem:224, objs:-/62@85e80ae7", + " 147 call bls12_381_g2_msm(Vec(obj#121), Vec(obj#123))": "", + " 148 call vec_len(Vec(obj#121))": "cpu:2670", + " 149 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 150 call vec_len(Vec(obj#123))": "cpu:4273115, mem:1008", + " 151 ret vec_len -> Ok(U32(4))": "cpu:4273237", + " 152 ret bls12_381_g2_msm -> Ok(Bytes(obj#125))": "cpu:22098927, mem:231953, objs:-/63@6f103dea", + " 153 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", + " 154 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 155 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 156 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:1213, mem:112, objs:-/64@498d3232", + " 157 call vec_new_from_slice(4)": "", + " 158 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:2426, mem:224, objs:-/65@e613eae5", + " 159 call bls12_381_g2_msm(Vec(obj#127), Vec(obj#129))": "", + " 160 call vec_len(Vec(obj#127))": "cpu:2670", + " 161 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 162 call vec_len(Vec(obj#129))": "cpu:4273115, mem:1008", + " 163 ret vec_len -> Ok(U32(4))": "cpu:4273237", + " 164 ret bls12_381_g2_msm -> Ok(Bytes(obj#131))": "cpu:22098927, mem:231953, objs:-/66@1e8e4f19", + " 165 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", + " 166 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 167 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 168 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:1213, mem:112, objs:-/67@f1965d8", + " 169 call vec_new_from_slice(4)": "", + " 170 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:2426, mem:224, objs:-/68@97a83188", + " 171 call bls12_381_g2_msm(Vec(obj#133), Vec(obj#135))": "", + " 172 call vec_len(Vec(obj#133))": "cpu:2670", + " 173 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 174 call vec_len(Vec(obj#135))": "cpu:4273115, mem:1008", + " 175 ret vec_len -> Ok(U32(4))": "cpu:4273237", + " 176 ret bls12_381_g2_msm -> Ok(Bytes(obj#137))": "cpu:22098927, mem:231953, objs:-/69@6c02ddf1", + " 177 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", + " 178 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 179 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 180 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:1213, mem:112, objs:-/70@1c9c1a13", + " 181 call vec_new_from_slice(4)": "", + " 182 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:2426, mem:224, objs:-/71@509f50a4", + " 183 call bls12_381_g2_msm(Vec(obj#139), Vec(obj#141))": "", + " 184 call vec_len(Vec(obj#139))": "cpu:2670", + " 185 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 186 call vec_len(Vec(obj#141))": "cpu:4273115, mem:1008", + " 187 ret vec_len -> Ok(U32(4))": "cpu:4273237", + " 188 ret bls12_381_g2_msm -> Ok(Bytes(obj#143))": "cpu:22098927, mem:231953, objs:-/72@f2dff8b4", + " 189 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", + " 190 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 191 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 192 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:1213, mem:112, objs:-/73@19908765", + " 193 call vec_new_from_slice(4)": "", + " 194 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:2426, mem:224, objs:-/74@760de20c", + " 195 call bls12_381_g2_msm(Vec(obj#145), Vec(obj#147))": "", + " 196 call vec_len(Vec(obj#145))": "cpu:2670", + " 197 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 198 call vec_len(Vec(obj#147))": "cpu:4273115, mem:1008", + " 199 ret vec_len -> Ok(U32(4))": "cpu:4273237", + " 200 ret bls12_381_g2_msm -> Ok(Bytes(obj#149))": "cpu:22098927, mem:231953, objs:-/75@9de64c04", + " 201 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", + " 202 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 203 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 204 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:1213, mem:112, objs:-/76@da22b65", + " 205 call vec_new_from_slice(4)": "", + " 206 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:2426, mem:224, objs:-/77@ab6b94c3", + " 207 call bls12_381_g2_msm(Vec(obj#151), Vec(obj#153))": "", + " 208 call vec_len(Vec(obj#151))": "cpu:2670", + " 209 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 210 call vec_len(Vec(obj#153))": "cpu:4273115, mem:1008", + " 211 ret vec_len -> Ok(U32(4))": "cpu:4273237", + " 212 ret bls12_381_g2_msm -> Ok(Bytes(obj#155))": "cpu:22098927, mem:231953, objs:-/78@47dd0e65", + " 213 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", + " 214 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 215 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 216 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:1213, mem:112, objs:-/79@e4df0ff9", + " 217 call vec_new_from_slice(4)": "", + " 218 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:2426, mem:224, objs:-/80@c73bef", + " 219 call bls12_381_g2_msm(Vec(obj#157), Vec(obj#159))": "", + " 220 call vec_len(Vec(obj#157))": "cpu:2670", + " 221 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 222 call vec_len(Vec(obj#159))": "cpu:4273115, mem:1008", + " 223 ret vec_len -> Ok(U32(4))": "cpu:4273237", + " 224 ret bls12_381_g2_msm -> Ok(Bytes(obj#161))": "cpu:22098927, mem:231953, objs:-/81@bba974f2", + " 225 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", + " 226 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 227 call bytes_new_from_slice(192)": "cpu:661, mem:0", + " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:1670, mem:272, objs:-/82@4bcad85", + " 229 call bytes_new_from_slice(192)": "cpu:2331", + " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:3340, mem:544, objs:-/83@35b74a2a", + " 231 call bytes_new_from_slice(192)": "cpu:4001", + " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:5010, mem:816, objs:-/84@a16487d", + " 233 call bytes_new_from_slice(192)": "cpu:5671", + " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:6680, mem:1088, objs:-/85@9d3ff134", + " 235 call bytes_new_from_slice(192)": "cpu:7341", + " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:8350, mem:1360, objs:-/86@5542feca", + " 237 call vec_new_from_slice(5)": "", + " 238 ret vec_new_from_slice -> Ok(Vec(obj#173))": "cpu:9626, mem:1480, objs:-/87@4fea12ef", + " 239 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 240 ret obj_from_u256_pieces -> Ok(U256(obj#175))": "cpu:10127, mem:1544, objs:-/88@cb7d7391", + " 241 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", + " 242 ret obj_from_u256_pieces -> Ok(U256(obj#177))": "cpu:10628, mem:1608, objs:-/89@d25ee254", + " 243 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", + " 244 ret obj_from_u256_pieces -> Ok(U256(obj#179))": "cpu:11129, mem:1672, objs:-/90@1b5a277b", + " 245 call obj_from_u256_pieces(12052668375261465624, 1115056820630111376, 18258964384967382160, 2376171010711085994)": "", + " 246 ret obj_from_u256_pieces -> Ok(U256(obj#181))": "cpu:11630, mem:1736, objs:-/91@6ff61e82", + " 247 call obj_from_u256_pieces(8424913463146644043, 9405616456888726852, 9448465455624499961, 13755081130528028509)": "", + " 248 ret obj_from_u256_pieces -> Ok(U256(obj#183))": "cpu:12131, mem:1800, objs:-/92@aad43293", + " 249 call vec_new_from_slice(5)": "", + " 250 ret vec_new_from_slice -> Ok(Vec(obj#185))": "cpu:13407, mem:1920, objs:-/93@56092c1", + " 251 call bls12_381_g2_msm(Vec(obj#173), Vec(obj#185))": "", + " 252 call vec_len(Vec(obj#173))": "cpu:13651", + " 253 ret vec_len -> Ok(U32(5))": "cpu:13773", + " 254 call vec_len(Vec(obj#185))": "cpu:5351553, mem:2896", + " 255 ret vec_len -> Ok(U32(5))": "cpu:5351675", + " 256 ret bls12_381_g2_msm -> Ok(Bytes(obj#187))": "cpu:25598700, mem:236644, objs:-/94@b7889154", + " 257 call vec_get(Vec(obj#173), U32(0))": "cpu:25601784, mem:236708, objs:-/95@ba997865", + " 258 ret vec_get -> Ok(Bytes(obj#163))": "cpu:25602010", + " 259 call vec_get(Vec(obj#185), U32(0))": "", + " 260 ret vec_get -> Ok(U256(obj#175))": "cpu:25602236", + " 261 call bls12_381_g2_mul(Bytes(obj#163), U256(obj#175))": "", + " 262 ret bls12_381_g2_mul -> Ok(Bytes(obj#191))": "cpu:34648952, mem:236772, objs:-/96@7c1583a3", + " 263 call bls12_381_g2_add(Bytes(obj#189), Bytes(obj#191))": "", + " 264 ret bls12_381_g2_add -> Ok(Bytes(obj#193))": "cpu:36913034, mem:236836, objs:-/97@7bec3533", + " 265 call vec_get(Vec(obj#173), U32(1))": "", + " 266 ret vec_get -> Ok(Bytes(obj#165))": "cpu:36913260", + " 267 call vec_get(Vec(obj#185), U32(1))": "", + " 268 ret vec_get -> Ok(U256(obj#177))": "cpu:36913486", + " 269 call bls12_381_g2_mul(Bytes(obj#165), U256(obj#177))": "", + " 270 ret bls12_381_g2_mul -> Ok(Bytes(obj#195))": "cpu:45960202, mem:236900, objs:-/98@d7e91106", + " 271 call bls12_381_g2_add(Bytes(obj#193), Bytes(obj#195))": "", + " 272 ret bls12_381_g2_add -> Ok(Bytes(obj#197))": "cpu:48224284, mem:236964, objs:-/99@df3809bb", + " 273 call vec_get(Vec(obj#173), U32(2))": "", + " 274 ret vec_get -> Ok(Bytes(obj#167))": "cpu:48224510", + " 275 call vec_get(Vec(obj#185), U32(2))": "", + " 276 ret vec_get -> Ok(U256(obj#179))": "cpu:48224736", + " 277 call bls12_381_g2_mul(Bytes(obj#167), U256(obj#179))": "", + " 278 ret bls12_381_g2_mul -> Ok(Bytes(obj#199))": "cpu:57271452, mem:237028, objs:-/100@29999b60", + " 279 call bls12_381_g2_add(Bytes(obj#197), Bytes(obj#199))": "", + " 280 ret bls12_381_g2_add -> Ok(Bytes(obj#201))": "cpu:59535534, mem:237092, objs:-/101@9b91bea1", + " 281 call vec_get(Vec(obj#173), U32(3))": "", + " 282 ret vec_get -> Ok(Bytes(obj#169))": "cpu:59535760", + " 283 call vec_get(Vec(obj#185), U32(3))": "", + " 284 ret vec_get -> Ok(U256(obj#181))": "cpu:59535986", + " 285 call bls12_381_g2_mul(Bytes(obj#169), U256(obj#181))": "", + " 286 ret bls12_381_g2_mul -> Ok(Bytes(obj#203))": "cpu:68582702, mem:237156, objs:-/102@184ce1c9", + " 287 call bls12_381_g2_add(Bytes(obj#201), Bytes(obj#203))": "", + " 288 ret bls12_381_g2_add -> Ok(Bytes(obj#205))": "cpu:70846784, mem:237220, objs:-/103@ff3adda7", + " 289 call vec_get(Vec(obj#173), U32(4))": "", + " 290 ret vec_get -> Ok(Bytes(obj#171))": "cpu:70847010", + " 291 call vec_get(Vec(obj#185), U32(4))": "", + " 292 ret vec_get -> Ok(U256(obj#183))": "cpu:70847236", + " 293 call bls12_381_g2_mul(Bytes(obj#171), U256(obj#183))": "", + " 294 ret bls12_381_g2_mul -> Ok(Bytes(obj#207))": "cpu:79893952, mem:237284, objs:-/104@7fe9d90d", + " 295 call bls12_381_g2_add(Bytes(obj#205), Bytes(obj#207))": "", + " 296 ret bls12_381_g2_add -> Ok(Bytes(obj#209))": "cpu:82158034, mem:237348, objs:-/105@f24d423a", + " 297 call obj_cmp(Bytes(obj#209), Bytes(obj#187))": "", + " 298 ret obj_cmp -> Ok(0)": "cpu:82158346", + " 299 end": "cpu:82158346, mem:237348, prngs:-/-, objs:-/105@f24d423a, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g2_mul.json b/soroban-env-host/observations/22/test__bls12_381__g2_mul.json new file mode 100644 index 000000000..f2724517f --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__g2_mul.json @@ -0,0 +1,28 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call obj_from_u256_pieces(0, 0, 0, 0)": "cpu:3084, mem:64, objs:-/1@f4e2a936", + " 2 ret obj_from_u256_pieces -> Ok(U256(obj#3))": "cpu:3585, mem:128, objs:-/2@74092ac8", + " 3 call bls12_381_g2_mul(Bytes(obj#1), U256(obj#3))": "", + " 4 ret bls12_381_g2_mul -> Ok(Bytes(obj#5))": "cpu:9050301, mem:192, objs:-/3@cb12abce", + " 5 call obj_cmp(Bytes(obj#5), Bytes(obj#7))": "cpu:9053385, mem:256, objs:-/4@eac588f7", + " 6 ret obj_cmp -> Ok(0)": "cpu:9053697", + " 7 call bls12_381_g2_mul(Bytes(obj#9), U256(1))": "cpu:9056781, mem:320, objs:-/5@85556c2", + " 8 ret bls12_381_g2_mul -> Ok(Bytes(obj#11))": "cpu:18103375, mem:384, objs:-/6@3abc3097", + " 9 call obj_cmp(Bytes(obj#11), Bytes(obj#9))": "", + " 10 ret obj_cmp -> Ok(0)": "cpu:18103687", + " 11 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "cpu:18106771, mem:448, objs:-/7@70121ca7", + " 12 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:18107272, mem:512, objs:-/8@9a42b345", + " 13 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#17))": "cpu:18107773, mem:576, objs:-/9@91298b99", + " 15 call bls12_381_g2_mul(Bytes(obj#13), U256(obj#15))": "", + " 16 ret bls12_381_g2_mul -> Ok(Bytes(obj#19))": "cpu:27154489, mem:640, objs:-/10@fa30d55a", + " 17 call bls12_381_g2_mul(Bytes(obj#19), U256(obj#17))": "", + " 18 ret bls12_381_g2_mul -> Ok(Bytes(obj#21))": "cpu:36201205, mem:704, objs:-/11@54c70d83", + " 19 call bls12_381_g2_mul(Bytes(obj#13), U256(obj#17))": "", + " 20 ret bls12_381_g2_mul -> Ok(Bytes(obj#23))": "cpu:45247921, mem:768, objs:-/12@52da9e0b", + " 21 call bls12_381_g2_mul(Bytes(obj#23), U256(obj#15))": "", + " 22 ret bls12_381_g2_mul -> Ok(Bytes(obj#25))": "cpu:54294637, mem:832, objs:-/13@4ff2ad90", + " 23 call obj_cmp(Bytes(obj#21), Bytes(obj#25))": "", + " 24 ret obj_cmp -> Ok(0)": "cpu:54294949", + " 25 end": "cpu:54294949, mem:832, prngs:-/-, objs:-/13@4ff2ad90, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json b/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json new file mode 100644 index 000000000..3978f8812 --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json @@ -0,0 +1,58 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(0)": "", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:961, mem:80, objs:-/1@5b7170d7", + " 3 call bytes_new_from_slice(12)": "", + " 4 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:1924, mem:172, objs:-/2@aa596e87", + " 5 call bls12_381_hash_to_g1(Bytes(obj#3), Bytes(obj#1))": "", + " 6 ret bls12_381_hash_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:2168", + " 7 call bytes_new_from_slice(256)": "", + " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:3193, mem:508, objs:-/3@3a5eafff", + " 9 call bytes_new_from_slice(12)": "", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:4156, mem:600, objs:-/4@88a2acc3", + " 11 call bls12_381_hash_to_g1(Bytes(obj#7), Bytes(obj#5))": "", + " 12 ret bls12_381_hash_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:4400", + " 13 call bytes_new_from_slice(50)": "", + " 14 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:5373, mem:730, objs:-/5@28b6d694", + " 15 call bytes_new_from_slice(0)": "", + " 16 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:6334, mem:810, objs:-/6@56ac3668", + " 17 call bls12_381_hash_to_g1(Bytes(obj#11), Bytes(obj#9))": "", + " 18 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#13))": "cpu:3219592, mem:10298, objs:-/7@9efbbcc1", + " 19 call bytes_new_from_slice(96)": "", + " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:3220577, mem:10474, objs:-/8@51896357", + " 21 call obj_cmp(Bytes(obj#13), Bytes(obj#15))": "", + " 22 ret obj_cmp -> Ok(0)": "cpu:3220877", + " 23 call bytes_new_from_slice(3)": "", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:3221838, mem:10557, objs:-/9@5ec59f82", + " 25 call bls12_381_hash_to_g1(Bytes(obj#17), Bytes(obj#9))": "", + " 26 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#19))": "cpu:6435253, mem:20045, objs:-/10@e79bbbfb", + " 27 call bytes_new_from_slice(96)": "", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:6436238, mem:20221, objs:-/11@68e099a7", + " 29 call obj_cmp(Bytes(obj#19), Bytes(obj#21))": "", + " 30 ret obj_cmp -> Ok(0)": "cpu:6436538", + " 31 call bytes_new_from_slice(16)": "", + " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:6437503, mem:20317, objs:-/12@42e4358e", + " 33 call bls12_381_hash_to_g1(Bytes(obj#23), Bytes(obj#9))": "", + " 34 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#25))": "cpu:9651600, mem:29805, objs:-/13@a5112be9", + " 35 call bytes_new_from_slice(96)": "", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:9652585, mem:29981, objs:-/14@c90f15b6", + " 37 call obj_cmp(Bytes(obj#25), Bytes(obj#27))": "", + " 38 ret obj_cmp -> Ok(0)": "cpu:9652885", + " 39 call bytes_new_from_slice(133)": "", + " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:9653878, mem:30194, objs:-/15@78b64378", + " 41 call bls12_381_hash_to_g1(Bytes(obj#29), Bytes(obj#9))": "", + " 42 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#31))": "cpu:12874111, mem:39682, objs:-/16@eb416cc7", + " 43 call bytes_new_from_slice(96)": "", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:12875096, mem:39858, objs:-/17@14001e17", + " 45 call obj_cmp(Bytes(obj#31), Bytes(obj#33))": "", + " 46 ret obj_cmp -> Ok(0)": "cpu:12875396", + " 47 call bytes_new_from_slice(517)": "", + " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:12876485, mem:40455, objs:-/18@3077ed4e", + " 49 call bls12_381_hash_to_g1(Bytes(obj#35), Bytes(obj#9))": "", + " 50 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#37))": "cpu:16116857, mem:49943, objs:-/19@70daa102", + " 51 call bytes_new_from_slice(96)": "", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:16117842, mem:50119, objs:-/20@19d2fca4", + " 53 call obj_cmp(Bytes(obj#37), Bytes(obj#39))": "", + " 54 ret obj_cmp -> Ok(0)": "cpu:16118142", + " 55 end": "cpu:16118142, mem:50119, prngs:-/-, objs:-/20@19d2fca4, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json b/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json new file mode 100644 index 000000000..32e82745f --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json @@ -0,0 +1,58 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(0)": "", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:961, mem:80, objs:-/1@5b7170d7", + " 3 call bytes_new_from_slice(12)": "", + " 4 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:1924, mem:172, objs:-/2@aa596e87", + " 5 call bls12_381_hash_to_g2(Bytes(obj#3), Bytes(obj#1))": "", + " 6 ret bls12_381_hash_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:2168", + " 7 call bytes_new_from_slice(256)": "", + " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:3193, mem:508, objs:-/3@3a5eafff", + " 9 call bytes_new_from_slice(12)": "", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:4156, mem:600, objs:-/4@88a2acc3", + " 11 call bls12_381_hash_to_g2(Bytes(obj#7), Bytes(obj#5))": "", + " 12 ret bls12_381_hash_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:4400", + " 13 call bytes_new_from_slice(50)": "", + " 14 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:5373, mem:730, objs:-/5@3f4657f8", + " 15 call bytes_new_from_slice(0)": "", + " 16 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:6334, mem:810, objs:-/6@2e40259c", + " 17 call bls12_381_hash_to_g2(Bytes(obj#11), Bytes(obj#9))": "", + " 18 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#13))": "cpu:7060287, mem:7690, objs:-/7@2d317ca4", + " 19 call bytes_new_from_slice(192)": "", + " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:7061296, mem:7962, objs:-/8@f21b2fa0", + " 21 call obj_cmp(Bytes(obj#13), Bytes(obj#15))": "", + " 22 ret obj_cmp -> Ok(0)": "cpu:7061608", + " 23 call bytes_new_from_slice(3)": "", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:7062569, mem:8045, objs:-/9@aba7a202", + " 25 call bls12_381_hash_to_g2(Bytes(obj#17), Bytes(obj#9))": "", + " 26 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#19))": "cpu:14116681, mem:14925, objs:-/10@ba39dec3", + " 27 call bytes_new_from_slice(192)": "", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:14117690, mem:15197, objs:-/11@dd6c306d", + " 29 call obj_cmp(Bytes(obj#19), Bytes(obj#21))": "", + " 30 ret obj_cmp -> Ok(0)": "cpu:14118002", + " 31 call bytes_new_from_slice(16)": "", + " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:14118967, mem:15293, objs:-/12@aab36c6f", + " 33 call bls12_381_hash_to_g2(Bytes(obj#23), Bytes(obj#9))": "", + " 34 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#25))": "cpu:21173769, mem:22173, objs:-/13@860c1403", + " 35 call bytes_new_from_slice(192)": "", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:21174778, mem:22445, objs:-/14@ca75fa0f", + " 37 call obj_cmp(Bytes(obj#25), Bytes(obj#27))": "", + " 38 ret obj_cmp -> Ok(0)": "cpu:21175090", + " 39 call bytes_new_from_slice(133)": "", + " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:21176083, mem:22658, objs:-/15@55b1f41", + " 41 call bls12_381_hash_to_g2(Bytes(obj#29), Bytes(obj#9))": "", + " 42 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#31))": "cpu:28237098, mem:29538, objs:-/16@67cc16f5", + " 43 call bytes_new_from_slice(192)": "", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:28238107, mem:29810, objs:-/17@91beebd2", + " 45 call obj_cmp(Bytes(obj#31), Bytes(obj#33))": "", + " 46 ret obj_cmp -> Ok(0)": "cpu:28238419", + " 47 call bytes_new_from_slice(517)": "", + " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:28239508, mem:30407, objs:-/18@77fa1166", + " 49 call bls12_381_hash_to_g2(Bytes(obj#35), Bytes(obj#9))": "", + " 50 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#37))": "cpu:35320914, mem:37287, objs:-/19@42a8b15f", + " 51 call bytes_new_from_slice(192)": "", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:35321923, mem:37559, objs:-/20@dd93bdf4", + " 53 call obj_cmp(Bytes(obj#37), Bytes(obj#39))": "", + " 54 ret obj_cmp -> Ok(0)": "cpu:35322235", + " 55 end": "cpu:35322235, mem:37559, prngs:-/-, objs:-/20@dd93bdf4, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json b/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json new file mode 100644 index 000000000..eda3ef8b1 --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json @@ -0,0 +1,92 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(95)": "cpu:661", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1644, mem:175, objs:-/1@14742518", + " 3 call bls12_381_map_fp2_to_g2(Bytes(obj#1))": "", + " 4 ret bls12_381_map_fp2_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:1766", + " 5 call bytes_new_from_slice(97)": "cpu:2427", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:3412, mem:352, objs:-/2@5b14765e", + " 7 call bls12_381_map_fp2_to_g2(Bytes(obj#3))": "", + " 8 ret bls12_381_map_fp2_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:3534", + " 9 call bytes_new_from_slice(192)": "cpu:0, mem:0", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:1009, mem:272, objs:-/3@89f3534e", + " 11 call bytes_new_from_slice(96)": "", + " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:1994, mem:448, objs:-/4@54d07739", + " 13 call bls12_381_map_fp2_to_g2(Bytes(obj#7))": "", + " 14 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#9))": "cpu:2427433, mem:3856, objs:-/5@ec80b213", + " 15 call obj_cmp(Bytes(obj#9), Bytes(obj#5))": "", + " 16 ret obj_cmp -> Ok(0)": "cpu:2427745", + " 17 call bytes_new_from_slice(192)": "", + " 18 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:2428754, mem:4128, objs:-/6@9fa0943f", + " 19 call bytes_new_from_slice(96)": "", + " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#13))": "cpu:2429739, mem:4304, objs:-/7@5122c783", + " 21 call bls12_381_map_fp2_to_g2(Bytes(obj#13))": "", + " 22 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#15))": "cpu:4855178, mem:7712, objs:-/8@be4fb7d8", + " 23 call obj_cmp(Bytes(obj#15), Bytes(obj#11))": "", + " 24 ret obj_cmp -> Ok(0)": "cpu:4855490", + " 25 call bytes_new_from_slice(192)": "", + " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:4856499, mem:7984, objs:-/9@da7a8792", + " 27 call bytes_new_from_slice(96)": "", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:4857484, mem:8160, objs:-/10@fa8ee1be", + " 29 call bls12_381_map_fp2_to_g2(Bytes(obj#19))": "", + " 30 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#21))": "cpu:7282923, mem:11568, objs:-/11@3b3afaa5", + " 31 call obj_cmp(Bytes(obj#21), Bytes(obj#17))": "", + " 32 ret obj_cmp -> Ok(0)": "cpu:7283235", + " 33 call bytes_new_from_slice(192)": "", + " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:7284244, mem:11840, objs:-/12@7f160662", + " 35 call bytes_new_from_slice(96)": "", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#25))": "cpu:7285229, mem:12016, objs:-/13@7f21fbc6", + " 37 call bls12_381_map_fp2_to_g2(Bytes(obj#25))": "", + " 38 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#27))": "cpu:9710668, mem:15424, objs:-/14@6569b3bc", + " 39 call obj_cmp(Bytes(obj#27), Bytes(obj#23))": "", + " 40 ret obj_cmp -> Ok(0)": "cpu:9710980", + " 41 call bytes_new_from_slice(192)": "", + " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:9711989, mem:15696, objs:-/15@596a85b2", + " 43 call bytes_new_from_slice(96)": "", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:9712974, mem:15872, objs:-/16@c30eeff6", + " 45 call bls12_381_map_fp2_to_g2(Bytes(obj#31))": "", + " 46 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#33))": "cpu:12138413, mem:19280, objs:-/17@e0aee5d9", + " 47 call obj_cmp(Bytes(obj#33), Bytes(obj#29))": "", + " 48 ret obj_cmp -> Ok(0)": "cpu:12138725", + " 49 call bytes_new_from_slice(192)": "", + " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:12139734, mem:19552, objs:-/18@fd20ec9e", + " 51 call bytes_new_from_slice(96)": "", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:12140719, mem:19728, objs:-/19@e1f85ad", + " 53 call bls12_381_map_fp2_to_g2(Bytes(obj#37))": "", + " 54 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#39))": "cpu:14566158, mem:23136, objs:-/20@defdfad7", + " 55 call obj_cmp(Bytes(obj#39), Bytes(obj#35))": "", + " 56 ret obj_cmp -> Ok(0)": "cpu:14566470", + " 57 call bytes_new_from_slice(192)": "", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:14567479, mem:23408, objs:-/21@faf6362d", + " 59 call bytes_new_from_slice(96)": "", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#43))": "cpu:14568464, mem:23584, objs:-/22@d9e0eeeb", + " 61 call bls12_381_map_fp2_to_g2(Bytes(obj#43))": "", + " 62 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#45))": "cpu:16993903, mem:26992, objs:-/23@bdfa6563", + " 63 call obj_cmp(Bytes(obj#45), Bytes(obj#41))": "", + " 64 ret obj_cmp -> Ok(0)": "cpu:16994215", + " 65 call bytes_new_from_slice(192)": "", + " 66 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:16995224, mem:27264, objs:-/24@1a02f553", + " 67 call bytes_new_from_slice(96)": "", + " 68 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:16996209, mem:27440, objs:-/25@4af763de", + " 69 call bls12_381_map_fp2_to_g2(Bytes(obj#49))": "", + " 70 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#51))": "cpu:19421648, mem:30848, objs:-/26@527595c9", + " 71 call obj_cmp(Bytes(obj#51), Bytes(obj#47))": "", + " 72 ret obj_cmp -> Ok(0)": "cpu:19421960", + " 73 call bytes_new_from_slice(192)": "", + " 74 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:19422969, mem:31120, objs:-/27@181c5857", + " 75 call bytes_new_from_slice(96)": "", + " 76 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:19423954, mem:31296, objs:-/28@36ffb03b", + " 77 call bls12_381_map_fp2_to_g2(Bytes(obj#55))": "", + " 78 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#57))": "cpu:21849393, mem:34704, objs:-/29@b1f19f69", + " 79 call obj_cmp(Bytes(obj#57), Bytes(obj#53))": "", + " 80 ret obj_cmp -> Ok(0)": "cpu:21849705", + " 81 call bytes_new_from_slice(192)": "", + " 82 ret bytes_new_from_slice -> Ok(Bytes(obj#59))": "cpu:21850714, mem:34976, objs:-/30@87a81974", + " 83 call bytes_new_from_slice(96)": "", + " 84 ret bytes_new_from_slice -> Ok(Bytes(obj#61))": "cpu:21851699, mem:35152, objs:-/31@9ed5a36b", + " 85 call bls12_381_map_fp2_to_g2(Bytes(obj#61))": "", + " 86 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#63))": "cpu:24277138, mem:38560, objs:-/32@ef4e1b26", + " 87 call obj_cmp(Bytes(obj#63), Bytes(obj#59))": "", + " 88 ret obj_cmp -> Ok(0)": "cpu:24277450", + " 89 end": "cpu:24277450, mem:38560, prngs:-/-, objs:-/32@ef4e1b26, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json b/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json new file mode 100644 index 000000000..76175a3b3 --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json @@ -0,0 +1,92 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(47)": "cpu:661", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1632, mem:127, objs:-/1@705fbc72", + " 3 call bls12_381_map_fp_to_g1(Bytes(obj#1))": "", + " 4 ret bls12_381_map_fp_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:1754", + " 5 call bytes_new_from_slice(49)": "cpu:2415", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:3388, mem:256, objs:-/2@c4f554b9", + " 7 call bls12_381_map_fp_to_g1(Bytes(obj#3))": "", + " 8 ret bls12_381_map_fp_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:3510", + " 9 call bytes_new_from_slice(96)": "cpu:0, mem:0", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:985, mem:176, objs:-/3@10860de1", + " 11 call bytes_new_from_slice(48)": "", + " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:1958, mem:304, objs:-/4@bcfde511", + " 13 call bls12_381_map_fp_to_g1(Bytes(obj#7))": "", + " 14 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#9))": "cpu:1546490, mem:5920, objs:-/5@f8828dbe", + " 15 call obj_cmp(Bytes(obj#9), Bytes(obj#5))": "", + " 16 ret obj_cmp -> Ok(0)": "cpu:1546790", + " 17 call bytes_new_from_slice(96)": "", + " 18 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:1547775, mem:6096, objs:-/6@672b1778", + " 19 call bytes_new_from_slice(48)": "", + " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#13))": "cpu:1548748, mem:6224, objs:-/7@286e4eb2", + " 21 call bls12_381_map_fp_to_g1(Bytes(obj#13))": "", + " 22 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#15))": "cpu:3093280, mem:11840, objs:-/8@b788e44f", + " 23 call obj_cmp(Bytes(obj#15), Bytes(obj#11))": "", + " 24 ret obj_cmp -> Ok(0)": "cpu:3093580", + " 25 call bytes_new_from_slice(96)": "", + " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:3094565, mem:12016, objs:-/9@2a9d7275", + " 27 call bytes_new_from_slice(48)": "", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:3095538, mem:12144, objs:-/10@92eba3a1", + " 29 call bls12_381_map_fp_to_g1(Bytes(obj#19))": "", + " 30 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#21))": "cpu:4640070, mem:17760, objs:-/11@5da95038", + " 31 call obj_cmp(Bytes(obj#21), Bytes(obj#17))": "", + " 32 ret obj_cmp -> Ok(0)": "cpu:4640370", + " 33 call bytes_new_from_slice(96)": "", + " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:4641355, mem:17936, objs:-/12@e6c8b351", + " 35 call bytes_new_from_slice(48)": "", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#25))": "cpu:4642328, mem:18064, objs:-/13@f9d8a538", + " 37 call bls12_381_map_fp_to_g1(Bytes(obj#25))": "", + " 38 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#27))": "cpu:6186860, mem:23680, objs:-/14@921ad21e", + " 39 call obj_cmp(Bytes(obj#27), Bytes(obj#23))": "", + " 40 ret obj_cmp -> Ok(0)": "cpu:6187160", + " 41 call bytes_new_from_slice(96)": "", + " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:6188145, mem:23856, objs:-/15@6f682fe5", + " 43 call bytes_new_from_slice(48)": "", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:6189118, mem:23984, objs:-/16@11b77db3", + " 45 call bls12_381_map_fp_to_g1(Bytes(obj#31))": "", + " 46 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#33))": "cpu:7733650, mem:29600, objs:-/17@79a67632", + " 47 call obj_cmp(Bytes(obj#33), Bytes(obj#29))": "", + " 48 ret obj_cmp -> Ok(0)": "cpu:7733950", + " 49 call bytes_new_from_slice(96)": "", + " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:7734935, mem:29776, objs:-/18@a31ae8b9", + " 51 call bytes_new_from_slice(48)": "", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:7735908, mem:29904, objs:-/19@290ffd84", + " 53 call bls12_381_map_fp_to_g1(Bytes(obj#37))": "", + " 54 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#39))": "cpu:9280440, mem:35520, objs:-/20@6d31c3af", + " 55 call obj_cmp(Bytes(obj#39), Bytes(obj#35))": "", + " 56 ret obj_cmp -> Ok(0)": "cpu:9280740", + " 57 call bytes_new_from_slice(96)": "", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:9281725, mem:35696, objs:-/21@7dff8238", + " 59 call bytes_new_from_slice(48)": "", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#43))": "cpu:9282698, mem:35824, objs:-/22@2dc8aba", + " 61 call bls12_381_map_fp_to_g1(Bytes(obj#43))": "", + " 62 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#45))": "cpu:10827230, mem:41440, objs:-/23@48b5c974", + " 63 call obj_cmp(Bytes(obj#45), Bytes(obj#41))": "", + " 64 ret obj_cmp -> Ok(0)": "cpu:10827530", + " 65 call bytes_new_from_slice(96)": "", + " 66 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:10828515, mem:41616, objs:-/24@aae68782", + " 67 call bytes_new_from_slice(48)": "", + " 68 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:10829488, mem:41744, objs:-/25@9a75571a", + " 69 call bls12_381_map_fp_to_g1(Bytes(obj#49))": "", + " 70 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#51))": "cpu:12374020, mem:47360, objs:-/26@83f69cb3", + " 71 call obj_cmp(Bytes(obj#51), Bytes(obj#47))": "", + " 72 ret obj_cmp -> Ok(0)": "cpu:12374320", + " 73 call bytes_new_from_slice(96)": "", + " 74 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:12375305, mem:47536, objs:-/27@c18e8bb1", + " 75 call bytes_new_from_slice(48)": "", + " 76 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:12376278, mem:47664, objs:-/28@87c5c114", + " 77 call bls12_381_map_fp_to_g1(Bytes(obj#55))": "", + " 78 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#57))": "cpu:13920810, mem:53280, objs:-/29@ac1c35d3", + " 79 call obj_cmp(Bytes(obj#57), Bytes(obj#53))": "", + " 80 ret obj_cmp -> Ok(0)": "cpu:13921110", + " 81 call bytes_new_from_slice(96)": "", + " 82 ret bytes_new_from_slice -> Ok(Bytes(obj#59))": "cpu:13922095, mem:53456, objs:-/30@1c05a47c", + " 83 call bytes_new_from_slice(48)": "", + " 84 ret bytes_new_from_slice -> Ok(Bytes(obj#61))": "cpu:13923068, mem:53584, objs:-/31@b24d975f", + " 85 call bls12_381_map_fp_to_g1(Bytes(obj#61))": "", + " 86 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#63))": "cpu:15467600, mem:59200, objs:-/32@ba0e4c53", + " 87 call obj_cmp(Bytes(obj#63), Bytes(obj#59))": "", + " 88 ret obj_cmp -> Ok(0)": "cpu:15467900", + " 89 end": "cpu:15467900, mem:59200, prngs:-/-, objs:-/32@ba0e4c53, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__pairing.json b/soroban-env-host/observations/22/test__bls12_381__pairing.json new file mode 100644 index 000000000..842b4e79e --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__pairing.json @@ -0,0 +1,122 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(96)": "cpu:661", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1646, mem:176, objs:-/1@2142c5f5", + " 3 call bytes_new_from_slice(96)": "cpu:2307", + " 4 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:3292, mem:352, objs:-/2@a5d3f802", + " 5 call bytes_new_from_slice(96)": "cpu:3953", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:4938, mem:528, objs:-/3@d1e19abc", + " 7 call vec_new_from_slice(3)": "", + " 8 ret vec_new_from_slice -> Ok(Vec(obj#7))": "cpu:6088, mem:632, objs:-/4@8244fa30", + " 9 call bytes_new_from_slice(192)": "cpu:6749", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:7758, mem:904, objs:-/5@c02aba07", + " 11 call bytes_new_from_slice(192)": "cpu:8419", + " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:9428, mem:1176, objs:-/6@487ed264", + " 13 call vec_new_from_slice(2)": "", + " 14 ret vec_new_from_slice -> Ok(Vec(obj#13))": "cpu:10515, mem:1272, objs:-/7@bb54cc01", + " 15 call bls12_381_multi_pairing_check(Vec(obj#7), Vec(obj#13))": "", + " 16 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:10759", + " 17 call vec_new_from_slice(0)": "", + " 18 ret vec_new_from_slice -> Ok(Vec(obj#15))": "cpu:11720, mem:1352, objs:-/8@82674552", + " 19 call vec_new_from_slice(0)": "", + " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:12681, mem:1432, objs:-/9@1345611a", + " 21 call bls12_381_multi_pairing_check(Vec(obj#15), Vec(obj#17))": "", + " 22 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:12925", + " 23 call bytes_new_from_slice(96)": "cpu:13586", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:14571, mem:1608, objs:-/10@7a106154", + " 25 call bytes_new_from_slice(96)": "cpu:15232", + " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:16217, mem:1784, objs:-/11@ec2e3333", + " 27 call bytes_new_from_slice(96)": "cpu:16878", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:17863, mem:1960, objs:-/12@7fed0b7e", + " 29 call vec_new_from_slice(3)": "", + " 30 ret vec_new_from_slice -> Ok(Vec(obj#25))": "cpu:19013, mem:2064, objs:-/13@6dc728c2", + " 31 call vec_put(Vec(obj#25), U32(1), Bytes(obj#27))": "cpu:20775, mem:2128, objs:-/14@8be8f7f7", + " 32 ret vec_put -> Ok(Vec(obj#29))": "cpu:22029, mem:2232, objs:-/15@a6d874ef", + " 33 call bytes_new_from_slice(192)": "cpu:22690", + " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:23699, mem:2504, objs:-/16@fe14a4a8", + " 35 call bytes_new_from_slice(192)": "cpu:24360", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:25369, mem:2776, objs:-/17@c4d75455", + " 37 call vec_new_from_slice(2)": "", + " 38 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:26456, mem:2872, objs:-/18@aaad64d", + " 39 call bls12_381_multi_pairing_check(Vec(obj#29), Vec(obj#35))": "", + " 40 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:26700", + " 41 call bytes_new_from_slice(96)": "cpu:27361", + " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:28346, mem:3048, objs:-/19@ab89a61f", + " 43 call bytes_new_from_slice(96)": "cpu:29007", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:29992, mem:3224, objs:-/20@d542535f", + " 45 call bytes_new_from_slice(96)": "cpu:30653", + " 46 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:31638, mem:3400, objs:-/21@ded92be8", + " 47 call vec_new_from_slice(3)": "", + " 48 ret vec_new_from_slice -> Ok(Vec(obj#43))": "cpu:32788, mem:3504, objs:-/22@c6483fc1", + " 49 call bytes_new_from_slice(192)": "cpu:33449", + " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#45))": "cpu:34458, mem:3776, objs:-/23@76b0e9c1", + " 51 call bytes_new_from_slice(192)": "cpu:35119", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:36128, mem:4048, objs:-/24@346c7b4", + " 53 call bytes_new_from_slice(192)": "cpu:36789", + " 54 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:37798, mem:4320, objs:-/25@dd11c915", + " 55 call vec_new_from_slice(3)": "", + " 56 ret vec_new_from_slice -> Ok(Vec(obj#51))": "cpu:38948, mem:4424, objs:-/26@d697e073", + " 57 call vec_put(Vec(obj#51), U32(1), Bytes(obj#53))": "cpu:42032, mem:4488, objs:-/27@20144015", + " 58 ret vec_put -> Ok(Vec(obj#55))": "cpu:43286, mem:4592, objs:-/28@4b569925", + " 59 call bls12_381_multi_pairing_check(Vec(obj#43), Vec(obj#55))": "", + " 60 call vec_len(Vec(obj#43))": "cpu:43530", + " 61 ret vec_len -> Ok(U32(3))": "cpu:43652", + " 62 call vec_len(Vec(obj#55))": "cpu:2247179, mem:4896", + " 63 ret vec_len -> Ok(U32(3))": "cpu:2247301", + " 64 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:4382734, mem:5488", + " 65 call bls12_381_g2_add(Bytes(obj#61), Bytes(obj#63))": "cpu:744024, mem:256, objs:-/32@a1920e67", + " 66 ret bls12_381_g2_add -> Ok(Bytes(obj#65))": "cpu:3008106, mem:320, objs:-/33@58cb448c", + " 67 call vec_new_from_slice(3)": "", + " 68 ret vec_new_from_slice -> Ok(Vec(obj#67))": "cpu:3009256, mem:424, objs:-/34@ace96f6f", + " 69 call vec_new_from_slice(3)": "", + " 70 ret vec_new_from_slice -> Ok(Vec(obj#69))": "cpu:3010406, mem:528, objs:-/35@dd920813", + " 71 call bls12_381_multi_pairing_check(Vec(obj#67), Vec(obj#69))": "", + " 72 call vec_len(Vec(obj#67))": "cpu:3010650", + " 73 ret vec_len -> Ok(U32(3))": "cpu:3010772", + " 74 call vec_len(Vec(obj#69))": "cpu:5214299, mem:832", + " 75 ret vec_len -> Ok(U32(3))": "cpu:5214421", + " 76 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:33809029, mem:222545", + " 77 call bls12_381_g1_add(Bytes(obj#71), Bytes(obj#73))": "cpu:1077125, mem:256, objs:-/39@bec06383", + " 78 ret bls12_381_g1_add -> Ok(Bytes(obj#79))": "cpu:2648065, mem:320, objs:-/40@fbe4add2", + " 79 call vec_new_from_slice(3)": "", + " 80 ret vec_new_from_slice -> Ok(Vec(obj#81))": "cpu:2649215, mem:424, objs:-/41@645f0020", + " 81 call vec_new_from_slice(3)": "", + " 82 ret vec_new_from_slice -> Ok(Vec(obj#83))": "cpu:2650365, mem:528, objs:-/42@98f94a6c", + " 83 call bls12_381_multi_pairing_check(Vec(obj#81), Vec(obj#83))": "", + " 84 call vec_len(Vec(obj#81))": "cpu:2650609", + " 85 ret vec_len -> Ok(U32(3))": "cpu:2650731", + " 86 call vec_len(Vec(obj#83))": "cpu:4854258, mem:832", + " 87 ret vec_len -> Ok(U32(3))": "cpu:4854380", + " 88 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:33448988, mem:222545", + " 89 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "cpu:0, mem:0", + " 90 ret obj_from_u256_pieces -> Ok(U256(obj#85))": "cpu:501, mem:64, objs:-/43@c26a5cf9", + " 91 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", + " 92 ret obj_from_u256_pieces -> Ok(U256(obj#87))": "cpu:1002, mem:128, objs:-/44@f0931059", + " 93 call bls12_381_g1_mul(Bytes(obj#89), U256(obj#85))": "cpu:1812459, mem:384, objs:-/48@44a7f896", + " 94 ret bls12_381_g1_mul -> Ok(Bytes(obj#97))": "cpu:5102418, mem:448, objs:-/49@ad83c5a", + " 95 call bls12_381_g1_mul(Bytes(obj#89), U256(obj#87))": "", + " 96 ret bls12_381_g1_mul -> Ok(Bytes(obj#99))": "cpu:8392377, mem:512, objs:-/50@d3c89f20", + " 97 call bls12_381_g2_mul(Bytes(obj#93), U256(obj#85))": "", + " 98 ret bls12_381_g2_mul -> Ok(Bytes(obj#101))": "cpu:17439093, mem:576, objs:-/51@c0c63180", + " 99 call bls12_381_g2_mul(Bytes(obj#93), U256(obj#87))": "", + " 100 ret bls12_381_g2_mul -> Ok(Bytes(obj#103))": "cpu:26485809, mem:640, objs:-/52@9c3953d8", + " 101 call bls12_381_fr_mul(U256(obj#85), U256(obj#87))": "", + " 102 call obj_from_u256_pieces(4750815174022751756, 7309822028475974751, 2180935167318637354, 9686866465341438454)": "cpu:26491528, mem:888", + " 103 ret obj_from_u256_pieces -> Ok(U256(obj#105))": "cpu:26492029, mem:952, objs:-/53@ebd41d27", + " 104 ret bls12_381_fr_mul -> Ok(U256(obj#105))": "cpu:26492090", + " 105 call bls12_381_g1_mul(Bytes(obj#89), U256(obj#105))": "", + " 106 ret bls12_381_g1_mul -> Ok(Bytes(obj#107))": "cpu:29782049, mem:1016, objs:-/54@4a395f43", + " 107 call bls12_381_g2_mul(Bytes(obj#93), U256(obj#105))": "", + " 108 ret bls12_381_g2_mul -> Ok(Bytes(obj#109))": "cpu:38828765, mem:1080, objs:-/55@5c05cb46", + " 109 call vec_new_from_slice(4)": "", + " 110 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:38829978, mem:1192, objs:-/56@4f9fb2c5", + " 111 call vec_new_from_slice(4)": "", + " 112 ret vec_new_from_slice -> Ok(Vec(obj#113))": "cpu:38831191, mem:1304, objs:-/57@3ebb42e5", + " 113 call bls12_381_multi_pairing_check(Vec(obj#111), Vec(obj#113))": "", + " 114 call vec_len(Vec(obj#111))": "cpu:38831435", + " 115 ret vec_len -> Ok(U32(4))": "cpu:38831557", + " 116 call vec_len(Vec(obj#113))": "cpu:41769428, mem:1704", + " 117 ret vec_len -> Ok(U32(4))": "cpu:41769550", + " 118 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:76375841, mem:296581", + " 119 end": "cpu:76375841, mem:296581, prngs:-/-, objs:-/57@3ebb42e5, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__dispatch_with_wrong_arg_type_bls12_381_fr_pow.json b/soroban-env-host/observations/22/test__dispatch__dispatch_with_wrong_arg_type_bls12_381_fr_pow.json new file mode 100644 index 000000000..614d940ca --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__dispatch_with_wrong_arg_type_bls12_381_fr_pow.json @@ -0,0 +1,189 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@fb095c3d", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@d27f7217, store:-/1@f1e76490, foot:1@3fd2141b", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@c2e63cd", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@bd748587", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@bdfea37c, auth:1@c37da55/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@c37da55/1@5af4a012", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@23e9d1f2", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@5edc50dd, foot:2@a2add42c", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@5d17ae18", + " 14 push VM:a5b4867e:sym#13()": "cpu:587479, mem:734545, objs:-/8@89d46040, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ba99734c, auth:2@7e0661c/1@6bf36f94", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:a5b4867e:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@3f71cfad, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:591938, mem:734720, objs:-/10@f11ccb19", + " 22 push VM:a5b4867e:test(U256(123), Address(obj#123))": "cpu:756728, mem:897027, objs:-/11@2ded98ed, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a3dc7aff, auth:1@b1b428e/-", + " 23 call bls12_381_fr_pow(U256(123), bad:77)": "cpu:759841, mem:897114, objs:1@f40b9f61/11@2ded98ed, vm:-/-, stk:1@88e190e1", + " 24 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:760163, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:760785, mem:897130, objs:-/11@2ded98ed, vm:-/-, stk:-, auth:-/-", + " 26 call call(Address(obj#17), Symbol(test), Vec(obj#23))": "cpu:761225, mem:897194, objs:-/12@65ae004e", + " 27 push VM:a5b4867e:test(U256(123), False)": "cpu:926015, mem:1059501, objs:-/13@c880178f, vm:65536@b1cd98b9/2@2f94d90d, stk:1@9d1b0663, auth:1@73b1caf7/-", + " 28 call bls12_381_fr_pow(U256(123), bad:0)": "cpu:928693, mem:1059564, vm:-/-", + " 29 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:929015, vm:65536@b1cd98b9/2@2f94d90d", + " 30 ret call -> Err(Error(Value, InvalidInput))": "cpu:929637, mem:1059580, vm:-/-, stk:-, auth:-/-", + " 31 call call(Address(obj#17), Symbol(test), Vec(obj#27))": "cpu:930077, mem:1059644, objs:-/14@1ba45e4", + " 32 push VM:a5b4867e:test(U256(123), Bytes(obj#123))": "cpu:1094867, mem:1221951, objs:-/15@92ef810e, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4484f6f1, auth:1@3c3a4a50/-", + " 33 call bls12_381_fr_pow(U256(123), bad:72)": "cpu:1097980, mem:1222038, objs:1@1c4ba01b/15@92ef810e, vm:-/-, stk:1@121010ac", + " 34 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1098302, vm:65536@b1cd98b9/2@2f94d90d", + " 35 ret call -> Err(Error(Value, InvalidInput))": "cpu:1098924, mem:1222054, objs:-/15@92ef810e, vm:-/-, stk:-, auth:-/-", + " 36 call call(Address(obj#17), Symbol(test), Vec(obj#31))": "cpu:1099364, mem:1222118, objs:-/16@741b4666", + " 37 push VM:a5b4867e:test(U256(123), Duration(obj#123))": "cpu:1264154, mem:1384425, objs:-/17@8adf10e4, vm:65536@b1cd98b9/2@2f94d90d, stk:1@f4519e3a, auth:1@f34bc5d3/-", + " 38 call bls12_381_fr_pow(U256(123), bad:67)": "cpu:1267267, mem:1384512, objs:1@a2f54a81/17@8adf10e4, vm:-/-, stk:1@73ff384b", + " 39 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1267589, vm:65536@b1cd98b9/2@2f94d90d", + " 40 ret call -> Err(Error(Value, InvalidInput))": "cpu:1268211, mem:1384528, objs:-/17@8adf10e4, vm:-/-, stk:-, auth:-/-", + " 41 call call(Address(obj#17), Symbol(test), Vec(obj#35))": "cpu:1268651, mem:1384592, objs:-/18@deaac440", + " 42 push VM:a5b4867e:test(U256(123), Duration(123))": "cpu:1433441, mem:1546899, objs:-/19@7145bda7, vm:65536@b1cd98b9/2@2f94d90d, stk:1@cd5d9a20, auth:1@a916afbc/-", + " 43 call bls12_381_fr_pow(U256(123), bad:31497)": "cpu:1436119, mem:1546962, vm:-/-", + " 44 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1436441, vm:65536@b1cd98b9/2@2f94d90d", + " 45 ret call -> Err(Error(Value, InvalidInput))": "cpu:1437063, mem:1546978, vm:-/-, stk:-, auth:-/-", + " 46 call call(Address(obj#17), Symbol(test), Vec(obj#39))": "cpu:1437503, mem:1547042, objs:-/20@7ad3d0c6", + " 47 push VM:a5b4867e:test(U256(123), Duration(123))": "cpu:1602293, mem:1709349, objs:-/21@ebf976ab, vm:65536@b1cd98b9/2@2f94d90d, stk:1@cd5d9a20, auth:1@5fa62d7a/-", + " 48 call bls12_381_fr_pow(U256(123), bad:31497)": "cpu:1604971, mem:1709412, vm:-/-", + " 49 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1605293, vm:65536@b1cd98b9/2@2f94d90d", + " 50 ret call -> Err(Error(Value, InvalidInput))": "cpu:1605915, mem:1709428, vm:-/-, stk:-, auth:-/-", + " 51 call call(Address(obj#17), Symbol(test), Vec(obj#43))": "cpu:1606355, mem:1709492, objs:-/22@91ed713a", + " 52 push VM:a5b4867e:test(U256(123), Error(Context, ExceededLimit))": "cpu:1771145, mem:1871799, objs:-/23@cfdd9f21, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4a07b0a0, auth:1@50cfe0e0/-", + " 53 call bls12_381_fr_pow(U256(123), bad:21474836995)": "cpu:1773823, mem:1871862, vm:-/-", + " 54 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1774145, vm:65536@b1cd98b9/2@2f94d90d", + " 55 ret call -> Err(Error(Value, InvalidInput))": "cpu:1774767, mem:1871878, vm:-/-, stk:-, auth:-/-", + " 56 call call(Address(obj#17), Symbol(test), Vec(obj#47))": "cpu:1775207, mem:1871942, objs:-/24@f396aa15", + " 57 push VM:a5b4867e:test(U256(123), I128(obj#123))": "cpu:1939997, mem:2034249, objs:-/25@14c5c303, vm:65536@b1cd98b9/2@2f94d90d, stk:1@26169962, auth:1@30dfa4bc/-", + " 58 call bls12_381_fr_pow(U256(123), bad:69)": "cpu:1943110, mem:2034336, objs:1@5bb429fc/25@14c5c303, vm:-/-, stk:1@51626d3d", + " 59 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1943432, vm:65536@b1cd98b9/2@2f94d90d", + " 60 ret call -> Err(Error(Value, InvalidInput))": "cpu:1944054, mem:2034352, objs:-/25@14c5c303, vm:-/-, stk:-, auth:-/-", + " 61 call call(Address(obj#17), Symbol(test), Vec(obj#51))": "cpu:1944494, mem:2034416, objs:-/26@8714080f", + " 62 push VM:a5b4867e:test(U256(123), I128(-123))": "cpu:2109284, mem:2196723, objs:-/27@ac556388, vm:65536@b1cd98b9/2@2f94d90d, stk:1@776b95f8, auth:1@a73502b2/-", + " 63 call bls12_381_fr_pow(U256(123), bad:-31477)": "cpu:2111962, mem:2196786, vm:-/-", + " 64 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2112284, vm:65536@b1cd98b9/2@2f94d90d", + " 65 ret call -> Err(Error(Value, InvalidInput))": "cpu:2112906, mem:2196802, vm:-/-, stk:-, auth:-/-", + " 66 call call(Address(obj#17), Symbol(test), Vec(obj#55))": "cpu:2113346, mem:2196866, objs:-/28@f1af3638", + " 67 push VM:a5b4867e:test(U256(123), I128(-123))": "cpu:2278136, mem:2359173, objs:-/29@bcc2ea6e, vm:65536@b1cd98b9/2@2f94d90d, stk:1@776b95f8, auth:1@bff751bb/-", + " 68 call bls12_381_fr_pow(U256(123), bad:-31477)": "cpu:2280814, mem:2359236, vm:-/-", + " 69 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2281136, vm:65536@b1cd98b9/2@2f94d90d", + " 70 ret call -> Err(Error(Value, InvalidInput))": "cpu:2281758, mem:2359252, vm:-/-, stk:-, auth:-/-", + " 71 call call(Address(obj#17), Symbol(test), Vec(obj#59))": "cpu:2282198, mem:2359316, objs:-/30@e83a4bc8", + " 72 push VM:a5b4867e:test(U256(123), I256(obj#123))": "cpu:2446988, mem:2521623, objs:-/31@6fb56c91, vm:65536@b1cd98b9/2@2f94d90d, stk:1@da11e11b, auth:1@74ca8f1b/-", + " 73 call bls12_381_fr_pow(U256(123), bad:71)": "cpu:2450101, mem:2521710, objs:1@36f43d1e/31@6fb56c91, vm:-/-, stk:1@bdcc9593", + " 74 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2450423, vm:65536@b1cd98b9/2@2f94d90d", + " 75 ret call -> Err(Error(Value, InvalidInput))": "cpu:2451045, mem:2521726, objs:-/31@6fb56c91, vm:-/-, stk:-, auth:-/-", + " 76 call call(Address(obj#17), Symbol(test), Vec(obj#63))": "cpu:2451485, mem:2521790, objs:-/32@1daba901", + " 77 push VM:a5b4867e:test(U256(123), I256(-123))": "cpu:2616275, mem:2684097, objs:-/33@25c8348, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1fc2812e, auth:1@c74f2468/-", + " 78 call bls12_381_fr_pow(U256(123), bad:-31475)": "cpu:2618953, mem:2684160, vm:-/-", + " 79 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2619275, vm:65536@b1cd98b9/2@2f94d90d", + " 80 ret call -> Err(Error(Value, InvalidInput))": "cpu:2619897, mem:2684176, vm:-/-, stk:-, auth:-/-", + " 81 call call(Address(obj#17), Symbol(test), Vec(obj#67))": "cpu:2620337, mem:2684240, objs:-/34@b22324b", + " 82 push VM:a5b4867e:test(U256(123), I256(-123))": "cpu:2785127, mem:2846547, objs:-/35@976700fd, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1fc2812e, auth:1@f20baebf/-", + " 83 call bls12_381_fr_pow(U256(123), bad:-31475)": "cpu:2787805, mem:2846610, vm:-/-", + " 84 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2788127, vm:65536@b1cd98b9/2@2f94d90d", + " 85 ret call -> Err(Error(Value, InvalidInput))": "cpu:2788749, mem:2846626, vm:-/-, stk:-, auth:-/-", + " 86 call call(Address(obj#17), Symbol(test), Vec(obj#71))": "cpu:2789189, mem:2846690, objs:-/36@f8613f75", + " 87 push VM:a5b4867e:test(U256(123), I32(-123))": "cpu:2953979, mem:3008997, objs:-/37@65b641c4, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b36a0d6c, auth:1@1cd815b8/-", + " 88 call bls12_381_fr_pow(U256(123), bad:-528280977403)": "cpu:2956657, mem:3009060, vm:-/-", + " 89 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2956979, vm:65536@b1cd98b9/2@2f94d90d", + " 90 ret call -> Err(Error(Value, InvalidInput))": "cpu:2957601, mem:3009076, vm:-/-, stk:-, auth:-/-", + " 91 call call(Address(obj#17), Symbol(test), Vec(obj#75))": "cpu:2958041, mem:3009140, objs:-/38@7cef7ff8", + " 92 push VM:a5b4867e:test(U256(123), I64(obj#123))": "cpu:3122831, mem:3171447, objs:-/39@579fa5f5, vm:65536@b1cd98b9/2@2f94d90d, stk:1@24a8a8e, auth:1@cf8ac60a/-", + " 93 call bls12_381_fr_pow(U256(123), bad:65)": "cpu:3125944, mem:3171534, objs:1@bc2f994b/39@579fa5f5, vm:-/-, stk:1@61f2dd31", + " 94 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3126266, vm:65536@b1cd98b9/2@2f94d90d", + " 95 ret call -> Err(Error(Value, InvalidInput))": "cpu:3126888, mem:3171550, objs:-/39@579fa5f5, vm:-/-, stk:-, auth:-/-", + " 96 call call(Address(obj#17), Symbol(test), Vec(obj#79))": "cpu:3127328, mem:3171614, objs:-/40@9f09fd17", + " 97 push VM:a5b4867e:test(U256(123), I64(-123))": "cpu:3292118, mem:3333921, objs:-/41@47072d35, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1520a6fa, auth:1@17f50ed3/-", + " 98 call bls12_381_fr_pow(U256(123), bad:-31481)": "cpu:3294796, mem:3333984, vm:-/-", + " 99 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3295118, vm:65536@b1cd98b9/2@2f94d90d", + " 100 ret call -> Err(Error(Value, InvalidInput))": "cpu:3295740, mem:3334000, vm:-/-, stk:-, auth:-/-", + " 101 call call(Address(obj#17), Symbol(test), Vec(obj#83))": "cpu:3296180, mem:3334064, objs:-/42@b35d8736", + " 102 push VM:a5b4867e:test(U256(123), Map(obj#123))": "cpu:3460970, mem:3496371, objs:-/43@aba1ec0d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@712e0c7, auth:1@9cadbca8/-", + " 103 call bls12_381_fr_pow(U256(123), bad:76)": "cpu:3464083, mem:3496458, objs:1@a940116a/43@aba1ec0d, vm:-/-, stk:1@6b49da62", + " 104 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3464405, vm:65536@b1cd98b9/2@2f94d90d", + " 105 ret call -> Err(Error(Value, InvalidInput))": "cpu:3465027, mem:3496474, objs:-/43@aba1ec0d, vm:-/-, stk:-, auth:-/-", + " 106 call call(Address(obj#17), Symbol(test), Vec(obj#87))": "cpu:3465467, mem:3496538, objs:-/44@fbeeb1fe", + " 107 push VM:a5b4867e:test(U256(123), String(obj#123))": "cpu:3630257, mem:3658845, objs:-/45@98c4ecf, vm:65536@b1cd98b9/2@2f94d90d, stk:1@2e1c5d65, auth:1@bc972186/-", + " 108 call bls12_381_fr_pow(U256(123), bad:73)": "cpu:3633370, mem:3658932, objs:1@a1dcd3f9/45@98c4ecf, vm:-/-, stk:1@2cbc7858", + " 109 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3633692, vm:65536@b1cd98b9/2@2f94d90d", + " 110 ret call -> Err(Error(Value, InvalidInput))": "cpu:3634314, mem:3658948, objs:-/45@98c4ecf, vm:-/-, stk:-, auth:-/-", + " 111 call call(Address(obj#17), Symbol(test), Vec(obj#91))": "cpu:3634754, mem:3659012, objs:-/46@938025b0", + " 112 push VM:a5b4867e:test(U256(123), Symbol(abc))": "cpu:3799544, mem:3821319, objs:-/47@481652e8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@570d7824, auth:1@430af039/-", + " 113 call bls12_381_fr_pow(U256(123), bad:40495118)": "cpu:3802222, mem:3821382, vm:-/-", + " 114 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3802544, vm:65536@b1cd98b9/2@2f94d90d", + " 115 ret call -> Err(Error(Value, InvalidInput))": "cpu:3803166, mem:3821398, vm:-/-, stk:-, auth:-/-", + " 116 call call(Address(obj#17), Symbol(test), Vec(obj#95))": "cpu:3803606, mem:3821462, objs:-/48@afa55aba", + " 117 push VM:a5b4867e:test(U256(123), Symbol(obj#123))": "cpu:3968396, mem:3983769, objs:-/49@36127b2d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@6471f37, auth:1@1824f0f4/-", + " 118 call bls12_381_fr_pow(U256(123), bad:74)": "cpu:3971509, mem:3983856, objs:1@d6584255/49@36127b2d, vm:-/-, stk:1@1a6baee5", + " 119 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3971831, vm:65536@b1cd98b9/2@2f94d90d", + " 120 ret call -> Err(Error(Value, InvalidInput))": "cpu:3972453, mem:3983872, objs:-/49@36127b2d, vm:-/-, stk:-, auth:-/-", + " 121 call call(Address(obj#17), Symbol(test), Vec(obj#99))": "cpu:3972893, mem:3983936, objs:-/50@a514c02c", + " 122 push VM:a5b4867e:test(U256(123), Symbol(abc))": "cpu:4137683, mem:4146243, objs:-/51@7160a4b8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@570d7824, auth:1@47dc6783/-", + " 123 call bls12_381_fr_pow(U256(123), bad:40495118)": "cpu:4140361, mem:4146306, vm:-/-", + " 124 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4140683, vm:65536@b1cd98b9/2@2f94d90d", + " 125 ret call -> Err(Error(Value, InvalidInput))": "cpu:4141305, mem:4146322, vm:-/-, stk:-, auth:-/-", + " 126 call call(Address(obj#17), Symbol(test), Vec(obj#103))": "cpu:4141745, mem:4146386, objs:-/52@3a73e176", + " 127 push VM:a5b4867e:test(U256(123), Timepoint(obj#123))": "cpu:4306535, mem:4308693, objs:-/53@9082beea, vm:65536@b1cd98b9/2@2f94d90d, stk:1@49fd24f5, auth:1@5559c1ca/-", + " 128 call bls12_381_fr_pow(U256(123), bad:66)": "cpu:4309648, mem:4308780, objs:1@710f8d02/53@9082beea, vm:-/-, stk:1@b709543", + " 129 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4309970, vm:65536@b1cd98b9/2@2f94d90d", + " 130 ret call -> Err(Error(Value, InvalidInput))": "cpu:4310592, mem:4308796, objs:-/53@9082beea, vm:-/-, stk:-, auth:-/-", + " 131 call call(Address(obj#17), Symbol(test), Vec(obj#107))": "cpu:4311032, mem:4308860, objs:-/54@f134d9ee", + " 132 push VM:a5b4867e:test(U256(123), Timepoint(123))": "cpu:4475822, mem:4471167, objs:-/55@11ce7ad6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@84a5969e, auth:1@d0636f0/-", + " 133 call bls12_381_fr_pow(U256(123), bad:31496)": "cpu:4478500, mem:4471230, vm:-/-", + " 134 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4478822, vm:65536@b1cd98b9/2@2f94d90d", + " 135 ret call -> Err(Error(Value, InvalidInput))": "cpu:4479444, mem:4471246, vm:-/-, stk:-, auth:-/-", + " 136 call call(Address(obj#17), Symbol(test), Vec(obj#111))": "cpu:4479884, mem:4471310, objs:-/56@14d4d807", + " 137 push VM:a5b4867e:test(U256(123), Timepoint(123))": "cpu:4644674, mem:4633617, objs:-/57@ecc28d6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@84a5969e, auth:1@c8a5df3/-", + " 138 call bls12_381_fr_pow(U256(123), bad:31496)": "cpu:4647352, mem:4633680, vm:-/-", + " 139 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4647674, vm:65536@b1cd98b9/2@2f94d90d", + " 140 ret call -> Err(Error(Value, InvalidInput))": "cpu:4648296, mem:4633696, vm:-/-, stk:-, auth:-/-", + " 141 call call(Address(obj#17), Symbol(test), Vec(obj#115))": "cpu:4648736, mem:4633760, objs:-/58@8cc8c3b5", + " 142 push VM:a5b4867e:test(U256(123), U128(obj#123))": "cpu:4813526, mem:4796067, objs:-/59@a1906fb1, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b89c8d19, auth:1@4f3765d6/-", + " 143 call bls12_381_fr_pow(U256(123), bad:68)": "cpu:4816639, mem:4796154, objs:1@32400498/59@a1906fb1, vm:-/-, stk:1@70f54d2b", + " 144 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4816961, vm:65536@b1cd98b9/2@2f94d90d", + " 145 ret call -> Err(Error(Value, InvalidInput))": "cpu:4817583, mem:4796170, objs:-/59@a1906fb1, vm:-/-, stk:-, auth:-/-", + " 146 call call(Address(obj#17), Symbol(test), Vec(obj#119))": "cpu:4818023, mem:4796234, objs:-/60@222f4855", + " 147 push VM:a5b4867e:test(U256(123), U128(123))": "cpu:4982813, mem:4958541, objs:-/61@41f77d22, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1e3b5f8a, auth:1@1ed43931/-", + " 148 call bls12_381_fr_pow(U256(123), bad:31498)": "cpu:4985491, mem:4958604, vm:-/-", + " 149 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4985813, vm:65536@b1cd98b9/2@2f94d90d", + " 150 ret call -> Err(Error(Value, InvalidInput))": "cpu:4986435, mem:4958620, vm:-/-, stk:-, auth:-/-", + " 151 call call(Address(obj#17), Symbol(test), Vec(obj#123))": "cpu:4986875, mem:4958684, objs:-/62@22bd31c", + " 152 push VM:a5b4867e:test(U256(123), U128(123))": "cpu:5151665, mem:5120991, objs:-/63@18d14c72, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1e3b5f8a, auth:1@4289d549/-", + " 153 call bls12_381_fr_pow(U256(123), bad:31498)": "cpu:5154343, mem:5121054, vm:-/-", + " 154 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5154665, vm:65536@b1cd98b9/2@2f94d90d", + " 155 ret call -> Err(Error(Value, InvalidInput))": "cpu:5155287, mem:5121070, vm:-/-, stk:-, auth:-/-", + " 156 call call(Address(obj#17), Symbol(test), Vec(obj#127))": "cpu:5155727, mem:5121134, objs:-/64@b9a50d26", + " 157 push VM:a5b4867e:test(U256(123), U256(obj#123))": "cpu:5320517, mem:5283441, objs:-/65@cca50f76, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c72b6210, auth:1@b1b6c254/-", + " 158 call bls12_381_fr_pow(U256(123), bad:70)": "cpu:5323630, mem:5283528, objs:1@7546caa9/65@cca50f76, vm:-/-, stk:1@f3d8b9a6", + " 159 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5323952, vm:65536@b1cd98b9/2@2f94d90d", + " 160 ret call -> Err(Error(Value, InvalidInput))": "cpu:5324574, mem:5283544, objs:-/65@cca50f76, vm:-/-, stk:-, auth:-/-", + " 161 call call(Address(obj#17), Symbol(test), Vec(obj#131))": "cpu:5325014, mem:5283608, objs:-/66@fd4b8356", + " 162 push VM:a5b4867e:test(U256(123), U256(123))": "cpu:5489804, mem:5445915, objs:-/67@d0bc126a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ef5d6a43, auth:1@7b356395/-", + " 163 call bls12_381_fr_pow(U256(123), bad:31500)": "cpu:5492482, mem:5445978, vm:-/-", + " 164 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5492804, vm:65536@b1cd98b9/2@2f94d90d", + " 165 ret call -> Err(Error(Value, InvalidInput))": "cpu:5493426, mem:5445994, vm:-/-, stk:-, auth:-/-", + " 166 call call(Address(obj#17), Symbol(test), Vec(obj#135))": "cpu:5493866, mem:5446058, objs:-/68@328ec80f", + " 167 push VM:a5b4867e:test(U256(123), U256(123))": "cpu:5658656, mem:5608365, objs:-/69@2f915a1f, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ef5d6a43, auth:1@a0a66d73/-", + " 168 call bls12_381_fr_pow(U256(123), bad:31500)": "cpu:5661334, mem:5608428, vm:-/-", + " 169 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5661656, vm:65536@b1cd98b9/2@2f94d90d", + " 170 ret call -> Err(Error(Value, InvalidInput))": "cpu:5662278, mem:5608444, vm:-/-, stk:-, auth:-/-", + " 171 call call(Address(obj#17), Symbol(test), Vec(obj#139))": "cpu:5662718, mem:5608508, objs:-/70@8c38e98c", + " 172 push VM:a5b4867e:test(U256(123), U32(123))": "cpu:5827508, mem:5770815, objs:-/71@4c23c09a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@55e76d50, auth:1@4ffc0bd9/-", + " 173 call bls12_381_fr_pow(U256(123), bad:528280977412)": "cpu:5830186, mem:5770878, vm:-/-", + " 174 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5830508, vm:65536@b1cd98b9/2@2f94d90d", + " 175 ret call -> Err(Error(Value, InvalidInput))": "cpu:5831130, mem:5770894, vm:-/-, stk:-, auth:-/-", + " 176 call call(Address(obj#17), Symbol(test), Vec(obj#143))": "cpu:5831570, mem:5770958, objs:-/72@ffa26da7", + " 177 push VM:a5b4867e:test(U256(123), Vec(obj#123))": "cpu:5996360, mem:5933265, objs:-/73@bdc154e2, vm:65536@b1cd98b9/2@2f94d90d, stk:1@24b07b7, auth:1@3426acce/-", + " 178 call bls12_381_fr_pow(U256(123), bad:75)": "cpu:5999473, mem:5933352, objs:1@2f6908f/73@bdc154e2, vm:-/-, stk:1@8ace47ba", + " 179 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5999795, vm:65536@b1cd98b9/2@2f94d90d", + " 180 ret call -> Err(Error(Value, InvalidInput))": "cpu:6000417, mem:5933368, objs:-/73@bdc154e2, vm:-/-, stk:-, auth:-/-", + " 181 call call(Address(obj#17), Symbol(test), Vec(obj#147))": "cpu:6000857, mem:5933432, objs:-/74@6061ee11", + " 182 push VM:a5b4867e:test(U256(123), Void)": "cpu:6165647, mem:6095739, objs:-/75@19bfbfdb, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a631b1f2, auth:1@be16596e/-", + " 183 call bls12_381_fr_pow(U256(123), bad:2)": "cpu:6168325, mem:6095802, vm:-/-", + " 184 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:6168647, vm:65536@b1cd98b9/2@2f94d90d", + " 185 ret call -> Err(Error(Value, InvalidInput))": "cpu:6169269, mem:6095818, vm:-/-, stk:-, auth:-/-", + " 186 end": "cpu:6169269, mem:6095818, prngs:-/9b4a753, objs:-/75@19bfbfdb, vm:-/-, evt:-, store:-/2@5edc50dd, foot:2@a2add42c, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_0.json new file mode 100644 index 000000000..8ed72a02c --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@f8ea83e5", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@159b39d6, store:-/1@1ded1ce6, foot:1@c916eada", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@3a5c646a", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@49db9618", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@1808dd98, auth:1@a2420675/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@a2420675/1@910aaf9c", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@89533a95", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@7f05f840, foot:2@3ccb09f9", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@ca7621fa", + " 14 push VM:debbc76c:sym#13()": "cpu:587479, mem:734545, objs:-/8@67bfa425, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4861adc1, auth:2@99bcb1b8/1@bef0db14", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:debbc76c:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@1cb76b09, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@7cf18f6", + " 22 push VM:debbc76c:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@2e2f2d2c, vm:65536@b1cd98b9/2@2f94d90d, stk:1@915dc46b, auth:1@2eefa960/-", + " 23 call bls12_381_g1_add(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@2e2f2d2c, vm:-/-, stk:1@4c6cabb1", + " 24 pop VM:debbc76c:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@2e2f2d2c, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@2e2f2d2c, vm:-/-, evt:-, store:-/2@7f05f840, foot:2@3ccb09f9, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_1.json new file mode 100644 index 000000000..e7e8f9013 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_1.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@f8ea83e5", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@159b39d6, store:-/1@1ded1ce6, foot:1@c916eada", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@3a5c646a", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@49db9618", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@1808dd98, auth:1@a2420675/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@a2420675/1@910aaf9c", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@89533a95", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@7f05f840, foot:2@3ccb09f9", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@ca7621fa", + " 14 push VM:debbc76c:sym#13()": "cpu:587479, mem:734545, objs:-/8@67bfa425, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4861adc1, auth:2@99bcb1b8/1@bef0db14", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:debbc76c:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@1cb76b09, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@c5cb635e", + " 22 push VM:debbc76c:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@fe4ba10, vm:65536@b1cd98b9/2@2f94d90d, stk:1@dc127d06, auth:1@2eefa960/-", + " 23 call bls12_381_g1_add(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@fe4ba10, vm:-/-, stk:1@d343ca6e", + " 24 pop VM:debbc76c:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@fe4ba10, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@fe4ba10, vm:-/-, evt:-, store:-/2@7f05f840, foot:2@3ccb09f9, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_0.json new file mode 100644 index 000000000..f1df786d1 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@9b8a909c", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@efeb3f54, store:-/1@bb858fb7, foot:1@ece417a3", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2749e8d4", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@80f7841", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@716a7b39, auth:1@2b0e5b7c/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@2b0e5b7c/1@3837d243", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@db65c405", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@f83a6a57, foot:2@36710152", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@74b3709d", + " 14 push VM:9260878f:sym#13()": "cpu:587479, mem:734545, objs:-/8@8001ceb9, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ef4afa91, auth:2@17fa48bc/1@34e27ae0", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:9260878f:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f82a37ee, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@614be462", + " 22 push VM:9260878f:test(Vec(obj#123), Vec(obj#19))": "cpu:757168, mem:897091, objs:-/12@d44771a2, vm:65536@b1cd98b9/2@2f94d90d, stk:1@35f80a05, auth:1@2eefa960/-", + " 23 call bls12_381_g1_msm(Vec(obj#123), Vec(obj#19))": "cpu:760716, mem:897202, objs:2@7a88623e/12@d44771a2, vm:-/-, stk:1@617d5af3", + " 24 pop VM:9260878f:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@d44771a2, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@d44771a2, vm:-/-, evt:-, store:-/2@f83a6a57, foot:2@36710152, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_1.json new file mode 100644 index 000000000..9bdc3f204 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_1.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@9b8a909c", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@efeb3f54, store:-/1@bb858fb7, foot:1@ece417a3", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2749e8d4", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@80f7841", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@716a7b39, auth:1@2b0e5b7c/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@2b0e5b7c/1@3837d243", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@db65c405", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@f83a6a57, foot:2@36710152", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@74b3709d", + " 14 push VM:9260878f:sym#13()": "cpu:587479, mem:734545, objs:-/8@8001ceb9, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ef4afa91, auth:2@17fa48bc/1@34e27ae0", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:9260878f:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f82a37ee, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@d9660342", + " 22 push VM:9260878f:test(Vec(obj#19), Vec(obj#123))": "cpu:757168, mem:897091, objs:-/12@718ee31a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ddf65df1, auth:1@2eefa960/-", + " 23 call bls12_381_g1_msm(Vec(obj#19), Vec(obj#123))": "cpu:760716, mem:897202, objs:2@9973ea16/12@718ee31a, vm:-/-, stk:1@d7cd73f1", + " 24 pop VM:9260878f:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@718ee31a, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@718ee31a, vm:-/-, evt:-, store:-/2@f83a6a57, foot:2@36710152, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_mul_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_mul_arg_0.json new file mode 100644 index 000000000..6d6b83567 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_mul_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@5d68d0ec", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@112afdc, store:-/1@67d4280, foot:1@56c7efdd", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@b9248f03", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@b026096d", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@4e4d6241, auth:1@38bf146a/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@38bf146a/1@43383b03", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@1de0a5d5", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@a597cdd5, foot:2@d720294f", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@b66d50c5", + " 14 push VM:3e9df894:sym#13()": "cpu:587479, mem:734545, objs:-/8@c841d678, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b3c58ecc, auth:2@3c0501b4/1@d7a73daf", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:3e9df894:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@297bd2cf, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:591938, mem:734720, objs:-/10@62919bd9", + " 22 push VM:3e9df894:test(Bytes(obj#123), U256(123))": "cpu:756728, mem:897027, objs:-/11@2a577eed, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b239a32e, auth:1@b1b428e/-", + " 23 call bls12_381_g1_mul(Bytes(obj#123), U256(123))": "cpu:759841, mem:897114, objs:1@1c4ba01b/11@2a577eed, vm:-/-, stk:1@fbb0b6c1", + " 24 pop VM:3e9df894:test -> Err(Error(Value, InvalidInput))": "cpu:760224, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:760846, mem:897130, objs:-/11@2a577eed, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:760846, mem:897130, prngs:-/9b4a753, objs:-/11@2a577eed, vm:-/-, evt:-, store:-/2@a597cdd5, foot:2@d720294f, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_0.json new file mode 100644 index 000000000..249ffc7f0 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@30ac6ca", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@cf3f5ffd, store:-/1@95396a6f, foot:1@ece7f129", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2dc86a0e", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@6a505c46", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@c72afdf2, auth:1@4991ced0/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@4991ced0/1@3bc292ca", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@fa0fc22c", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@1d2f22b, foot:2@abcef20", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@b17519b5", + " 14 push VM:52dc4818:sym#13()": "cpu:587479, mem:734545, objs:-/8@aeed3c03, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ec066dcc, auth:2@eb7ae117/1@5c17c4ff", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:52dc4818:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de84d879, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@6a04878", + " 22 push VM:52dc4818:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@ab72633d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@50179a96, auth:1@2eefa960/-", + " 23 call bls12_381_g2_add(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@ab72633d, vm:-/-, stk:1@6d14dc67", + " 24 pop VM:52dc4818:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@ab72633d, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@ab72633d, vm:-/-, evt:-, store:-/2@1d2f22b, foot:2@abcef20, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_1.json new file mode 100644 index 000000000..5d021bc66 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_1.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@30ac6ca", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@cf3f5ffd, store:-/1@95396a6f, foot:1@ece7f129", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2dc86a0e", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@6a505c46", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@c72afdf2, auth:1@4991ced0/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@4991ced0/1@3bc292ca", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@fa0fc22c", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@1d2f22b, foot:2@abcef20", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@b17519b5", + " 14 push VM:52dc4818:sym#13()": "cpu:587479, mem:734545, objs:-/8@aeed3c03, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ec066dcc, auth:2@eb7ae117/1@5c17c4ff", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:52dc4818:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de84d879, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@5c0401b8", + " 22 push VM:52dc4818:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@32f0a095, vm:65536@b1cd98b9/2@2f94d90d, stk:1@65867f62, auth:1@2eefa960/-", + " 23 call bls12_381_g2_add(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@32f0a095, vm:-/-, stk:1@df0c3cdc", + " 24 pop VM:52dc4818:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@32f0a095, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@32f0a095, vm:-/-, evt:-, store:-/2@1d2f22b, foot:2@abcef20, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_0.json new file mode 100644 index 000000000..5d0776a34 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@6167eb8f", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@b1018bfd, store:-/1@11c14a63, foot:1@4b225d08", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@92324", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@96b271b6", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@b746160c, auth:1@67d60a88/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@67d60a88/1@5e9ab55d", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@6daa9397", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@cf024a3a, foot:2@bed7dcee", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@2b632d", + " 14 push VM:8fe91e5e:sym#13()": "cpu:587479, mem:734545, objs:-/8@17db6ce6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a8dbb6d2, auth:2@411fe97a/1@100968af", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:8fe91e5e:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f9a550b8, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@b17947a2", + " 22 push VM:8fe91e5e:test(Vec(obj#123), Vec(obj#19))": "cpu:757168, mem:897091, objs:-/12@68fb312c, vm:65536@b1cd98b9/2@2f94d90d, stk:1@147dd7fe, auth:1@2eefa960/-", + " 23 call bls12_381_g2_msm(Vec(obj#123), Vec(obj#19))": "cpu:760716, mem:897202, objs:2@7a88623e/12@68fb312c, vm:-/-, stk:1@98b1755a", + " 24 pop VM:8fe91e5e:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@68fb312c, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@68fb312c, vm:-/-, evt:-, store:-/2@cf024a3a, foot:2@bed7dcee, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_1.json new file mode 100644 index 000000000..c3021f325 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_1.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@6167eb8f", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@b1018bfd, store:-/1@11c14a63, foot:1@4b225d08", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@92324", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@96b271b6", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@b746160c, auth:1@67d60a88/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@67d60a88/1@5e9ab55d", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@6daa9397", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@cf024a3a, foot:2@bed7dcee", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@2b632d", + " 14 push VM:8fe91e5e:sym#13()": "cpu:587479, mem:734545, objs:-/8@17db6ce6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a8dbb6d2, auth:2@411fe97a/1@100968af", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:8fe91e5e:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f9a550b8, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@88711c24", + " 22 push VM:8fe91e5e:test(Vec(obj#19), Vec(obj#123))": "cpu:757168, mem:897091, objs:-/12@e96c76f7, vm:65536@b1cd98b9/2@2f94d90d, stk:1@9874e29a, auth:1@2eefa960/-", + " 23 call bls12_381_g2_msm(Vec(obj#19), Vec(obj#123))": "cpu:760716, mem:897202, objs:2@9973ea16/12@e96c76f7, vm:-/-, stk:1@d8f0451f", + " 24 pop VM:8fe91e5e:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@e96c76f7, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@e96c76f7, vm:-/-, evt:-, store:-/2@cf024a3a, foot:2@bed7dcee, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_mul_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_mul_arg_0.json new file mode 100644 index 000000000..d82cee33a --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_mul_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@e21161a8", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@1a71dd, store:-/1@5871e06b, foot:1@2ec8ea04", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@10ffd2ee", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@3ba2b8d3", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@81e09efc, auth:1@ad84a34f/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@ad84a34f/1@9e559db5", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@b96baac2", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@72312903, foot:2@42bbe255", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@f71e9505", + " 14 push VM:28643094:sym#13()": "cpu:587479, mem:734545, objs:-/8@1cd7c910, vm:65536@b1cd98b9/2@2f94d90d, stk:1@171ac322, auth:2@2f7815cc/1@d2252ed0", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:28643094:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@aeffeed4, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:591938, mem:734720, objs:-/10@7c457218", + " 22 push VM:28643094:test(Bytes(obj#123), U256(123))": "cpu:756728, mem:897027, objs:-/11@dc46a7b2, vm:65536@b1cd98b9/2@2f94d90d, stk:1@8f2ec930, auth:1@b1b428e/-", + " 23 call bls12_381_g2_mul(Bytes(obj#123), U256(123))": "cpu:759841, mem:897114, objs:1@1c4ba01b/11@dc46a7b2, vm:-/-, stk:1@ac4e1fc7", + " 24 pop VM:28643094:test -> Err(Error(Value, InvalidInput))": "cpu:760224, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:760846, mem:897130, objs:-/11@dc46a7b2, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:760846, mem:897130, prngs:-/9b4a753, objs:-/11@dc46a7b2, vm:-/-, evt:-, store:-/2@72312903, foot:2@42bbe255, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_0.json new file mode 100644 index 000000000..4a6433be0 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@ba0e28cf", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@2529719d, store:-/1@8214f796, foot:1@b6a2c7f", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@bfc0f708", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@318855d8", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@f37266de, auth:1@5a647477/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@5a647477/1@794bb88a", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@2d2555b3", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@60869dc1, foot:2@909ab5d1", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@d5832548", + " 14 push VM:cd8d3801:sym#13()": "cpu:587479, mem:734545, objs:-/8@82d77fd8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@375b8d47, auth:2@e1c21d62/1@f4e59b3e", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:cd8d3801:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@8cd107bd, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@b9d3214a", + " 22 push VM:cd8d3801:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@e64a91d8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@7bb27b9b, auth:1@2eefa960/-", + " 23 call bls12_381_hash_to_g1(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@e64a91d8, vm:-/-, stk:1@b702f519", + " 24 pop VM:cd8d3801:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@e64a91d8, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@e64a91d8, vm:-/-, evt:-, store:-/2@60869dc1, foot:2@909ab5d1, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_1.json new file mode 100644 index 000000000..6e37c3cd3 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_1.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@ba0e28cf", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@2529719d, store:-/1@8214f796, foot:1@b6a2c7f", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@bfc0f708", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@318855d8", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@f37266de, auth:1@5a647477/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@5a647477/1@794bb88a", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@2d2555b3", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@60869dc1, foot:2@909ab5d1", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@d5832548", + " 14 push VM:cd8d3801:sym#13()": "cpu:587479, mem:734545, objs:-/8@82d77fd8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@375b8d47, auth:2@e1c21d62/1@f4e59b3e", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:cd8d3801:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@8cd107bd, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@945cb174", + " 22 push VM:cd8d3801:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@d3cc13c, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a0981c11, auth:1@2eefa960/-", + " 23 call bls12_381_hash_to_g1(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@d3cc13c, vm:-/-, stk:1@eae1d254", + " 24 pop VM:cd8d3801:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@d3cc13c, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@d3cc13c, vm:-/-, evt:-, store:-/2@60869dc1, foot:2@909ab5d1, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_0.json new file mode 100644 index 000000000..a8f9ccdc6 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@e652b341", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@4e24e8fb, store:-/1@4ee9a390, foot:1@6258bc59", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@b2b8465f", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@55fdb8e6", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@6789640d, auth:1@a28d2bc5/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@a28d2bc5/1@afc282f7", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@5675844f", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@8d1aad92, foot:2@67664879", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@51a69b40", + " 14 push VM:319e95a6:sym#13()": "cpu:587479, mem:734545, objs:-/8@8619fff, vm:65536@b1cd98b9/2@2f94d90d, stk:1@3c77e611, auth:2@bc67f9ed/1@918ae649", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:319e95a6:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de342357, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@5631c33", + " 22 push VM:319e95a6:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@3d0c994, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1b66d74, auth:1@2eefa960/-", + " 23 call bls12_381_hash_to_g2(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@3d0c994, vm:-/-, stk:1@70ce428a", + " 24 pop VM:319e95a6:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@3d0c994, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@3d0c994, vm:-/-, evt:-, store:-/2@8d1aad92, foot:2@67664879, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_1.json new file mode 100644 index 000000000..e9b2045db --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_1.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@e652b341", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@4e24e8fb, store:-/1@4ee9a390, foot:1@6258bc59", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@b2b8465f", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@55fdb8e6", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@6789640d, auth:1@a28d2bc5/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@a28d2bc5/1@afc282f7", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@5675844f", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@8d1aad92, foot:2@67664879", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@51a69b40", + " 14 push VM:319e95a6:sym#13()": "cpu:587479, mem:734545, objs:-/8@8619fff, vm:65536@b1cd98b9/2@2f94d90d, stk:1@3c77e611, auth:2@bc67f9ed/1@918ae649", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:319e95a6:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de342357, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@cc639c49", + " 22 push VM:319e95a6:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@2601b114, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1e3a6314, auth:1@2eefa960/-", + " 23 call bls12_381_hash_to_g2(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@2601b114, vm:-/-, stk:1@b781e257", + " 24 pop VM:319e95a6:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@2601b114, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@2601b114, vm:-/-, evt:-, store:-/2@8d1aad92, foot:2@67664879, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp2_to_g2_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp2_to_g2_arg_0.json new file mode 100644 index 000000000..16175f03d --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp2_to_g2_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(119)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1036, mem:199, objs:-/1@8156aea0", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:238338, mem:407206, objs:-/2@8ebb1a47, store:-/1@b45b32f7, foot:1@378804e", + " 5 call bytes_new_from_slice(32)": "cpu:238778, mem:407270, objs:-/3@2157c3bc", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:239747, mem:407382, objs:-/4@1662544e", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:242358, mem:407622, objs:-/5@f297b019, auth:1@8af98181/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:242650", + " 10 call get_ledger_network_id()": "cpu:242700, auth:1@8af98181/1@5c62024f", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:243730, mem:407734, objs:-/6@a598f37b", + " 12 call symbol_new_from_slice(13)": "cpu:420583, mem:572038, store:-/2@76805b99, foot:2@69bb5f12", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:421591, mem:572131, objs:-/7@5c4a852f", + " 14 push VM:4fc46e19:sym#13()": "cpu:584594, mem:734257, objs:-/8@1904b0e4, vm:65536@b1cd98b9/2@2f94d90d, stk:1@926ffb2b, auth:2@e7d48069/1@53b4bbfe", + " 15 call symbol_len(Symbol(obj#13))": "cpu:587264, mem:734288", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:587386", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:587490", + " 19 pop VM:4fc46e19:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:588613, mem:734368, objs:-/9@c9b810ee, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:589053, mem:734432, objs:-/10@f1da2e4e", + " 22 push VM:4fc46e19:test(Bytes(obj#123))": "cpu:753837, mem:896718, objs:-/11@e358cdae, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a5016864, auth:1@b1b428e/-", + " 23 call bls12_381_map_fp2_to_g2(Bytes(obj#123))": "cpu:756946, mem:896789, objs:1@1c4ba01b/11@e358cdae, vm:-/-, stk:1@e056e4b", + " 24 pop VM:4fc46e19:test -> Err(Error(Value, InvalidInput))": "cpu:757329, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:757951, mem:896805, objs:-/11@e358cdae, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:757951, mem:896805, prngs:-/9b4a753, objs:-/11@e358cdae, vm:-/-, evt:-, store:-/2@76805b99, foot:2@69bb5f12, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp_to_g1_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp_to_g1_arg_0.json new file mode 100644 index 000000000..adca4bbb1 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp_to_g1_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(119)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1036, mem:199, objs:-/1@b4bf0722", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:238338, mem:407206, objs:-/2@de847db1, store:-/1@a1fb3ef7, foot:1@45218ec", + " 5 call bytes_new_from_slice(32)": "cpu:238778, mem:407270, objs:-/3@8095d706", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:239747, mem:407382, objs:-/4@b45b0d32", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:242358, mem:407622, objs:-/5@1fb49e85, auth:1@5116618c/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:242650", + " 10 call get_ledger_network_id()": "cpu:242700, auth:1@5116618c/1@e381a43b", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:243730, mem:407734, objs:-/6@330e2088", + " 12 call symbol_new_from_slice(13)": "cpu:420583, mem:572038, store:-/2@8518547e, foot:2@81e7c618", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:421591, mem:572131, objs:-/7@a1191ef4", + " 14 push VM:d0e6b201:sym#13()": "cpu:584594, mem:734257, objs:-/8@9d94b5b4, vm:65536@b1cd98b9/2@2f94d90d, stk:1@54953624, auth:2@670a31bc/1@c5bb926b", + " 15 call symbol_len(Symbol(obj#13))": "cpu:587264, mem:734288", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:587386", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:587490", + " 19 pop VM:d0e6b201:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:588613, mem:734368, objs:-/9@5040a4c3, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:589053, mem:734432, objs:-/10@f19212a1", + " 22 push VM:d0e6b201:test(Bytes(obj#123))": "cpu:753837, mem:896718, objs:-/11@e0f38903, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4b0c8a78, auth:1@b1b428e/-", + " 23 call bls12_381_map_fp_to_g1(Bytes(obj#123))": "cpu:756946, mem:896789, objs:1@1c4ba01b/11@e0f38903, vm:-/-, stk:1@c3c3a38c", + " 24 pop VM:d0e6b201:test -> Err(Error(Value, InvalidInput))": "cpu:757329, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:757951, mem:896805, objs:-/11@e0f38903, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:757951, mem:896805, prngs:-/9b4a753, objs:-/11@e0f38903, vm:-/-, evt:-, store:-/2@8518547e, foot:2@81e7c618, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_0.json new file mode 100644 index 000000000..0cb553c98 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@bf556d6e", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@6730610d, store:-/1@70a3c418, foot:1@130f87c8", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@4554fb8f", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@b0cb9d95", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@388f748d, auth:1@9453e2aa/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@9453e2aa/1@7c502362", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@a4e6149e", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@50f2b3d8, foot:2@ff5217cb", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@79609873", + " 14 push VM:5243202f:sym#13()": "cpu:587479, mem:734545, objs:-/8@d4fc5a0, vm:65536@b1cd98b9/2@2f94d90d, stk:1@6b51ff6f, auth:2@7772c868/1@c2248c61", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:5243202f:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@7b5404d7, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@ecf857a8", + " 22 push VM:5243202f:test(Vec(obj#123), Vec(obj#19))": "cpu:757168, mem:897091, objs:-/12@3937b1ae, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b41c727a, auth:1@2eefa960/-", + " 23 call bls12_381_multi_pairing_check(Vec(obj#123), Vec(obj#19))": "cpu:760716, mem:897202, objs:2@7a88623e/12@3937b1ae, vm:-/-, stk:1@68599fd5", + " 24 pop VM:5243202f:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@3937b1ae, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@3937b1ae, vm:-/-, evt:-, store:-/2@50f2b3d8, foot:2@ff5217cb, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_1.json new file mode 100644 index 000000000..8384e888c --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_1.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(122)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@bf556d6e", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@6730610d, store:-/1@70a3c418, foot:1@130f87c8", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@4554fb8f", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@b0cb9d95", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@388f748d, auth:1@9453e2aa/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:245531", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@9453e2aa/1@7c502362", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@a4e6149e", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@50f2b3d8, foot:2@ff5217cb", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@79609873", + " 14 push VM:5243202f:sym#13()": "cpu:587479, mem:734545, objs:-/8@d4fc5a0, vm:65536@b1cd98b9/2@2f94d90d, stk:1@6b51ff6f, auth:2@7772c868/1@c2248c61", + " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", + " 19 pop VM:5243202f:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@7b5404d7, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@ed2527c8", + " 22 push VM:5243202f:test(Vec(obj#19), Vec(obj#123))": "cpu:757168, mem:897091, objs:-/12@d5028bfc, vm:65536@b1cd98b9/2@2f94d90d, stk:1@46751f80, auth:1@2eefa960/-", + " 23 call bls12_381_multi_pairing_check(Vec(obj#19), Vec(obj#123))": "cpu:760716, mem:897202, objs:2@9973ea16/12@d5028bfc, vm:-/-, stk:1@2136021e", + " 24 pop VM:5243202f:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@d5028bfc, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@d5028bfc, vm:-/-, evt:-, store:-/2@50f2b3d8, foot:2@ff5217cb, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/src/budget.rs b/soroban-env-host/src/budget.rs index c24a0af3e..efd091598 100644 --- a/soroban-env-host/src/budget.rs +++ b/soroban-env-host/src/budget.rs @@ -115,6 +115,29 @@ impl Default for BudgetTracker { ContractCostType::InstantiateWasmDataSegmentBytes => init_input(), ContractCostType::Sec1DecodePointUncompressed => (), ContractCostType::VerifyEcdsaSecp256r1Sig => (), + ContractCostType::Bls12381EncodeFp => (), + ContractCostType::Bls12381DecodeFp => (), + ContractCostType::Bls12381G1Validate => (), + ContractCostType::Bls12381G2Validate => (), + ContractCostType::Bls12381G1ProjectiveToAffine => (), + ContractCostType::Bls12381G2ProjectiveToAffine => (), + ContractCostType::Bls12381G1Add => (), + ContractCostType::Bls12381G1Mul => (), + ContractCostType::Bls12381G1Msm => init_input(), // input is number of (G1,Fr) pairs + ContractCostType::Bls12381MapFpToG1 => (), + ContractCostType::Bls12381HashToG1 => init_input(), + ContractCostType::Bls12381G2Add => (), + ContractCostType::Bls12381G2Mul => (), + ContractCostType::Bls12381G2Msm => init_input(), // input is number of (G2,Fr) pairs + ContractCostType::Bls12381MapFp2ToG2 => (), + ContractCostType::Bls12381HashToG2 => init_input(), + ContractCostType::Bls12381Pairing => init_input(), // input is number of (G1,G2) pairs + ContractCostType::Bls12381FrFromU256 => (), + ContractCostType::Bls12381FrToU256 => (), + ContractCostType::Bls12381FrAddSub => (), + ContractCostType::Bls12381FrMul => (), + ContractCostType::Bls12381FrPow => init_input(), // input is number of bits in the u64 exponent excluding leading zeros + ContractCostType::Bls12381FrInv => (), } } mt @@ -557,6 +580,98 @@ impl Default for BudgetImpl { cpu.const_term = 3000906; cpu.lin_term = ScaledU64(0); } + ContractCostType::Bls12381EncodeFp => { + cpu.const_term = 661; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381DecodeFp => { + cpu.const_term = 985; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1Validate => { + cpu.const_term = 732301; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2Validate => { + cpu.const_term = 1063432; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1ProjectiveToAffine => { + cpu.const_term = 92642; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2ProjectiveToAffine => { + cpu.const_term = 100742; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1Add => { + cpu.const_term = 7689; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1Mul => { + cpu.const_term = 2458985; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1Msm => { + cpu.const_term = 2426722; + cpu.lin_term = ScaledU64(96397671); + } + ContractCostType::Bls12381MapFpToG1 => { + cpu.const_term = 1541554; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381HashToG1 => { + cpu.const_term = 3211191; + cpu.lin_term = ScaledU64(6713); + } + ContractCostType::Bls12381G2Add => { + cpu.const_term = 25207; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2Mul => { + cpu.const_term = 7873219; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2Msm => { + cpu.const_term = 8035968; + cpu.lin_term = ScaledU64(309667335); + } + ContractCostType::Bls12381MapFp2ToG2 => { + cpu.const_term = 2420202; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381HashToG2 => { + cpu.const_term = 7050564; + cpu.lin_term = ScaledU64(6797); + } + ContractCostType::Bls12381Pairing => { + cpu.const_term = 10558948; + cpu.lin_term = ScaledU64(632860943); + } + ContractCostType::Bls12381FrFromU256 => { + cpu.const_term = 1994; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381FrToU256 => { + cpu.const_term = 1155; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381FrAddSub => { + cpu.const_term = 74; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381FrMul => { + cpu.const_term = 332; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381FrPow => { + cpu.const_term = 691; + cpu.lin_term = ScaledU64(74558); + } + ContractCostType::Bls12381FrInv => { + cpu.const_term = 35421; + cpu.lin_term = ScaledU64(0); + } } // define the memory cost model parameters @@ -748,6 +863,98 @@ impl Default for BudgetImpl { mem.const_term = 0; mem.lin_term = ScaledU64(0); } + ContractCostType::Bls12381EncodeFp => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381DecodeFp => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1Validate => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2Validate => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1ProjectiveToAffine => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2ProjectiveToAffine => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1Add => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1Mul => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1Msm => { + mem.const_term = 109494; + mem.lin_term = ScaledU64(354667); + } + ContractCostType::Bls12381MapFpToG1 => { + mem.const_term = 5552; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381HashToG1 => { + mem.const_term = 9424; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2Add => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2Mul => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2Msm => { + mem.const_term = 219654; + mem.lin_term = ScaledU64(354667); + } + ContractCostType::Bls12381MapFp2ToG2 => { + mem.const_term = 3344; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381HashToG2 => { + mem.const_term = 6816; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381Pairing => { + mem.const_term = 2204; + mem.lin_term = ScaledU64(9340474); + } + ContractCostType::Bls12381FrFromU256 => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381FrToU256 => { + mem.const_term = 248; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381FrAddSub => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381FrMul => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381FrPow => { + mem.const_term = 0; + mem.lin_term = ScaledU64(128); + } + ContractCostType::Bls12381FrInv => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } } } diff --git a/soroban-env-host/src/crypto/bls12_381.rs b/soroban-env-host/src/crypto/bls12_381.rs new file mode 100644 index 000000000..545acfa09 --- /dev/null +++ b/soroban-env-host/src/crypto/bls12_381.rs @@ -0,0 +1,665 @@ +use crate::{ + budget::AsBudget, + host_object::HostVec, + xdr::{ContractCostType, ScBytes, ScErrorCode, ScErrorType}, + Bool, BytesObject, ConversionError, Env, Error, Host, HostError, TryFromVal, U256Object, + U256Small, U256Val, Val, VecObject, U256, +}; +use ark_bls12_381::{ + g1, g2, Bls12_381, Fq, Fq12, Fq2, Fr, G1Affine, G1Projective, G2Affine, G2Projective, +}; +use ark_ec::{ + hashing::{ + curve_maps::wb::WBMap, + map_to_curve_hasher::{MapToCurve, MapToCurveBasedHasher}, + HashToCurve, + }, + pairing::{Pairing, PairingOutput}, + scalar_mul::variable_base::VariableBaseMSM, + short_weierstrass::{Affine, Projective, SWCurveConfig}, + CurveGroup, +}; +use ark_ff::{field_hashers::DefaultFieldHasher, BigInteger, Field, PrimeField}; +use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Valid, Validate}; +use num_traits::Zero; +use sha2::Sha256; +use std::cmp::Ordering; +use std::ops::{Add, AddAssign, Mul, MulAssign, SubAssign}; + +pub(crate) const FP_SERIALIZED_SIZE: usize = 48; +pub(crate) const FP2_SERIALIZED_SIZE: usize = FP_SERIALIZED_SIZE * 2; +pub(crate) const G1_SERIALIZED_SIZE: usize = FP_SERIALIZED_SIZE * 2; +pub(crate) const G2_SERIALIZED_SIZE: usize = FP2_SERIALIZED_SIZE * 2; +pub(crate) const FR_SERIALIZED_SIZE: usize = 32; + +impl Host { + // This is the internal routine performing deserialization on various + // element types, which can be conceptually decomposed into units of Fp + // (the base field element), and will be charged accordingly. + // Validation of the deserialized entity must be performed outside of this + // function, to keep budget charging isolated. + pub(crate) fn deserialize_uncompessed_no_validate( + &self, + slice: &[u8], + units_of_fp: u64, + msg: &str, + ) -> Result { + self.as_budget() + .bulk_charge(ContractCostType::Bls12381DecodeFp, units_of_fp, None)?; + // validation turned off here to isolate the cost of serialization. + // proper validation has to be performed outside of this function + T::deserialize_with_mode(slice, Compress::No, Validate::No).map_err(|_e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!("bls12-381: unable to deserialize {msg}").as_str(), + &[], + ) + }) + } + + // This is the internal routine performing serialization on various + // element types, which can be conceptually decomposed into units of Fp + // (the base field element), and will be charged accordingly. + pub(crate) fn serialize_uncompressed_into_slice( + &self, + element: &T, + buf: &mut [u8], + units_of_fp: u64, + msg: &str, + ) -> Result<(), HostError> { + self.as_budget() + .bulk_charge(ContractCostType::Bls12381EncodeFp, units_of_fp, None)?; + element.serialize_uncompressed(buf).map_err(|_e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("bls12-381: unable to serialize {msg}").as_str(), + &[], + ) + })?; + Ok(()) + } + + fn validate_point_encoding( + &self, + bytes: &[u8], + msg: &str, + ) -> Result<(), HostError> { + // validate input bytes length + if EXPECTED_SIZE == 0 || bytes.len() != EXPECTED_SIZE { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!("bls12-381 {msg}: invalid input length to deserialize").as_str(), + &[ + Val::from_u32(bytes.len() as u32).into(), + Val::from_u32(EXPECTED_SIZE as u32).into(), + ], + )); + } + // validated encoded flags. The most significant three bits encode the flags, + // i.e. `byte[0] == [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_7]` + // - the compression_flag should be unset + // - the infinity_flag should be set **only if** rest of bits are all zero + // - the sort_flag should be unset + let flags = 0b1110_0000 & bytes[0]; + match flags { + 0b0100_0000 => { + // infinite bit is set, check all other bits are zero + let mut expected_bytes = [0; EXPECTED_SIZE]; + expected_bytes[0] = flags; + if bytes != expected_bytes { + Err(self.err(ScErrorType::Crypto, ScErrorCode::InvalidInput, format!("bls12-381 {msg} deserialize: infinity flag (bit 1) is set while remaining bits are not all zero").as_str(), &[])) + } else { + Ok(()) + } + }, + 0b0000_0000 => Ok(()), // infinite bit is unset + _ => Err(self.err(ScErrorType::Crypto, ScErrorCode::InvalidInput, format!("bls12-381 {msg} deserialize: either compression flag (bit 0) or the sort flag (bit 2) is set, while the input should be encoded uncompressed").as_str(), &[])) + } + } + + pub(crate) fn metered_check_point( + &self, + pt: Affine

, + ty: ContractCostType, + ) -> Result, HostError> { + self.charge_budget(ty, None)?; + // performs following checks 1. point belongs to the curve 2. point + // belongs to the correct subgroup + pt.check().map_err(|_| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "bls12-381 G1 affine deserialize: invalid point", + &[], + ) + })?; + Ok(pt) + } + + pub(crate) fn g1_affine_deserialize_from_bytesobj( + &self, + bo: BytesObject, + ) -> Result { + let msg: &str = "G1"; + let pt: G1Affine = self.visit_obj(bo, |bytes: &ScBytes| { + self.validate_point_encoding::(&bytes, msg)?; + // `CanonicalDeserialize` of `Affine

` calls into + // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::g1::Config`, the + // core logic is in `arc_bls12_381::curves::util::read_g1_uncompressed`. + // + // The `arc_bls12_381` lib already expects the input to be serialized in + // big-endian order (aligning with the common standard and contrary + // to ark::serialize's convention), + // + // i.e. `input = be_bytes(X) || be_bytes(Y)` and the + // most-significant three bits of X are flags: + // + // `bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` + // + // internally when deserializing `Fp`, the flag bits are masked off + // to get `X: Fp`. The Y however, does not have the top bits masked off + // so it is possible for Y to exceed 381 bits. I've checked all over and + // didn't find that being an invalid condition, so we will leave them as is. + self.deserialize_uncompessed_no_validate(&bytes, 2, msg) + })?; + self.metered_check_point::( + pt, + ContractCostType::Bls12381G1Validate, + ) + } + + pub(crate) fn g1_projective_into_affine( + &self, + g1: G1Projective, + ) -> Result { + self.charge_budget(ContractCostType::Bls12381G1ProjectiveToAffine, None)?; + Ok(g1.into_affine()) + } + + pub(crate) fn g1_affine_serialize_uncompressed( + &self, + g1: G1Affine, + ) -> Result { + let mut buf = vec![0; G1_SERIALIZED_SIZE]; + // `CanonicalSerialize of Affine

` calls into + // `P::serialize_with_mode`, where `P` is `ark_bls12_381::g1::Config`. The + // output bytes will be in following format: `be_bytes(X) || be_bytes(Y)` + // , where the most-significant three bits of X encodes the flags, i.e. + // + // bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383] + // + // This aligns with our standard (which is same as the ZCash standard + // https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) + self.serialize_uncompressed_into_slice(&g1, &mut buf, 2, "G1")?; + self.add_host_object(self.scbytes_from_vec(buf)?) + } + + pub(crate) fn g1_projective_serialize_uncompressed( + &self, + g1: G1Projective, + ) -> Result { + let g1_affine = self.g1_projective_into_affine(g1)?; + self.g1_affine_serialize_uncompressed(g1_affine) + } + + pub(crate) fn g2_affine_deserialize_from_bytesobj( + &self, + bo: BytesObject, + ) -> Result { + let msg: &str = "G2"; + let pt: G2Affine = self.visit_obj(bo, |bytes: &ScBytes| { + self.validate_point_encoding::(&bytes, msg)?; + // `CanonicalDeserialize` of `Affine

` calls into + // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::g2::Config`, the + // core logic is in `arc_bls12_381::curves::util::read_g2_uncompressed`. + // + // The `arc_bls12_381` lib already expects the input to be serialized in + // big-endian order (aligning with the common standard and contrary + // to ark::serialize's convention), + // + // i.e. `input = be_bytes(X) || be_bytes(Y)` and the + // most-significant three bits of X are flags: + // + // `bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` + // + // internally when deserializing `Fp`, the flag bits are masked off + // to get `X: Fp`. The Y however, does not have the top bits masked off + // so it is possible for Y to exceed 381 bits. I've checked all over and + // didn't find that being an invalid condition, so we will leave them as is. + self.deserialize_uncompessed_no_validate(&bytes, 4, msg) + })?; + self.metered_check_point::( + pt, + ContractCostType::Bls12381G2Validate, + ) + } + + pub(crate) fn g2_projective_into_affine( + &self, + g2: G2Projective, + ) -> Result { + self.charge_budget(ContractCostType::Bls12381G2ProjectiveToAffine, None)?; + Ok(g2.into_affine()) + } + + pub(crate) fn g2_affine_serialize_uncompressed( + &self, + g2: G2Affine, + ) -> Result { + let mut buf = vec![0; G2_SERIALIZED_SIZE]; + // `CanonicalSerialization of Affine

` where `P` is `ark_bls12_381::curves::g2::Config`, + // calls into `P::serialize_with_mode`. + // + // The output is in the following format: + // `be_bytes(X_c1) || be_bytes(X_c0) || be_bytes(Y_c1) || be_bytes(Y_c0)` + // + // The most significant three bits of `X_c1` encodes the flags, i.e. + // `bits(X_c1) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` + // + // This format conforms to the zcash standard https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization + // and is the one we picked. + self.serialize_uncompressed_into_slice(&g2, &mut buf, 4, "G2")?; + self.add_host_object(self.scbytes_from_vec(buf)?) + } + + pub(crate) fn g2_projective_serialize_uncompressed( + &self, + g2: G2Projective, + ) -> Result { + let g2_affine = self.g2_projective_into_affine(g2)?; + self.g2_affine_serialize_uncompressed(g2_affine) + } + + pub(crate) fn fr_from_u256val(&self, sv: U256Val) -> Result { + self.charge_budget(ContractCostType::Bls12381FrFromU256, None)?; + let fr = if let Ok(small) = U256Small::try_from(sv) { + Fr::from_le_bytes_mod_order(&u64::from(small).to_le_bytes()) + } else { + let obj: U256Object = sv.try_into()?; + self.visit_obj(obj, |u: &U256| { + Ok(Fr::from_le_bytes_mod_order(&u.to_le_bytes())) + })? + }; + Ok(fr) + } + + pub(crate) fn fr_to_u256val(&self, scalar: Fr) -> Result { + self.charge_budget(ContractCostType::Bls12381FrToU256, None)?; + let bytes: [u8; 32] = scalar + .into_bigint() + .to_bytes_be() + .try_into() + .map_err(|_| HostError::from(ConversionError))?; + let u = U256::from_be_bytes(bytes); + self.map_err(U256Val::try_from_val(self, &u)) + } + + pub(crate) fn fp_deserialize_from_bytesobj(&self, bo: BytesObject) -> Result { + let expected_size = FP_SERIALIZED_SIZE; + self.visit_obj(bo, |bytes: &ScBytes| { + if bytes.len() != expected_size { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "bls12-381 field element (Fp): invalid input length to deserialize", + &[ + Val::from_u32(bytes.len() as u32).into(), + Val::from_u32(expected_size as u32).into(), + ], + )); + } + // `CanonicalDeserialize for Fp` assumes input bytes in + // little-endian order, with the highest bits being empty flags. + // thus we must first reverse the bytes before passing them in. + // there is no other check for Fp besides the length check. + self.charge_budget(ContractCostType::MemCpy, Some(FP_SERIALIZED_SIZE as u64))?; + let mut buf = [0u8; FP_SERIALIZED_SIZE]; + buf.copy_from_slice(bytes); + buf.reverse(); + self.deserialize_uncompessed_no_validate(&buf, 1, "Fp") + }) + } + + pub(crate) fn fp2_deserialize_from_bytesobj(&self, bo: BytesObject) -> Result { + let expected_size = FP2_SERIALIZED_SIZE; + self.visit_obj(bo, |bytes: &ScBytes| { + if bytes.len() != expected_size { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "bls12-381 quadradic extention field element (Fp2): invalid input length to deserialize", + &[ + Val::from_u32(bytes.len() as u32).into(), + Val::from_u32(expected_size as u32).into(), + ], + )); + } + // `CanonicalDeserialize for QuadExtField

` reads the first chunk, + // deserialize it into `Fp` as c0. Then repeat for c1. The + // deserialization for `Fp` follows same rules as above, where the + // bytes are expected in little-endian, with the highest bits being + // empty flags. There is no check involved. + // + // This is entirely reversed from the [zcash standard](https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) + // the one we have adopted. This is the input format we provide: + // + // `input = be_bytes(c1) || be_bytes(c0)` + // + // So we just need to reverse our input. + let mut buf = [0u8; FP2_SERIALIZED_SIZE]; + buf.copy_from_slice(&bytes); + buf.reverse(); + self.deserialize_uncompessed_no_validate(&buf, 2, "Fp2") + }) + } + + pub(crate) fn g1_vec_from_vecobj(&self, vp: VecObject) -> Result, HostError> { + let len: u32 = self.vec_len(vp)?.into(); + let mut points: Vec = vec![]; + self.charge_budget( + ContractCostType::MemAlloc, + Some(len as u64 * G1_SERIALIZED_SIZE as u64), + )?; + points.reserve(len as usize); + let _ = self.visit_obj(vp, |vp: &HostVec| { + for p in vp.iter() { + let pp = + self.g1_affine_deserialize_from_bytesobj(BytesObject::try_from_val(self, p)?)?; + points.push(pp); + } + Ok(()) + }); + Ok(points) + } + + pub(crate) fn scalar_vec_from_vecobj(&self, vs: VecObject) -> Result, HostError> { + let len: u32 = self.vec_len(vs)?.into(); + let mut scalars: Vec = vec![]; + self.charge_budget( + ContractCostType::MemAlloc, + Some(len as u64 * FR_SERIALIZED_SIZE as u64), + )?; + scalars.reserve(len as usize); + let _ = self.visit_obj(vs, |vs: &HostVec| { + for s in vs.iter() { + let ss = self.fr_from_u256val(U256Val::try_from_val(self, s)?)?; + scalars.push(ss); + } + Ok(()) + }); + Ok(scalars) + } + + pub(crate) fn g1_add_internal( + &self, + p0: G1Affine, + p1: G1Affine, + ) -> Result { + self.charge_budget(ContractCostType::Bls12381G1Add, None)?; + Ok(p0.add(p1)) + } + + pub(crate) fn g1_mul_internal( + &self, + p0: G1Affine, + scalar: Fr, + ) -> Result { + self.charge_budget(ContractCostType::Bls12381G1Mul, None)?; + Ok(p0.mul(scalar)) + } + + pub(crate) fn g1_msm_internal( + &self, + points: &[G1Affine], + scalars: &[Fr], + ) -> Result { + // this check should've been done outside, here is just extra caution + if points.len() != scalars.len() || points.len() == 0 { + return Err( + Error::from_type_and_code(ScErrorType::Crypto, ScErrorCode::InvalidInput).into(), + ); + } + // The actual logic happens inside msm_bigint_wnaf (ark_ec/variable_base/mod.rs) + // under branch negation is cheap. + // the unchecked version just skips the length equal check + self.charge_budget(ContractCostType::Bls12381G1Msm, Some(points.len() as u64))?; + Ok(G1Projective::msm_unchecked(points, scalars)) + } + + pub(crate) fn map_fp_to_g1_internal(&self, fp: Fq) -> Result { + self.charge_budget(ContractCostType::Bls12381MapFpToG1, None)?; + let mapper = WBMap::::new().map_err(|e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("hash-to-curve error {e}").as_str(), + &[], + ) + })?; + mapper.map_to_curve(fp).map_err(|e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("hash-to-curve error {e}").as_str(), + &[], + ) + }) + } + + pub(crate) fn hash_to_g1_internal( + &self, + domain: &[u8], + msg: &[u8], + ) -> Result { + self.charge_budget(ContractCostType::Bls12381HashToG1, Some(msg.len() as u64))?; + let g1_mapper = MapToCurveBasedHasher::< + Projective, + DefaultFieldHasher, + WBMap, + >::new(domain) + .map_err(|e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("hash-to-curve error {e}").as_str(), + &[], + ) + })?; + g1_mapper.hash(msg.as_ref()).map_err(|e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("hash-to-curve error {e}").as_str(), + &[], + ) + }) + } + + pub(crate) fn g2_vec_from_vecobj(&self, vp: VecObject) -> Result, HostError> { + let len: u32 = self.vec_len(vp)?.into(); + self.charge_budget( + ContractCostType::MemAlloc, + Some(len as u64 * G2_SERIALIZED_SIZE as u64), + )?; + let mut points: Vec = Vec::with_capacity(len as usize); + let _ = self.visit_obj(vp, |vp: &HostVec| { + for p in vp.iter() { + let pp = + self.g2_affine_deserialize_from_bytesobj(BytesObject::try_from_val(self, p)?)?; + points.push(pp); + } + Ok(()) + }); + Ok(points) + } + + pub(crate) fn g2_add_internal( + &self, + p0: G2Affine, + p1: G2Affine, + ) -> Result { + self.charge_budget(ContractCostType::Bls12381G2Add, None)?; + Ok(p0.add(p1)) + } + + pub(crate) fn g2_mul_internal( + &self, + p0: G2Affine, + scalar: Fr, + ) -> Result { + self.charge_budget(ContractCostType::Bls12381G2Mul, None)?; + Ok(p0.mul(scalar)) + } + + pub(crate) fn g2_msm_internal( + &self, + points: &[G2Affine], + scalars: &[Fr], + ) -> Result { + // this check should've been done outside, here is just extra caution + if points.len() != scalars.len() || points.len() == 0 { + return Err( + Error::from_type_and_code(ScErrorType::Crypto, ScErrorCode::InvalidInput).into(), + ); + } + // The actual logic happens inside msm_bigint_wnaf (ark_ec/variable_base/mod.rs) + // under branch negation is cheap. + // the unchecked version just skips the length equal check + self.charge_budget(ContractCostType::Bls12381G2Msm, Some(points.len() as u64))?; + Ok(G2Projective::msm_unchecked(points, scalars)) + } + + pub(crate) fn map_fp2_to_g2_internal(&self, fp: Fq2) -> Result { + self.charge_budget(ContractCostType::Bls12381MapFp2ToG2, None)?; + let mapper = WBMap::::new().map_err(|e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("hash-to-curve error {e}").as_str(), + &[], + ) + })?; + mapper.map_to_curve(fp).map_err(|e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("hash-to-curve error {e}").as_str(), + &[], + ) + }) + } + + pub(crate) fn hash_to_g2_internal( + &self, + domain: &[u8], + msg: &[u8], + ) -> Result { + self.charge_budget(ContractCostType::Bls12381HashToG2, Some(msg.len() as u64))?; + let mapper = MapToCurveBasedHasher::< + Projective, + DefaultFieldHasher, + WBMap, + >::new(domain) + .map_err(|e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("hash-to-curve error {e}").as_str(), + &[], + ) + })?; + mapper.hash(msg.as_ref()).map_err(|e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("hash-to-curve error {e}").as_str(), + &[], + ) + }) + } + + pub(crate) fn pairing_internal( + &self, + vp1: &Vec, + vp2: &Vec, + ) -> Result, HostError> { + // this check should've been done outside, here is just extra caution + if vp1.len() != vp2.len() || vp1.len() == 0 { + return Err( + Error::from_type_and_code(ScErrorType::Crypto, ScErrorCode::InvalidInput).into(), + ); + } + self.charge_budget(ContractCostType::Bls12381Pairing, Some(vp1.len() as u64))?; + // This is doing exact same as `Bls12_381::pairing(p, q)`, but avoids + // the `unwrap` + let mlo = Bls12_381::multi_miller_loop(vp1, vp2); + Bls12_381::final_exponentiation(mlo).ok_or_else(|| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + "fail to perform final exponentiation", + &[], + ) + }) + } + + pub(crate) fn check_pairing_output( + &self, + output: &PairingOutput, + ) -> Result { + self.charge_budget(ContractCostType::MemCmp, Some(576))?; + match output.0.cmp(&Fq12::ONE) { + Ordering::Equal => Ok(true.into()), + _ => Ok(false.into()), + } + } + + pub(crate) fn fr_add_internal(&self, lhs: &mut Fr, rhs: &Fr) -> Result<(), HostError> { + self.charge_budget(ContractCostType::Bls12381FrAddSub, None)?; + lhs.add_assign(rhs); + Ok(()) + } + + pub(crate) fn fr_sub_internal(&self, lhs: &mut Fr, rhs: &Fr) -> Result<(), HostError> { + self.charge_budget(ContractCostType::Bls12381FrAddSub, None)?; + lhs.sub_assign(rhs); + Ok(()) + } + + pub(crate) fn fr_mul_internal(&self, lhs: &mut Fr, rhs: &Fr) -> Result<(), HostError> { + self.charge_budget(ContractCostType::Bls12381FrMul, None)?; + lhs.mul_assign(rhs); + Ok(()) + } + + pub(crate) fn fr_pow_internal(&self, lhs: &Fr, rhs: &u64) -> Result { + self.charge_budget( + ContractCostType::Bls12381FrPow, + Some(64 - rhs.leading_zeros() as u64), + )?; + Ok(lhs.pow(&[*rhs])) + } + + pub(crate) fn fr_inv_internal(&self, lhs: &Fr) -> Result { + if lhs.is_zero() { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "scalar inversion input is zero", + &[], + )); + } + self.charge_budget(ContractCostType::Bls12381FrInv, None)?; + lhs.inverse().ok_or_else(|| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("scalar inversion {lhs} failed").as_str(), + &[], + ) + }) + } +} diff --git a/soroban-env-host/src/host.rs b/soroban-env-host/src/host.rs index a4a4b6548..7c8ec067a 100644 --- a/soroban-env-host/src/host.rs +++ b/soroban-env-host/src/host.rs @@ -6,8 +6,8 @@ use crate::{ budget::{AsBudget, Budget}, events::{diagnostic::DiagnosticLevel, Events, InternalEventsBuffer}, host_object::{HostMap, HostObject, HostVec}, - impl_bignum_host_fns, impl_bignum_host_fns_rhs_u32, impl_wrapping_obj_from_num, - impl_wrapping_obj_to_num, + impl_bignum_host_fns, impl_bignum_host_fns_rhs_u32, impl_bls12_381_fr_arith_host_fns, + impl_wrapping_obj_from_num, impl_wrapping_obj_to_num, num::*, storage::Storage, vm::ModuleCache, @@ -18,8 +18,8 @@ use crate::{ ScSymbol, ScVal, TimePoint, Uint256, }, AddressObject, Bool, BytesObject, Compare, ConversionError, EnvBase, Error, LedgerInfo, - MapObject, Object, StorageType, StringObject, Symbol, SymbolObject, TryFromVal, Val, VecObject, - VmCaller, VmCallerEnv, Void, + MapObject, Object, StorageType, StringObject, Symbol, SymbolObject, SymbolSmall, TryFromVal, + TryIntoVal, Val, VecObject, VmCaller, VmCallerEnv, Void, }; mod comparison; @@ -60,7 +60,6 @@ pub use frame::ContractFunctionSet; pub(crate) use frame::Frame; #[cfg(any(test, feature = "recording_mode"))] use rand_chacha::ChaCha20Rng; -use soroban_env_common::SymbolSmall; #[cfg(any(test, feature = "testutils"))] #[derive(Clone, Copy)] @@ -2917,124 +2916,216 @@ impl VmCallerEnv for Host { Ok(res.into()) } - fn bls_g1_add( + fn bls12_381_g1_add( &self, _vmcaller: &mut VmCaller, p0: BytesObject, p1: BytesObject, ) -> Result { - let p0_bytes = self.visit_obj(p0, |bytes: &ScBytes| { - bytes.as_slice().try_into().map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "invalid length for G1 point", - &[], - ) - }) - })?; - let p1_bytes = self.visit_obj(p1, |bytes: &ScBytes| { - bytes.as_slice().try_into().map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "invalid length for G1 point", - &[], - ) - }) - })?; - let result = self.bls_g1_add_raw_internal(&p0_bytes, &p1_bytes)?; - self.add_host_object(self.scbytes_from_vec(result.to_vec())?) + let p0 = self.g1_affine_deserialize_from_bytesobj(p0)?; + let p1 = self.g1_affine_deserialize_from_bytesobj(p1)?; + let res = self.g1_add_internal(p0, p1)?; + self.g1_projective_serialize_uncompressed(res) } - fn bls_g1_mul( + fn bls12_381_g1_mul( &self, _vmcaller: &mut VmCaller, - scalar: BytesObject, - p1: BytesObject, + p0: BytesObject, + scalar: U256Val, ) -> Result { - let scalar_bytes = self.visit_obj(scalar, |bytes: &ScBytes| { - bytes.as_slice().try_into().map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "scalar value out of range for G1 multiplication", - &[], - ) - }) - })?; - let p1_bytes = self.visit_obj(p1, |bytes: &ScBytes| { - bytes.as_slice().try_into().map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "invalid length for G1 point", - &[], - ) + let p0 = self.g1_affine_deserialize_from_bytesobj(p0)?; + let scalar = self.fr_from_u256val(scalar)?; + let res = self.g1_mul_internal(p0, scalar)?; + self.g1_projective_serialize_uncompressed(res) + } + + fn bls12_381_g1_msm( + &self, + vmcaller: &mut VmCaller, + vp: VecObject, + vs: VecObject, + ) -> Result { + let p_len = self.vec_len(vmcaller, vp)?; + let s_len = self.vec_len(vmcaller, vs)?; + if u32::from(p_len) != u32::from(s_len) || u32::from(p_len) == 0 { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "g1_msm: invalid input vector lengths", + &[p_len.to_val(), s_len.to_val()], + )); + } + let points = self.g1_vec_from_vecobj(vp)?; + let scalars = self.scalar_vec_from_vecobj(vs)?; + let res = self.g1_msm_internal(&points, &scalars)?; + self.g1_projective_serialize_uncompressed(res) + } + + fn bls12_381_map_fp_to_g1( + &self, + _vmcaller: &mut VmCaller, + fp: BytesObject, + ) -> Result { + let fp = self.fp_deserialize_from_bytesobj(fp)?; + let g1 = self.map_fp_to_g1_internal(fp)?; + self.g1_affine_serialize_uncompressed(g1) + } + + fn bls12_381_hash_to_g1( + &self, + _vmcaller: &mut VmCaller, + mo: BytesObject, + dst: BytesObject, + ) -> Result { + let g1 = self.visit_obj(mo, |msg: &ScBytes| { + self.visit_obj(dst, |dst: &ScBytes| { + let dst_len = dst.len(); + if dst_len == 0 || dst_len > 255 { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!( + "hash_to_g1: invalid input dst length {dst_len}, must be > 0 and < 256" + ) + .as_str(), + &[], + )); + } + self.hash_to_g1_internal(dst.as_slice(), msg.as_slice()) }) })?; - let result = self.bls_g1_mul_raw_internal(scalar_bytes, &p1_bytes)?; - self.add_host_object(self.scbytes_from_vec(result.to_vec())?) + self.g1_affine_serialize_uncompressed(g1) } - fn bls_g2_add( + fn bls12_381_g2_add( &self, _vmcaller: &mut VmCaller, p0: BytesObject, p1: BytesObject, ) -> Result { - let p0_bytes = self.visit_obj(p0, |bytes: &ScBytes| { - bytes.as_slice().try_into().map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "invalid length for G2 point", - &[], - ) - }) - })?; - let p1_bytes = self.visit_obj(p1, |bytes: &ScBytes| { - bytes.as_slice().try_into().map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "invalid length for G2 point", - &[], - ) - }) - })?; - let result = self.bls_g2_add_raw_internal(&p0_bytes, &p1_bytes)?; - self.add_host_object(self.scbytes_from_vec(result.to_vec())?) + let p0 = self.g2_affine_deserialize_from_bytesobj(p0)?; + let p1 = self.g2_affine_deserialize_from_bytesobj(p1)?; + let res = self.g2_add_internal(p0, p1)?; + self.g2_projective_serialize_uncompressed(res) } - fn bls_g2_mul( + fn bls12_381_g2_mul( &self, _vmcaller: &mut VmCaller, - scalar: BytesObject, - p1: BytesObject, + p0: BytesObject, + scalar_le_bytes: U256Val, ) -> Result { - let scalar_bytes = self.visit_obj(scalar, |bytes: &ScBytes| { - bytes.as_slice().try_into().map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "scalar value out of range for G2 multiplication", - &[], - ) - }) - })?; - let p1_bytes = self.visit_obj(p1, |bytes: &ScBytes| { - bytes.as_slice().try_into().map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "invalid length for G2 point", - &[], - ) + let p0 = self.g2_affine_deserialize_from_bytesobj(p0)?; + let scalar = self.fr_from_u256val(scalar_le_bytes)?; + let res = self.g2_mul_internal(p0, scalar)?; + self.g2_projective_serialize_uncompressed(res) + } + + fn bls12_381_g2_msm( + &self, + vmcaller: &mut VmCaller, + vp: VecObject, + vs: VecObject, + ) -> Result { + let p_len = self.vec_len(vmcaller, vp)?; + let s_len = self.vec_len(vmcaller, vs)?; + if u32::from(p_len) != u32::from(s_len) || u32::from(p_len) == 0 { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "g2_msm: invalid input vector lengths", + &[p_len.to_val(), s_len.to_val()], + )); + } + let points = self.g2_vec_from_vecobj(vp)?; + let scalars = self.scalar_vec_from_vecobj(vs)?; + let res = self.g2_msm_internal(&points, &scalars)?; + self.g2_projective_serialize_uncompressed(res) + } + + fn bls12_381_map_fp2_to_g2( + &self, + _vmcaller: &mut VmCaller, + fp2: BytesObject, + ) -> Result { + let fp2 = self.fp2_deserialize_from_bytesobj(fp2)?; + let g2 = self.map_fp2_to_g2_internal(fp2)?; + self.g2_affine_serialize_uncompressed(g2) + } + + fn bls12_381_hash_to_g2( + &self, + _vmcaller: &mut VmCaller, + msg: BytesObject, + dst: BytesObject, + ) -> Result { + let g2 = self.visit_obj(msg, |msg: &ScBytes| { + self.visit_obj(dst, |dst: &ScBytes| { + let dst_len = dst.len(); + if dst_len == 0 || dst_len > 255 { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!( + "hash_to_g2: invalid input dst length {dst_len}, must be > 0 and < 256" + ) + .as_str(), + &[], + )); + } + self.hash_to_g2_internal(dst.as_slice(), msg.as_slice()) }) })?; - let result = self.bls_g2_mul_raw_internal(scalar_bytes, &p1_bytes)?; - self.add_host_object(self.scbytes_from_vec(result.to_vec())?) + self.g2_affine_serialize_uncompressed(g2) + } + + fn bls12_381_multi_pairing_check( + &self, + vmcaller: &mut VmCaller, + vp1: VecObject, + vp2: VecObject, + ) -> Result { + let l1 = self.vec_len(vmcaller, vp1)?; + let l2 = self.vec_len(vmcaller, vp2)?; + if u32::from(l1) != u32::from(l2) || u32::from(l1) == 0 { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + "multi-pairing-check: invalid input vector lengths", + &[l1.to_val(), l2.to_val()], + )); + } + let vp1 = self.g1_vec_from_vecobj(vp1)?; + let vp2 = self.g2_vec_from_vecobj(vp2)?; + let output = self.pairing_internal(&vp1, &vp2)?; + self.check_pairing_output(&output) + } + + impl_bls12_381_fr_arith_host_fns!(bls12_381_fr_add, fr_add_internal); + impl_bls12_381_fr_arith_host_fns!(bls12_381_fr_sub, fr_sub_internal); + impl_bls12_381_fr_arith_host_fns!(bls12_381_fr_mul, fr_mul_internal); + + fn bls12_381_fr_pow( + &self, + _vmcaller: &mut VmCaller, + lhs: U256Val, + rhs: U64Val, + ) -> Result { + let lhs = self.fr_from_u256val(lhs)?; + let rhs = rhs.try_into_val(self)?; + let res = self.fr_pow_internal(&lhs, &rhs)?; + self.fr_to_u256val(res) + } + + fn bls12_381_fr_inv( + &self, + _vmcaller: &mut VmCaller, + lhs: U256Val, + ) -> Result { + let lhs = self.fr_from_u256val(lhs)?; + let res = self.fr_inv_internal(&lhs)?; + self.fr_to_u256val(res) } // endregion: "crypto" module functions diff --git a/soroban-env-host/src/host/num.rs b/soroban-env-host/src/host/num.rs index fca891027..b66611e03 100644 --- a/soroban-env-host/src/host/num.rs +++ b/soroban-env-host/src/host/num.rs @@ -66,3 +66,20 @@ macro_rules! impl_bignum_host_fns_rhs_u32 { } }; } + +#[macro_export] +macro_rules! impl_bls12_381_fr_arith_host_fns { + ($host_fn: ident, $method: ident) => { + fn $host_fn( + &self, + _vmcaller: &mut VmCaller, + lhs: U256Val, + rhs: U256Val, + ) -> Result { + let mut lhs = self.fr_from_u256val(lhs)?; + let rhs = self.fr_from_u256val(rhs)?; + self.$method(&mut lhs, &rhs)?; + self.fr_to_u256val(lhs) + } + }; +} diff --git a/soroban-env-host/src/test/budget_metering.rs b/soroban-env-host/src/test/budget_metering.rs index dd15e7708..e9cc201ed 100644 --- a/soroban-env-host/src/test/budget_metering.rs +++ b/soroban-env-host/src/test/budget_metering.rs @@ -396,6 +396,32 @@ fn total_amount_charged_from_random_inputs() -> Result<(), HostError> { (1, None), /* VerifyEcdsaSecp256r1Sig */ ]); + tracker.extend_from_slice(&[ + (1, None), /* Bls12381EncodeFp */ + (1, None), /* Bls12381DecodeFp */ + (1, None), /* Bls12381G1Validate */ + (1, None), /* Bls12381G2Validate */ + (1, None), /* Bls12381G1ProjectiveToAffine */ + (1, None), /* Bls12381G2ProjectiveToAffine */ + (1, None), /* Bls12381G1Add */ + (1, None), /* Bls12381G1Mul */ + (1, Some(1)), /* Bls12381G1Msm */ + (1, None), /* Bls12381MapFpToG1 */ + (1, Some(1)), /* Bls12381HashToG1 */ + (1, None), /* Bls12381G2Add */ + (1, None), /* Bls12381G2Mul */ + (1, Some(1)), /* Bls12381G2Msm */ + (1, None), /* Bls12381MapFp2ToG2 */ + (1, Some(1)), /* Bls12381HashToG2 */ + (1, Some(1)), /* Bls12381Pairing */ + (1, None), /* Bls12381FrFromU256 */ + (1, None), /* Bls12381FrToU256 */ + (1, None), /* Bls12381FrAddSub */ + (1, None), /* Bls12381FrMul */ + (1, Some(1)), /* Bls12381FrPow */ + (1, None), /* Bls12381FrInv */ + ]); + for (ty, &(iterations, input)) in tracker.iter().enumerate() { host.with_budget(|b| b.bulk_charge(ContractCostType::VARIANTS[ty], iterations, input))?; } @@ -409,62 +435,85 @@ fn total_amount_charged_from_random_inputs() -> Result<(), HostError> { let actual = format!("{:?}", host.as_budget()); let expected = expect![[r#" - =============================================================================================================================================================================== - Cpu limit: 100000000; used: 15313119 - Mem limit: 41943040; used: 298417 - =============================================================================================================================================================================== - CostType iterations input cpu_insns mem_bytes const_term_cpu lin_term_cpu const_term_mem lin_term_mem - WasmInsnExec 246 None 984 0 4 0 0 0 - MemAlloc 1 Some(152) 453 168 434 16 16 128 - MemCpy 1 Some(65) 50 0 42 16 0 0 - MemCmp 1 Some(74) 53 0 44 16 0 0 - DispatchHostFunction 176 None 54560 0 310 0 0 0 - VisitObject 97 None 5917 0 61 0 0 0 - ValSer 1 Some(49) 241 389 230 29 242 384 - ValDeser 1 Some(103) 62271 309 59052 4001 0 384 - ComputeSha256Hash 1 Some(193) 14310 0 3738 7012 0 0 - ComputeEd25519PubKey 226 None 9097178 0 40253 0 0 0 - VerifyEd25519Sig 1 Some(227) 384738 0 377524 4068 0 0 - VmInstantiation 1 Some(147) 97310 135880 31271 57504 130065 5064 - VmCachedInstantiation 1 Some(147) 41608 71169 40828 680 69472 1478 - InvokeVmFunction 47 None 101003 705 2149 0 15 0 - ComputeKeccak256Hash 1 Some(1) 3812 0 3766 5969 0 0 - DecodeEcdsaCurve256Sig 1 None 710 0 710 0 0 0 - RecoverEcdsaSecp256k1Key 1 None 2315295 181 2315295 0 181 0 - Int256AddSub 1 None 4404 99 4404 0 99 0 - Int256Mul 1 None 4947 99 4947 0 99 0 - Int256Div 1 None 4911 99 4911 0 99 0 - Int256Pow 1 None 4286 99 4286 0 99 0 - Int256Shift 1 None 913 99 913 0 99 0 - ChaCha20DrawBytes 1 Some(1) 1061 0 1058 501 0 0 - ParseWasmInstructions 1 Some(1) 37421 13981 37421 32 13980 215 - ParseWasmFunctions 1 Some(1) 657 180 0 84156 0 23056 - ParseWasmGlobals 1 Some(1) 1276 93 0 163415 0 11924 - ParseWasmTableEntries 1 Some(1) 231 47 0 29644 0 6121 - ParseWasmTypes 1 Some(1) 6977 387 0 893113 0 49554 - ParseWasmDataSegments 1 Some(1) 1444 43 0 184921 0 5525 - ParseWasmElemSegments 1 Some(1) 2440 367 0 312369 0 47034 - ParseWasmImports 1 Some(1) 4134 795 0 529255 0 101762 - ParseWasmExports 1 Some(1) 2825 277 0 361665 0 35491 - ParseWasmDataSegmentBytes 1 Some(1) 0 1 0 14 0 129 - InstantiateWasmInstructions 1 None 43208 70792 43208 0 70792 0 - InstantiateWasmFunctions 1 Some(1) 62 138 0 8050 0 17749 - InstantiateWasmGlobals 1 Some(1) 83 53 0 10647 0 6833 - InstantiateWasmTableEntries 1 Some(1) 15 8 0 1933 0 1025 - InstantiateWasmTypes 1 None 0 0 0 0 0 0 - InstantiateWasmDataSegments 1 Some(1) 134 1012 0 17164 0 129632 - InstantiateWasmElemSegments 1 Some(1) 267 106 0 34261 0 13665 - InstantiateWasmImports 1 Some(1) 5829 770 0 746142 0 98578 - InstantiateWasmExports 1 Some(1) 2313 71 0 296177 0 9176 - InstantiateWasmDataSegmentBytes 1 Some(1) 0 0 0 14 0 126 - Sec1DecodePointUncompressed 1 None 1882 0 1882 0 0 0 - VerifyEcdsaSecp256r1Sig 1 None 3000906 0 3000906 0 0 0 - =============================================================================================================================================================================== - Internal details (diagnostics info, does not affect fees) - Total # times meter was called: 45 - Shadow cpu limit: 100000000; used: 15313119 - Shadow mem limit: 41943040; used: 298417 - =============================================================================================================================================================================== + =============================================================================================================================================================================== + Cpu limit: 100000000; used: 71071093 + Mem limit: 41943040; used: 733666 + =============================================================================================================================================================================== + CostType iterations input cpu_insns mem_bytes const_term_cpu lin_term_cpu const_term_mem lin_term_mem + WasmInsnExec 246 None 984 0 4 0 0 0 + MemAlloc 1 Some(152) 453 168 434 16 16 128 + MemCpy 1 Some(65) 50 0 42 16 0 0 + MemCmp 1 Some(74) 53 0 44 16 0 0 + DispatchHostFunction 176 None 54560 0 310 0 0 0 + VisitObject 97 None 5917 0 61 0 0 0 + ValSer 1 Some(49) 241 389 230 29 242 384 + ValDeser 1 Some(103) 62271 309 59052 4001 0 384 + ComputeSha256Hash 1 Some(193) 14310 0 3738 7012 0 0 + ComputeEd25519PubKey 226 None 9097178 0 40253 0 0 0 + VerifyEd25519Sig 1 Some(227) 384738 0 377524 4068 0 0 + VmInstantiation 1 Some(147) 97310 135880 31271 57504 130065 5064 + VmCachedInstantiation 1 Some(147) 41608 71169 40828 680 69472 1478 + InvokeVmFunction 47 None 101003 705 2149 0 15 0 + ComputeKeccak256Hash 1 Some(1) 3812 0 3766 5969 0 0 + DecodeEcdsaCurve256Sig 1 None 710 0 710 0 0 0 + RecoverEcdsaSecp256k1Key 1 None 2315295 181 2315295 0 181 0 + Int256AddSub 1 None 4404 99 4404 0 99 0 + Int256Mul 1 None 4947 99 4947 0 99 0 + Int256Div 1 None 4911 99 4911 0 99 0 + Int256Pow 1 None 4286 99 4286 0 99 0 + Int256Shift 1 None 913 99 913 0 99 0 + ChaCha20DrawBytes 1 Some(1) 1061 0 1058 501 0 0 + ParseWasmInstructions 1 Some(1) 37421 13981 37421 32 13980 215 + ParseWasmFunctions 1 Some(1) 657 180 0 84156 0 23056 + ParseWasmGlobals 1 Some(1) 1276 93 0 163415 0 11924 + ParseWasmTableEntries 1 Some(1) 231 47 0 29644 0 6121 + ParseWasmTypes 1 Some(1) 6977 387 0 893113 0 49554 + ParseWasmDataSegments 1 Some(1) 1444 43 0 184921 0 5525 + ParseWasmElemSegments 1 Some(1) 2440 367 0 312369 0 47034 + ParseWasmImports 1 Some(1) 4134 795 0 529255 0 101762 + ParseWasmExports 1 Some(1) 2825 277 0 361665 0 35491 + ParseWasmDataSegmentBytes 1 Some(1) 0 1 0 14 0 129 + InstantiateWasmInstructions 1 None 43208 70792 43208 0 70792 0 + InstantiateWasmFunctions 1 Some(1) 62 138 0 8050 0 17749 + InstantiateWasmGlobals 1 Some(1) 83 53 0 10647 0 6833 + InstantiateWasmTableEntries 1 Some(1) 15 8 0 1933 0 1025 + InstantiateWasmTypes 1 None 0 0 0 0 0 0 + InstantiateWasmDataSegments 1 Some(1) 134 1012 0 17164 0 129632 + InstantiateWasmElemSegments 1 Some(1) 267 106 0 34261 0 13665 + InstantiateWasmImports 1 Some(1) 5829 770 0 746142 0 98578 + InstantiateWasmExports 1 Some(1) 2313 71 0 296177 0 9176 + InstantiateWasmDataSegmentBytes 1 Some(1) 0 0 0 14 0 126 + Sec1DecodePointUncompressed 1 None 1882 0 1882 0 0 0 + VerifyEcdsaSecp256r1Sig 1 None 3000906 0 3000906 0 0 0 + Bls12381EncodeFp 1 None 661 0 661 0 0 0 + Bls12381DecodeFp 1 None 985 0 985 0 0 0 + Bls12381G1Validate 1 None 732301 0 732301 0 0 0 + Bls12381G2Validate 1 None 1063432 0 1063432 0 0 0 + Bls12381G1ProjectiveToAffine 1 None 92642 0 92642 0 0 0 + Bls12381G2ProjectiveToAffine 1 None 100742 0 100742 0 0 0 + Bls12381G1Add 1 None 7689 0 7689 0 0 0 + Bls12381G1Mul 1 None 2458985 0 2458985 0 0 0 + Bls12381G1Msm 1 Some(1) 3179828 112264 2426722 96397671 109494 354667 + Bls12381MapFpToG1 1 None 1541554 5552 1541554 0 5552 0 + Bls12381HashToG1 1 Some(1) 3211243 9424 3211191 6713 9424 0 + Bls12381G2Add 1 None 25207 0 25207 0 0 0 + Bls12381G2Mul 1 None 7873219 0 7873219 0 0 0 + Bls12381G2Msm 1 Some(1) 10455244 222424 8035968 309667335 219654 354667 + Bls12381MapFp2ToG2 1 None 2420202 3344 2420202 0 3344 0 + Bls12381HashToG2 1 Some(1) 7050617 6816 7050564 6797 6816 0 + Bls12381Pairing 1 Some(1) 15503174 75176 10558948 632860943 2204 9340474 + Bls12381FrFromU256 1 None 1994 0 1994 0 0 0 + Bls12381FrToU256 1 None 1155 248 1155 0 248 0 + Bls12381FrAddSub 1 None 74 0 74 0 0 0 + Bls12381FrMul 1 None 332 0 332 0 0 0 + Bls12381FrPow 1 Some(1) 1273 1 691 74558 0 128 + Bls12381FrInv 1 None 35421 0 35421 0 0 0 + =============================================================================================================================================================================== + Internal details (diagnostics info, does not affect fees) + Total # times meter was called: 68 + Shadow cpu limit: 100000000; used: 71071093 + Shadow mem limit: 41943040; used: 733666 + =============================================================================================================================================================================== "#]]; expected.assert_eq(&actual); diff --git a/soroban-env-host/src/test/hostile.rs b/soroban-env-host/src/test/hostile.rs index a7d7081eb..e5746a774 100644 --- a/soroban-env-host/src/test/hostile.rs +++ b/soroban-env-host/src/test/hostile.rs @@ -575,6 +575,29 @@ fn excessive_logging() -> Result<(), HostError> { InstantiateWasmDataSegmentBytes 0 0 Sec1DecodePointUncompressed 0 0 VerifyEcdsaSecp256r1Sig 0 0 + Bls12381EncodeFp 0 0 + Bls12381DecodeFp 0 0 + Bls12381G1Validate 0 0 + Bls12381G2Validate 0 0 + Bls12381G1ProjectiveToAffine 0 0 + Bls12381G2ProjectiveToAffine 0 0 + Bls12381G1Add 0 0 + Bls12381G1Mul 0 0 + Bls12381G1Msm 0 0 + Bls12381MapFpToG1 0 0 + Bls12381HashToG1 0 0 + Bls12381G2Add 0 0 + Bls12381G2Mul 0 0 + Bls12381G2Msm 0 0 + Bls12381MapFp2ToG2 0 0 + Bls12381HashToG2 0 0 + Bls12381Pairing 0 0 + Bls12381FrFromU256 0 0 + Bls12381FrToU256 0 0 + Bls12381FrAddSub 0 0 + Bls12381FrMul 0 0 + Bls12381FrPow 0 0 + Bls12381FrInv 0 0 ================================================================= "#]]; diff --git a/soroban-env-macros/Cargo.toml b/soroban-env-macros/Cargo.toml index 3ebabc2c2..d4ad528d1 100644 --- a/soroban-env-macros/Cargo.toml +++ b/soroban-env-macros/Cargo.toml @@ -17,7 +17,7 @@ stellar-xdr = { workspace = true, features = ["curr", "std"] } syn = {version="2.0.39",features=["full"]} quote = "1.0.33" proc-macro2 = "1.0.69" -itertools = "0.11.0" +itertools = "0.10.5" serde = { version = "1.0.192", features = ["derive"] } serde_json = "1.0.108" From 5cb5e880ac8e1e972da7fa8c0ca7d9b4444f3405 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Fri, 6 Sep 2024 12:34:04 -0400 Subject: [PATCH 04/18] Setup calibration for new and experimental cost types --- .../benches/common/cost_types/bls12_381.rs | 312 ++++++++++++++++ .../benches/common/cost_types/mod.rs | 2 + .../benches/common/experimental/bls12_381.rs | 61 +++ .../benches/common/experimental/mod.rs | 2 + soroban-env-host/benches/common/measure.rs | 33 +- soroban-env-host/benches/common/mod.rs | 32 ++ .../benches/variation_histograms.rs | 2 +- .../src/cost_runner/cost_types/bls12_381.rs | 353 ++++++++++++++++++ .../src/cost_runner/cost_types/mod.rs | 2 + .../src/cost_runner/experimental/bls12_381.rs | 137 +++++++ .../experimental/decode_secp256r1_sig.rs | 2 +- .../experimental/ecdsa_secp256k1_verify.rs | 2 +- .../experimental/ecdsa_secp256r1_recover.rs | 2 +- .../experimental/ed25519_scalar_mut.rs | 2 +- .../src/cost_runner/experimental/mod.rs | 22 ++ .../src/cost_runner/experimental/read_xdr.rs | 2 +- .../sec1_decode_point_compressed.rs | 2 +- soroban-env-host/src/cost_runner/runner.rs | 2 +- soroban-env-host/src/cost_runner/util.rs | 99 +++++ 19 files changed, 1053 insertions(+), 18 deletions(-) create mode 100644 soroban-env-host/benches/common/cost_types/bls12_381.rs create mode 100644 soroban-env-host/benches/common/experimental/bls12_381.rs create mode 100644 soroban-env-host/src/cost_runner/cost_types/bls12_381.rs create mode 100644 soroban-env-host/src/cost_runner/experimental/bls12_381.rs diff --git a/soroban-env-host/benches/common/cost_types/bls12_381.rs b/soroban-env-host/benches/common/cost_types/bls12_381.rs new file mode 100644 index 000000000..b2b818df3 --- /dev/null +++ b/soroban-env-host/benches/common/cost_types/bls12_381.rs @@ -0,0 +1,312 @@ +use crate::common::HostCostMeasurement; +use ark_bls12_381::{Fq, Fq2, Fr, G1Affine, G1Projective, G2Affine, G2Projective}; +use ark_ff::UniformRand; +use ark_serialize::CanonicalSerialize; +use rand::{rngs::StdRng, Rng, RngCore}; +use soroban_env_host::{ + cost_runner::{ + Bls12381DecodeFpRun, Bls12381DecodeFpSample, Bls12381EncodeFpRun, Bls12381EncodeFpSample, + Bls12381FrAddRun, Bls12381FrAddSubMulSample, Bls12381FrFromU256Run, + Bls12381FrFromU256Sample, Bls12381FrInvRun, Bls12381FrInvSample, Bls12381FrMulRun, + Bls12381FrPowRun, Bls12381FrPowSample, Bls12381FrSubRun, Bls12381FrToU256Run, + Bls12381FrToU256Sample, Bls12381G1AddRun, Bls12381G1AddSample, Bls12381G1MsmRun, + Bls12381G1MsmSample, Bls12381G1MulRun, Bls12381G1MulSample, + Bls12381G1ProjectiveToAffineRun, Bls12381G1ProjectiveToAffineSample, Bls12381G1ValidateRun, + Bls12381G1ValidateSample, Bls12381G2AddRun, Bls12381G2AddSample, Bls12381G2MsmRun, + Bls12381G2MsmSample, Bls12381G2MulRun, Bls12381G2MulSample, + Bls12381G2ProjectiveToAffineRun, Bls12381G2ProjectiveToAffineSample, Bls12381G2ValidateRun, + Bls12381G2ValidateSample, Bls12381HashToG1Run, Bls12381HashToG1Sample, Bls12381HashToG2Run, + Bls12381HashToG2Sample, Bls12381MapFp2ToG2Run, Bls12381MapFp2ToG2Sample, + Bls12381MapFpToG1Run, Bls12381MapFpToG1Sample, Bls12381PairingRun, Bls12381PairingSample, + }, + xdr::ContractCostType, + Host, TryIntoVal, U256Val, U256, +}; + +pub(crate) struct Bls12381EncodeFpMeasure; +impl HostCostMeasurement for Bls12381EncodeFpMeasure { + type Runner = Bls12381EncodeFpRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381EncodeFpSample { + let buf = vec![0; 1000]; + let fp = Fq::rand(rng); + Bls12381EncodeFpSample(buf, fp) + } +} +pub(crate) struct Bls12381DecodeFpMeasure; +impl HostCostMeasurement for Bls12381DecodeFpMeasure { + type Runner = Bls12381DecodeFpRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381DecodeFpSample { + let mut buf = vec![]; + let _ = Fq::rand(rng).serialize_uncompressed(&mut buf).unwrap(); + Bls12381DecodeFpSample(buf) + } +} +pub(crate) struct Bls12381G1ValidateMeasure; +impl HostCostMeasurement for Bls12381G1ValidateMeasure { + type Runner = Bls12381G1ValidateRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381G1ValidateSample { + Bls12381G1ValidateSample(G1Affine::rand(rng), ContractCostType::Bls12381G1Validate) + } +} +pub(crate) struct Bls12381G2ValidateMeasure; +impl HostCostMeasurement for Bls12381G2ValidateMeasure { + type Runner = Bls12381G2ValidateRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381G2ValidateSample { + Bls12381G2ValidateSample(G2Affine::rand(rng), ContractCostType::Bls12381G2Validate) + } +} +pub(crate) struct Bls12381FrFromU256Measure; +impl HostCostMeasurement for Bls12381FrFromU256Measure { + type Runner = Bls12381FrFromU256Run; + + fn new_random_case(host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381FrFromU256Sample { + let mut buf = [0; 32]; + rng.fill_bytes(&mut buf); + let u = U256::from_be_bytes(buf); + let val: U256Val = u.try_into_val(host).unwrap(); + Bls12381FrFromU256Sample(val) + } +} +pub(crate) struct Bls12381FrToU256Measure; +impl HostCostMeasurement for Bls12381FrToU256Measure { + type Runner = Bls12381FrToU256Run; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381FrToU256Sample { + Bls12381FrToU256Sample(Fr::rand(rng)) + } +} +pub(crate) struct Bls12381FrAddMeasure; +impl HostCostMeasurement for Bls12381FrAddMeasure { + type Runner = Bls12381FrAddRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381FrAddSubMulSample { + Bls12381FrAddSubMulSample(Fr::rand(rng), Fr::rand(rng)) + } +} +pub(crate) struct Bls12381FrSubMeasure; +impl HostCostMeasurement for Bls12381FrSubMeasure { + type Runner = Bls12381FrSubRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381FrAddSubMulSample { + Bls12381FrAddSubMulSample(Fr::rand(rng), Fr::rand(rng)) + } +} +pub(crate) struct Bls12381FrMulMeasure; +impl HostCostMeasurement for Bls12381FrMulMeasure { + type Runner = Bls12381FrMulRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381FrAddSubMulSample { + Bls12381FrAddSubMulSample(Fr::rand(rng), Fr::rand(rng)) + } +} +pub(crate) struct Bls12381FrPowMeasure; +impl HostCostMeasurement for Bls12381FrPowMeasure { + type Runner = Bls12381FrPowRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, input: u64) -> Bls12381FrPowSample { + assert!(input <= 64); + let rhs = if input == 64 { + u64::MAX + } else { + (1 << input) - 1 + }; + Bls12381FrPowSample(Fr::rand(rng), rhs) + } +} +pub(crate) struct Bls12381FrInvMeasure; +impl HostCostMeasurement for Bls12381FrInvMeasure { + type Runner = Bls12381FrInvRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381FrInvSample { + Bls12381FrInvSample(Fr::rand(rng)) + } +} + +pub(crate) struct Bls12381G1AddMeasure; + +impl HostCostMeasurement for Bls12381G1AddMeasure { + type Runner = Bls12381G1AddRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381G1AddSample { + let p0 = G1Affine::rand(rng); + let p1 = G1Affine::rand(rng); + Bls12381G1AddSample(p0, p1) + } +} + +pub(crate) struct Bls12381G1ProjectiveToAffineMeasure; + +impl HostCostMeasurement for Bls12381G1ProjectiveToAffineMeasure { + type Runner = Bls12381G1ProjectiveToAffineRun; + + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> Bls12381G1ProjectiveToAffineSample { + let p0 = G1Projective::rand(rng); + Bls12381G1ProjectiveToAffineSample(p0) + } +} + +pub(crate) struct Bls12381G1MulMeasure; + +impl HostCostMeasurement for Bls12381G1MulMeasure { + type Runner = Bls12381G1MulRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381G1MulSample { + let p = G1Affine::rand(rng); + let s = Fr::rand(rng); + Bls12381G1MulSample(p, s) + } +} + +pub(crate) struct Bls12381G1MsmMeasure; + +impl HostCostMeasurement for Bls12381G1MsmMeasure { + type Runner = Bls12381G1MsmRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, input: u64) -> Bls12381G1MsmSample { + Bls12381G1MsmSample( + (0..input) + .into_iter() + .map(|_| G1Affine::rand(rng)) + .collect(), + (0..input).into_iter().map(|_| Fr::rand(rng)).collect(), + ) + } +} + +pub(crate) struct Bls12381MapFpToG1Measure; + +impl HostCostMeasurement for Bls12381MapFpToG1Measure { + type Runner = Bls12381MapFpToG1Run; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381MapFpToG1Sample { + let fp = Fq::rand(rng); + Bls12381MapFpToG1Sample(fp) + } +} + +pub(crate) struct Bls12381HashToG1Measure; + +impl HostCostMeasurement for Bls12381HashToG1Measure { + type Runner = Bls12381HashToG1Run; + const STEP_SIZE: u64 = 64; + + fn new_random_case(_host: &Host, rng: &mut StdRng, input: u64) -> Bls12381HashToG1Sample { + let len = Self::INPUT_BASE_SIZE + input * Self::STEP_SIZE; + let domain = "SOROBAN-V01-CS01-with-BLS12381G1_XMD:SHA-256_SSWU_RO_" + .as_bytes() + .to_vec(); + let mut msg = vec![0u8; len as usize]; + rng.fill(msg.as_mut_slice()); + Bls12381HashToG1Sample(domain, msg) + } +} + +pub(crate) struct Bls12381G2ProjectiveToAffineMeasure; + +impl HostCostMeasurement for Bls12381G2ProjectiveToAffineMeasure { + type Runner = Bls12381G2ProjectiveToAffineRun; + + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> Bls12381G2ProjectiveToAffineSample { + let p0 = G2Projective::rand(rng); + Bls12381G2ProjectiveToAffineSample(p0) + } +} + +pub(crate) struct Bls12381G2AddMeasure; + +impl HostCostMeasurement for Bls12381G2AddMeasure { + type Runner = Bls12381G2AddRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381G2AddSample { + let p0 = G2Affine::rand(rng); + let p1 = G2Affine::rand(rng); + Bls12381G2AddSample(p0, p1) + } +} + +pub(crate) struct Bls12381G2MulMeasure; + +impl HostCostMeasurement for Bls12381G2MulMeasure { + type Runner = Bls12381G2MulRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381G2MulSample { + let p = G2Affine::rand(rng); + let s = Fr::rand(rng); + Bls12381G2MulSample(p, s) + } +} + +pub(crate) struct Bls12381G2MsmMeasure; + +impl HostCostMeasurement for Bls12381G2MsmMeasure { + type Runner = Bls12381G2MsmRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, input: u64) -> Bls12381G2MsmSample { + Bls12381G2MsmSample( + (0..input) + .into_iter() + .map(|_| G2Affine::rand(rng)) + .collect(), + (0..input).into_iter().map(|_| Fr::rand(rng)).collect(), + ) + } +} + +pub(crate) struct Bls12381MapFp2ToG2Measure; + +impl HostCostMeasurement for Bls12381MapFp2ToG2Measure { + type Runner = Bls12381MapFp2ToG2Run; + + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381MapFp2ToG2Sample { + let fp2 = Fq2::rand(rng); + Bls12381MapFp2ToG2Sample(fp2) + } +} + +pub(crate) struct Bls12381HashToG2Measure; + +impl HostCostMeasurement for Bls12381HashToG2Measure { + type Runner = Bls12381HashToG2Run; + const STEP_SIZE: u64 = 64; + + fn new_random_case(_host: &Host, rng: &mut StdRng, input: u64) -> Bls12381HashToG2Sample { + let len = Self::INPUT_BASE_SIZE + input * Self::STEP_SIZE; + let domain = "SOROBAN-V01-CS01-with-BLS12381G2_XMD:SHA-256_SSWU_RO_" + .as_bytes() + .to_vec(); + let mut msg = vec![0u8; len as usize]; + rng.fill(msg.as_mut_slice()); + Bls12381HashToG2Sample(domain, msg) + } +} + +pub(crate) struct Bls12381PairingMeasure; + +impl HostCostMeasurement for Bls12381PairingMeasure { + type Runner = Bls12381PairingRun; + + fn new_random_case(_host: &Host, rng: &mut StdRng, input: u64) -> Bls12381PairingSample { + Bls12381PairingSample( + (0..input) + .into_iter() + .map(|_| G1Affine::rand(rng)) + .collect(), + (0..input) + .into_iter() + .map(|_| G2Affine::rand(rng)) + .collect(), + ) + } +} diff --git a/soroban-env-host/benches/common/cost_types/mod.rs b/soroban-env-host/benches/common/cost_types/mod.rs index 651449342..c36092d88 100644 --- a/soroban-env-host/benches/common/cost_types/mod.rs +++ b/soroban-env-host/benches/common/cost_types/mod.rs @@ -1,3 +1,4 @@ +mod bls12_381; mod compute_ed25519_pubkey; mod compute_keccak256_hash; mod compute_sha256_hash; @@ -18,6 +19,7 @@ mod visit_object; mod vm_ops; mod wasm_insn_exec; +pub(crate) use bls12_381::*; pub(crate) use compute_ed25519_pubkey::*; pub(crate) use compute_keccak256_hash::*; pub(crate) use compute_sha256_hash::*; diff --git a/soroban-env-host/benches/common/experimental/bls12_381.rs b/soroban-env-host/benches/common/experimental/bls12_381.rs new file mode 100644 index 000000000..67c39d15c --- /dev/null +++ b/soroban-env-host/benches/common/experimental/bls12_381.rs @@ -0,0 +1,61 @@ +use crate::common::HostCostMeasurement; +use ark_bls12_381::{Fq2, G1Affine, G2Affine}; +use ark_ff::UniformRand; +use ark_serialize::CanonicalSerialize; +use rand::rngs::StdRng; +use soroban_env_host::{ + cost_runner::{ + Bls12381Fp2DeserializeUncompressedRun, Bls12381G1AffineDeserializeUncompressedRun, + Bls12381G1AffineSerializeUncompressedRun, Bls12381G2AffineDeserializeUncompressedRun, + Bls12381G2AffineSerializeUncompressedRun, + }, + Host, +}; + +pub(crate) struct Bls12381G1AffineSerializeUncompressedMeasure; +impl HostCostMeasurement for Bls12381G1AffineSerializeUncompressedMeasure { + type Runner = Bls12381G1AffineSerializeUncompressedRun; + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> G1Affine { + G1Affine::rand(rng) + } +} +pub(crate) struct Bls12381G2AffineSerializeUncompressedMeasure; +impl HostCostMeasurement for Bls12381G2AffineSerializeUncompressedMeasure { + type Runner = Bls12381G2AffineSerializeUncompressedRun; + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> G2Affine { + G2Affine::rand(rng) + } +} + +pub(crate) struct Bls12381G1AffineDeserializeUncompressedMeasure; +impl HostCostMeasurement for Bls12381G1AffineDeserializeUncompressedMeasure { + type Runner = Bls12381G1AffineDeserializeUncompressedRun; + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Vec { + let mut buf = vec![]; + let _ = G1Affine::rand(rng) + .serialize_uncompressed(&mut buf) + .unwrap(); + buf + } +} +pub(crate) struct Bls12381G2AffineDeserializeUncompressedMeasure; +impl HostCostMeasurement for Bls12381G2AffineDeserializeUncompressedMeasure { + type Runner = Bls12381G2AffineDeserializeUncompressedRun; + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Vec { + let mut buf = vec![]; + let _ = G2Affine::rand(rng) + .serialize_uncompressed(&mut buf) + .unwrap(); + buf + } +} + +pub(crate) struct Bls12381Fp2DeserializeUncompressedMeasure; +impl HostCostMeasurement for Bls12381Fp2DeserializeUncompressedMeasure { + type Runner = Bls12381Fp2DeserializeUncompressedRun; + fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Vec { + let mut buf = vec![]; + let _ = Fq2::rand(rng).serialize_uncompressed(&mut buf).unwrap(); + buf + } +} diff --git a/soroban-env-host/benches/common/experimental/mod.rs b/soroban-env-host/benches/common/experimental/mod.rs index d64b260e0..b011b3778 100644 --- a/soroban-env-host/benches/common/experimental/mod.rs +++ b/soroban-env-host/benches/common/experimental/mod.rs @@ -1,3 +1,4 @@ +mod bls12_381; mod decode_secp256r1_sig; mod ecdsa_secp256k1_verify; mod ecdsa_secp256r1_recover; @@ -5,6 +6,7 @@ mod ed25519_scalar_mul; mod read_xdr; mod sec1_decode_point_compressed; +pub(crate) use bls12_381::*; pub(crate) use decode_secp256r1_sig::*; pub(crate) use ecdsa_secp256k1_verify::*; pub(crate) use ecdsa_secp256r1_recover::*; diff --git a/soroban-env-host/benches/common/measure.rs b/soroban-env-host/benches/common/measure.rs index 3fde3a8db..1ec48598c 100644 --- a/soroban-env-host/benches/common/measure.rs +++ b/soroban-env-host/benches/common/measure.rs @@ -98,8 +98,15 @@ impl Measurements { let ymin = points.iter().map(|(_, y)| *y).reduce(f32::min).unwrap(); let ymax = points.iter().map(|(_, y)| *y).reduce(f32::max).unwrap(); let ymean = points.iter().map(|(_, y)| *y).sum::() / points.len().max(1) as f32; + let mut ystd = points + .iter() + .map(|(_, y)| (*y - ymean) * (*y - ymean)) + .sum::() + / points.len().max(1) as f32; + ystd = ystd.sqrt(); if ymin == ymax { + println!("{} output: min == max == {}", out_name, ymin); return; } let hist = textplots::utils::histogram(&points, ymin, ymax, 30); @@ -125,12 +132,13 @@ impl Measurements { in_max / in_min.max(1.0) ); println!( - "{} output: min {}; max {}; max/min = {}; mean = {}; count = {}", + "{} output: min {}; max {}; max/min = {}; mean = {}; std = {}, count = {}", out_name, ymin.separate_with_commas(), ymax.separate_with_commas(), ymax / ymin.max(1.0), ymean.separate_with_commas(), + ystd.separate_with_commas(), points.len() ); Chart::new(180, 60, ymin - 100.0, ymax + 100.0) @@ -316,8 +324,8 @@ pub trait HostCostMeasurement: Sized { ::run(host, samples, recycled_samples) } - fn get_tracker(host: &Host) -> CostTracker { - ::get_tracker(host) + fn get_tracker(host: &Host, sample: &::SampleType) -> CostTracker { + ::get_tracker(host, sample) } // This is kind of a hack to account for the additional cpu_insn overhead @@ -340,7 +348,8 @@ fn harness( host: &Host, alloc_group_token: Option<&mut AllocationGroupToken>, runner: &mut R, - samples: Vec<<::Runner as CostRunner>::SampleType>, + sample: <::Runner as CostRunner>::SampleType, + repeat_iters: u64, ) -> Measurement where R: FnMut( @@ -349,7 +358,8 @@ where &mut Vec<<::Runner as CostRunner>::RecycledType>, ), { - let mut recycled_samples = Vec::with_capacity(samples.len()); + let samples = (0..repeat_iters).map(|_| sample.clone()).collect(); + let mut recycled_samples = Vec::with_capacity(repeat_iters as usize); host.as_budget().reset_unlimited().unwrap(); let mut ht = HostTracker::new(); @@ -361,7 +371,7 @@ where // Note: the `iterations` here is not same as `RUN_ITERATIONS`. This is the `N` part of the // cost model, which is `RUN_ITERATIONS` * "model iterations from the sample" - let ct = HCM::get_tracker(&host); + let ct = HCM::get_tracker(&host, &sample); Measurement { iterations: ct.iterations, inputs: ct.inputs, @@ -398,15 +408,18 @@ where Some(s) => s, None => break, }; - let samples = (0..::RUN_ITERATIONS) - .map(|_| sample.clone()) - .collect(); // This part is the `N_r * Overhead_s` part of equation [2]. // This is 0 unless we are doing wasm-insn level calibration let samples_cpu_insns_overhead = ::RUN_ITERATIONS .saturating_mul(HCM::get_insns_overhead_per_sample(&host, &sample)); - let mut mes = harness::(&host, Some(&mut alloc_group_token), &mut runner, samples); + let mut mes = harness::( + &host, + Some(&mut alloc_group_token), + &mut runner, + sample, + ::RUN_ITERATIONS, + ); mes.cpu_insns -= samples_cpu_insns_overhead; // the return result contains `N_r * (f(x) + Overhead_b)` (see equation [2]) ret.push(mes); diff --git a/soroban-env-host/benches/common/mod.rs b/soroban-env-host/benches/common/mod.rs index c427eea65..798be807e 100644 --- a/soroban-env-host/benches/common/mod.rs +++ b/soroban-env-host/benches/common/mod.rs @@ -60,6 +60,12 @@ pub(crate) fn for_each_experimental_cost_measurement( call_bench::(&mut params)?; call_bench::(&mut params)?; call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + Ok(params) } @@ -115,6 +121,32 @@ pub(crate) fn for_each_host_cost_measurement( call_bench::(&mut params)?; call_bench::(&mut params)?; + // P22 cost types + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + // These three mem ones are derived analytically, we do not calibrate them typically if std::env::var("INCLUDE_ANALYTICAL_COSTTYPES").is_ok() { call_bench::(&mut params)?; diff --git a/soroban-env-host/benches/variation_histograms.rs b/soroban-env-host/benches/variation_histograms.rs index d0d4992ce..f95b7f9c0 100644 --- a/soroban-env-host/benches/variation_histograms.rs +++ b/soroban-env-host/benches/variation_histograms.rs @@ -16,7 +16,7 @@ impl Benchmark for LinearModelTables { fn bench( ) -> std::io::Result<(MeteredCostComponent, MeteredCostComponent)> { // the inputs will be ignored if the measurment is for a constant model - let mut measurements = measure_cost_variation::(100_000, || 0, || 0, false)?; + let mut measurements = measure_cost_variation::(1_000, || 10, || 10, false)?; measurements.check_range_against_baseline(&HCM::Runner::COST_TYPE)?; measurements.preprocess(); measurements.report_histogram("cpu", |m| m.cpu_insns); diff --git a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs new file mode 100644 index 000000000..33408298e --- /dev/null +++ b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs @@ -0,0 +1,353 @@ +use ark_bls12_381::{Bls12_381, Fq, Fq2, Fr, G1Affine, G1Projective, G2Affine, G2Projective}; +use ark_ec::pairing::PairingOutput; + +use crate::{ + cost_runner::{CostRunner, CostType}, + impl_const_cost_runner_for_bls_consume_sample, impl_const_cost_runner_for_bls_deref_sample, + impl_lin_cost_runner_for_bls_deref_sample, + xdr::ContractCostType::{ + self, Bls12381DecodeFp, Bls12381EncodeFp, Bls12381FrAddSub, Bls12381FrFromU256, + Bls12381FrInv, Bls12381FrMul, Bls12381FrPow, Bls12381FrToU256, Bls12381G1Add, + Bls12381G1Msm, Bls12381G1Mul, Bls12381G1ProjectiveToAffine, Bls12381G1Validate, + Bls12381G2Add, Bls12381G2Msm, Bls12381G2Mul, Bls12381G2ProjectiveToAffine, + Bls12381G2Validate, Bls12381HashToG1, Bls12381HashToG2, Bls12381MapFp2ToG2, + Bls12381MapFpToG1, Bls12381Pairing, + }, + Host, U256Val, +}; +use std::hint::black_box; + +pub struct Bls12381EncodeFpRun; +pub struct Bls12381DecodeFpRun; +pub struct Bls12381G1ValidateRun; +pub struct Bls12381G2ValidateRun; +pub struct Bls12381G1ProjectiveToAffineRun; +pub struct Bls12381G2ProjectiveToAffineRun; +pub struct Bls12381G1AddRun; +pub struct Bls12381G1MulRun; +pub struct Bls12381G1MsmRun; +pub struct Bls12381MapFpToG1Run; +pub struct Bls12381HashToG1Run; +pub struct Bls12381G2AddRun; +pub struct Bls12381G2MulRun; +pub struct Bls12381G2MsmRun; +pub struct Bls12381MapFp2ToG2Run; +pub struct Bls12381HashToG2Run; +pub struct Bls12381PairingRun; +pub struct Bls12381FrFromU256Run; +pub struct Bls12381FrToU256Run; +pub struct Bls12381FrAddRun; +pub struct Bls12381FrSubRun; +pub struct Bls12381FrMulRun; +pub struct Bls12381FrPowRun; +pub struct Bls12381FrInvRun; + +#[derive(Clone)] +pub struct Bls12381G1ProjectiveToAffineSample(pub G1Projective); +#[derive(Clone)] +pub struct Bls12381G1AddSample(pub G1Affine, pub G1Affine); +#[derive(Clone)] +pub struct Bls12381G1MulSample(pub G1Affine, pub Fr); +#[derive(Clone)] +pub struct Bls12381G1MsmSample(pub Vec, pub Vec); +#[derive(Clone)] +pub struct Bls12381MapFpToG1Sample(pub Fq); +#[derive(Clone)] +pub struct Bls12381HashToG1Sample(pub Vec, pub Vec); +#[derive(Clone)] +pub struct Bls12381G2ProjectiveToAffineSample(pub G2Projective); +#[derive(Clone)] +pub struct Bls12381G2AddSample(pub G2Affine, pub G2Affine); +#[derive(Clone)] +pub struct Bls12381G2MulSample(pub G2Affine, pub Fr); +#[derive(Clone)] +pub struct Bls12381G2MsmSample(pub Vec, pub Vec); +#[derive(Clone)] +pub struct Bls12381MapFp2ToG2Sample(pub Fq2); +#[derive(Clone)] +pub struct Bls12381HashToG2Sample(pub Vec, pub Vec); +#[derive(Clone)] +pub struct Bls12381PairingSample(pub Vec, pub Vec); +#[derive(Clone)] +pub struct Bls12381EncodeFpSample(pub Vec, pub Fq); +#[derive(Clone)] +pub struct Bls12381DecodeFpSample(pub Vec); +#[derive(Clone)] +pub struct Bls12381G1ValidateSample(pub G1Affine, pub ContractCostType); +#[derive(Clone)] +pub struct Bls12381G2ValidateSample(pub G2Affine, pub ContractCostType); +#[derive(Clone)] +pub struct Bls12381FrToU256Sample(pub Fr); +#[derive(Clone)] +pub struct Bls12381FrFromU256Sample(pub U256Val); +#[derive(Clone)] +pub struct Bls12381FrAddSubMulSample(pub Fr, pub Fr); +#[derive(Clone)] +pub struct Bls12381FrPowSample(pub Fr, pub u64); +#[derive(Clone)] +pub struct Bls12381FrInvSample(pub Fr); + +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381G1ProjectiveToAffineRun, + Bls12381G1ProjectiveToAffine, + g1_projective_into_affine, + Bls12381G1ProjectiveToAffineSample, + G1Affine, + p0 +); +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381G1AddRun, + Bls12381G1Add, + g1_add_internal, + Bls12381G1AddSample, + G1Projective, + p0, + p1 +); +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381G1MulRun, + Bls12381G1Mul, + g1_mul_internal, + Bls12381G1MulSample, + G1Projective, + p0, + scalar +); +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381MapFpToG1Run, + Bls12381MapFpToG1, + map_fp_to_g1_internal, + Bls12381MapFpToG1Sample, + G1Affine, + fq +); + +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381G2ProjectiveToAffineRun, + Bls12381G2ProjectiveToAffine, + g2_projective_into_affine, + Bls12381G2ProjectiveToAffineSample, + G2Affine, + p0 +); +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381G2AddRun, + Bls12381G2Add, + g2_add_internal, + Bls12381G2AddSample, + G2Projective, + p0, + p1 +); +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381G2MulRun, + Bls12381G2Mul, + g2_mul_internal, + Bls12381G2MulSample, + G2Projective, + p0, + scalar +); +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381MapFp2ToG2Run, + Bls12381MapFp2ToG2, + map_fp2_to_g2_internal, + Bls12381MapFp2ToG2Sample, + G2Affine, + fq2 +); +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381G1ValidateRun, + Bls12381G1Validate, + metered_check_point, + Bls12381G1ValidateSample, + G1Affine, + pt, + ct +); +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381G2ValidateRun, + Bls12381G2Validate, + metered_check_point, + Bls12381G2ValidateSample, + G2Affine, + pt, + ct +); +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381FrFromU256Run, + Bls12381FrFromU256, + fr_from_u256val, + Bls12381FrFromU256Sample, + Fr, + sv +); +impl_const_cost_runner_for_bls_consume_sample!( + Bls12381FrToU256Run, + Bls12381FrToU256, + fr_to_u256val, + Bls12381FrToU256Sample, + U256Val, + fr +); + +impl_lin_cost_runner_for_bls_deref_sample!( + Bls12381HashToG1Run, + Bls12381HashToG1, + hash_to_g1_internal, + Bls12381HashToG1Sample, + G1Affine, + domain, + msg +); +impl_lin_cost_runner_for_bls_deref_sample!( + Bls12381HashToG2Run, + Bls12381HashToG2, + hash_to_g2_internal, + Bls12381HashToG2Sample, + G2Affine, + domain, + msg +); + +impl_lin_cost_runner_for_bls_deref_sample!( + Bls12381G1MsmRun, + Bls12381G1Msm, + g1_msm_internal, + Bls12381G1MsmSample, + G1Projective, + vp, + vs +); + +impl_lin_cost_runner_for_bls_deref_sample!( + Bls12381G2MsmRun, + Bls12381G2Msm, + g2_msm_internal, + Bls12381G2MsmSample, + G2Projective, + vp, + vs +); + +type InternalPairingOutput = PairingOutput; +impl_lin_cost_runner_for_bls_deref_sample!( + Bls12381PairingRun, + Bls12381Pairing, + pairing_internal, + Bls12381PairingSample, + InternalPairingOutput, + vp1, + vp2 +); + +// ser/deser + +impl CostRunner for Bls12381EncodeFpRun { + const COST_TYPE: CostType = CostType::Contract(Bls12381EncodeFp); + + const RUN_ITERATIONS: u64 = 1; + + type SampleType = Bls12381EncodeFpSample; + + type RecycledType = Option; + + fn run_iter( + host: &crate::Host, + _iter: u64, + mut sample: Bls12381EncodeFpSample, + ) -> Self::RecycledType { + let Bls12381EncodeFpSample(buf, fp) = &mut sample; + let _ = host + .serialize_uncompressed_into_slice(fp, buf, 1, "test") + .unwrap(); + black_box(Some(sample)) + } + + fn run_baseline_iter( + host: &crate::Host, + _iter: u64, + sample: Bls12381EncodeFpSample, + ) -> Self::RecycledType { + black_box(host.charge_budget(Bls12381EncodeFp, None).unwrap()); + black_box(Some(sample)) + } +} + +impl CostRunner for Bls12381DecodeFpRun { + const COST_TYPE: CostType = CostType::Contract(Bls12381DecodeFp); + + const RUN_ITERATIONS: u64 = 1; + + type SampleType = Bls12381DecodeFpSample; + + type RecycledType = (Option, Option); + + fn run_iter( + host: &crate::Host, + _iter: u64, + sample: Bls12381DecodeFpSample, + ) -> Self::RecycledType { + let Bls12381DecodeFpSample(buf) = &sample; + let res = host + .deserialize_uncompessed_no_validate(buf, 1, "test") + .unwrap(); + black_box((Some(sample), Some(res))) + } + + fn run_baseline_iter( + host: &crate::Host, + _iter: u64, + sample: Self::SampleType, + ) -> Self::RecycledType { + black_box(host.charge_budget(Bls12381DecodeFp, None).unwrap()); + black_box((Some(sample), None)) + } +} + +// fr arith + +impl_const_cost_runner_for_bls_deref_sample!( + Bls12381FrAddRun, + Bls12381FrAddSub, + fr_add_internal, + Bls12381FrAddSubMulSample, + (), + lhs, + rhs +); +impl_const_cost_runner_for_bls_deref_sample!( + Bls12381FrSubRun, + Bls12381FrAddSub, + fr_sub_internal, + Bls12381FrAddSubMulSample, + (), + lhs, + rhs +); +impl_const_cost_runner_for_bls_deref_sample!( + Bls12381FrMulRun, + Bls12381FrMul, + fr_mul_internal, + Bls12381FrAddSubMulSample, + (), + lhs, + rhs +); +impl_const_cost_runner_for_bls_deref_sample!( + Bls12381FrInvRun, + Bls12381FrInv, + fr_inv_internal, + Bls12381FrInvSample, + Fr, + lhs +); +impl_lin_cost_runner_for_bls_deref_sample!( + Bls12381FrPowRun, + Bls12381FrPow, + fr_pow_internal, + Bls12381FrPowSample, + Fr, + lhs, + rhs +); diff --git a/soroban-env-host/src/cost_runner/cost_types/mod.rs b/soroban-env-host/src/cost_runner/cost_types/mod.rs index 84405b512..01e5976cc 100644 --- a/soroban-env-host/src/cost_runner/cost_types/mod.rs +++ b/soroban-env-host/src/cost_runner/cost_types/mod.rs @@ -1,3 +1,4 @@ +mod bls12_381; mod compute_ed25519_pubkey; mod compute_keccak256_hash; mod compute_sha256_hash; @@ -18,6 +19,7 @@ mod visit_object; mod vm_ops; mod wasm_insn_exec; +pub use bls12_381::*; pub use compute_ed25519_pubkey::*; pub use compute_keccak256_hash::*; pub use compute_sha256_hash::*; diff --git a/soroban-env-host/src/cost_runner/experimental/bls12_381.rs b/soroban-env-host/src/cost_runner/experimental/bls12_381.rs new file mode 100644 index 000000000..509b478c4 --- /dev/null +++ b/soroban-env-host/src/cost_runner/experimental/bls12_381.rs @@ -0,0 +1,137 @@ +use ark_bls12_381::{Fq2, G1Affine, G2Affine}; + +use super::ExperimentalCostType::*; +use crate::{ + budget::CostTracker, + cost_runner::{CostRunner, CostType}, +}; +use std::hint::black_box; + +pub struct Bls12381G1AffineSerializeUncompressedRun; +pub struct Bls12381G2AffineSerializeUncompressedRun; +pub struct Bls12381G1AffineDeserializeUncompressedRun; +pub struct Bls12381G2AffineDeserializeUncompressedRun; +pub struct Bls12381Fp2DeserializeUncompressedRun; + +// ser/deser + +macro_rules! impl_ser_runner_for_bls { + ($runner: ident, $cost: ident, $units: literal, $sample: ident) => { + impl CostRunner for $runner { + const COST_TYPE: CostType = CostType::Experimental($cost); + + const RUN_ITERATIONS: u64 = 1; + + type SampleType = $sample; + + type RecycledType = (Option<$sample>, Option>); + + fn run_iter(host: &crate::Host, _iter: u64, sample: $sample) -> Self::RecycledType { + let mut buf = vec![0u8; 1000]; + let _ = host + .serialize_uncompressed_into_slice(&sample, &mut buf, $units, "test") + .unwrap(); + black_box((None, Some(buf))) + } + + fn run_baseline_iter( + host: &crate::Host, + _iter: u64, + sample: $sample, + ) -> Self::RecycledType { + black_box( + host.charge_budget(crate::xdr::ContractCostType::Int256AddSub, None) + .unwrap(), + ); + black_box((Some(sample), None)) + } + + fn get_tracker(_host: &crate::Host, _sample: &$sample) -> CostTracker { + CostTracker { + iterations: Self::RUN_ITERATIONS, + inputs: None, + cpu: 0, + mem: 0, + } + } + } + }; +} + +impl_ser_runner_for_bls!( + Bls12381G1AffineSerializeUncompressedRun, + Bls12381G1AffineSerializeUncompressed, + 2, + G1Affine +); +impl_ser_runner_for_bls!( + Bls12381G2AffineSerializeUncompressedRun, + Bls12381G2AffineSerializeUncompressed, + 4, + G2Affine +); + +macro_rules! impl_deser_runner_for_bls { + ($runner: ident, $cost: ident, $units: literal, $rt: ty) => { + impl CostRunner for $runner { + const COST_TYPE: CostType = CostType::Experimental($cost); + + const RUN_ITERATIONS: u64 = 1; + + type SampleType = Vec; + + type RecycledType = (Option, Option<$rt>); + + fn run_iter( + host: &crate::Host, + _iter: u64, + sample: Self::SampleType, + ) -> Self::RecycledType { + let res = host + .deserialize_uncompessed_no_validate(&sample, $units, "test") + .unwrap(); + black_box((None, Some(res))) + } + + fn run_baseline_iter( + host: &crate::Host, + _iter: u64, + sample: Self::SampleType, + ) -> Self::RecycledType { + black_box( + host.charge_budget(crate::xdr::ContractCostType::Int256AddSub, None) + .unwrap(), + ); + black_box((Some(sample), None)) + } + + fn get_tracker(_host: &crate::Host, _sample: &Self::SampleType) -> CostTracker { + CostTracker { + iterations: Self::RUN_ITERATIONS, + inputs: None, + cpu: 0, + mem: 0, + } + } + } + }; +} + +impl_deser_runner_for_bls!( + Bls12381G1AffineDeserializeUncompressedRun, + Bls12381G1AffineDeserializeUncompressed, + 2, + G1Affine +); +impl_deser_runner_for_bls!( + Bls12381G2AffineDeserializeUncompressedRun, + Bls12381G2AffineDeserializeUncompressed, + 4, + G2Affine +); +impl_deser_runner_for_bls!( + Bls12381Fp2DeserializeUncompressedRun, + Bls12381Fp2DeserializeUncompressed, + 2, + Fq2 +); diff --git a/soroban-env-host/src/cost_runner/experimental/decode_secp256r1_sig.rs b/soroban-env-host/src/cost_runner/experimental/decode_secp256r1_sig.rs index 3a50a93b1..59fcd070e 100644 --- a/soroban-env-host/src/cost_runner/experimental/decode_secp256r1_sig.rs +++ b/soroban-env-host/src/cost_runner/experimental/decode_secp256r1_sig.rs @@ -27,7 +27,7 @@ impl CostRunner for DecodeSecp256r1SigRun { DecodeEcdsaCurve256SigRun::::run_iter(host, iter, sample) } - fn get_tracker(_host: &crate::Host) -> CostTracker { + fn get_tracker(_host: &crate::Host, _sample: &Self::SampleType) -> CostTracker { CostTracker { iterations: Self::RUN_ITERATIONS, inputs: None, diff --git a/soroban-env-host/src/cost_runner/experimental/ecdsa_secp256k1_verify.rs b/soroban-env-host/src/cost_runner/experimental/ecdsa_secp256k1_verify.rs index 091dc78dd..00058380f 100644 --- a/soroban-env-host/src/cost_runner/experimental/ecdsa_secp256k1_verify.rs +++ b/soroban-env-host/src/cost_runner/experimental/ecdsa_secp256k1_verify.rs @@ -37,7 +37,7 @@ impl CostRunner for EcdsaSecp256k1VerifyRun { black_box(sample) } - fn get_tracker(_host: &crate::Host) -> CostTracker { + fn get_tracker(_host: &crate::Host, _sample: &Self::SampleType) -> CostTracker { CostTracker { iterations: Self::RUN_ITERATIONS, inputs: None, diff --git a/soroban-env-host/src/cost_runner/experimental/ecdsa_secp256r1_recover.rs b/soroban-env-host/src/cost_runner/experimental/ecdsa_secp256r1_recover.rs index 7b6f44177..71234b832 100644 --- a/soroban-env-host/src/cost_runner/experimental/ecdsa_secp256r1_recover.rs +++ b/soroban-env-host/src/cost_runner/experimental/ecdsa_secp256r1_recover.rs @@ -38,7 +38,7 @@ impl CostRunner for EcdsaSecp256r1RecoverRun { black_box(sample) } - fn get_tracker(_host: &crate::Host) -> CostTracker { + fn get_tracker(_host: &crate::Host, _sample: &Self::SampleType) -> CostTracker { CostTracker { iterations: Self::RUN_ITERATIONS, inputs: None, diff --git a/soroban-env-host/src/cost_runner/experimental/ed25519_scalar_mut.rs b/soroban-env-host/src/cost_runner/experimental/ed25519_scalar_mut.rs index f71f911c3..95ed2b5d0 100644 --- a/soroban-env-host/src/cost_runner/experimental/ed25519_scalar_mut.rs +++ b/soroban-env-host/src/cost_runner/experimental/ed25519_scalar_mut.rs @@ -35,7 +35,7 @@ impl CostRunner for Ed25519ScalarMulRun { black_box(sample) } - fn get_tracker(_host: &crate::Host) -> CostTracker { + fn get_tracker(_host: &crate::Host, _sample: &Self::SampleType) -> CostTracker { CostTracker { iterations: Self::RUN_ITERATIONS, inputs: None, diff --git a/soroban-env-host/src/cost_runner/experimental/mod.rs b/soroban-env-host/src/cost_runner/experimental/mod.rs index 1817f508c..66260672a 100644 --- a/soroban-env-host/src/cost_runner/experimental/mod.rs +++ b/soroban-env-host/src/cost_runner/experimental/mod.rs @@ -1,3 +1,4 @@ +mod bls12_381; mod decode_secp256r1_sig; mod ecdsa_secp256k1_verify; mod ecdsa_secp256r1_recover; @@ -5,6 +6,7 @@ mod ed25519_scalar_mut; mod read_xdr; mod sec1_decode_point_compressed; +pub use bls12_381::*; pub use decode_secp256r1_sig::*; pub use ecdsa_secp256k1_verify::*; pub use ecdsa_secp256r1_recover::*; @@ -23,6 +25,11 @@ pub enum ExperimentalCostType { Sec1DecodePointCompressed, DecodeSecp256r1Signature, EcdsaSecp256k1Verify, + Bls12381G1AffineDeserializeUncompressed, + Bls12381G1AffineSerializeUncompressed, + Bls12381G2AffineDeserializeUncompressed, + Bls12381G2AffineSerializeUncompressed, + Bls12381Fp2DeserializeUncompressed, } impl Name for ExperimentalCostType { @@ -36,6 +43,21 @@ impl Name for ExperimentalCostType { ExperimentalCostType::Sec1DecodePointCompressed => "Sec1DecodePointCompressed", ExperimentalCostType::DecodeSecp256r1Signature => "DecodeSecp256r1Signature", ExperimentalCostType::EcdsaSecp256k1Verify => "EcdsaSecp256k1Verify", + ExperimentalCostType::Bls12381G1AffineDeserializeUncompressed => { + "Bls12381G1AffineDeserializeUncompressed" + } + ExperimentalCostType::Bls12381G1AffineSerializeUncompressed => { + "Bls12381G1AffineSerializeUncompressed" + } + ExperimentalCostType::Bls12381G2AffineDeserializeUncompressed => { + "Bls12381G2AffineDeserializeUncompressed" + } + ExperimentalCostType::Bls12381G2AffineSerializeUncompressed => { + "Bls12381G2AffineSerializeUncompressed" + } + ExperimentalCostType::Bls12381Fp2DeserializeUncompressed => { + "Bls12381Fp2DeserializeUncompressed" + } } } } diff --git a/soroban-env-host/src/cost_runner/experimental/read_xdr.rs b/soroban-env-host/src/cost_runner/experimental/read_xdr.rs index 80639f508..7aeb809cf 100644 --- a/soroban-env-host/src/cost_runner/experimental/read_xdr.rs +++ b/soroban-env-host/src/cost_runner/experimental/read_xdr.rs @@ -32,7 +32,7 @@ impl CostRunner for ReadXdrByteArrayRun { black_box((None, sample)) } - fn get_tracker(host: &crate::Host) -> CostTracker { + fn get_tracker(host: &crate::Host, _sample: &Self::SampleType) -> CostTracker { // internally this is still charged under `ValDeser` host.as_budget().get_tracker(ValDeser).unwrap() } diff --git a/soroban-env-host/src/cost_runner/experimental/sec1_decode_point_compressed.rs b/soroban-env-host/src/cost_runner/experimental/sec1_decode_point_compressed.rs index e5737ed28..036424fd2 100644 --- a/soroban-env-host/src/cost_runner/experimental/sec1_decode_point_compressed.rs +++ b/soroban-env-host/src/cost_runner/experimental/sec1_decode_point_compressed.rs @@ -30,7 +30,7 @@ impl CostRunner for Sec1DecodePointCompressedRun { Sec1DecodePointUncompressedRun::run_iter(host, iter, sample) } - fn get_tracker(_host: &crate::Host) -> CostTracker { + fn get_tracker(_host: &crate::Host, _sample: &Self::SampleType) -> CostTracker { CostTracker { iterations: Self::RUN_ITERATIONS, inputs: None, diff --git a/soroban-env-host/src/cost_runner/runner.rs b/soroban-env-host/src/cost_runner/runner.rs index 6a7e218e5..b673128ea 100644 --- a/soroban-env-host/src/cost_runner/runner.rs +++ b/soroban-env-host/src/cost_runner/runner.rs @@ -70,7 +70,7 @@ pub trait CostRunner: Sized { /// if overridden, there is a risk of the computed input being diverged from the /// actual input from the host's perspective. So use it carefully. This should be /// after the `run`, outside of the CPU-and-memory tracking machineary. - fn get_tracker(host: &Host) -> CostTracker { + fn get_tracker(host: &Host, _sample: &Self::SampleType) -> CostTracker { match Self::COST_TYPE { CostType::Contract(ct) => host.as_budget().get_tracker(ct).unwrap(), CostType::Experimental(_) => { diff --git a/soroban-env-host/src/cost_runner/util.rs b/soroban-env-host/src/cost_runner/util.rs index 0542170ce..90e4eccbf 100644 --- a/soroban-env-host/src/cost_runner/util.rs +++ b/soroban-env-host/src/cost_runner/util.rs @@ -48,3 +48,102 @@ impl Host { )?)) } } + +#[macro_export] +macro_rules! impl_const_cost_runner_for_bls_consume_sample { + ($runner: ident, $cost: ident, $host_fn: ident, $sample: ident, $rt: ty, $($arg: ident),*) => { + impl CostRunner for $runner { + const COST_TYPE: CostType = CostType::Contract($cost); + + const RUN_ITERATIONS: u64 = 1; + + type SampleType = $sample; + + type RecycledType = (Option<$sample>, Option<$rt>); + + fn run_iter(host: &Host, _iter: u64, sample: $sample) -> Self::RecycledType { + let $sample($( $arg ),*) = sample; + let res = host.$host_fn($($arg),*).unwrap(); + black_box((None, Some(res))) + } + + fn run_baseline_iter( + host: &Host, + _iter: u64, + sample: $sample, + ) -> Self::RecycledType { + black_box( + host.charge_budget($cost, None) + .unwrap(), + ); + black_box((Some(sample), None)) + } + } + }; +} + +#[macro_export] +macro_rules! impl_lin_cost_runner_for_bls_deref_sample { + ($runner: ident, $cost: ident, $host_fn: ident, $sample: ident, $rt: ty, $($arg: ident),*) => { + impl CostRunner for $runner { + const COST_TYPE: CostType = CostType::Contract($cost); + + const RUN_ITERATIONS: u64 = 100; + + type SampleType = $sample; + + type RecycledType = ($sample, Option<$rt>); + + fn run_iter(host: &Host, _iter: u64, mut sample: $sample) -> Self::RecycledType { + let $sample($( $arg ),*) = &mut sample; + let res = host.$host_fn($($arg),*).unwrap(); + black_box((sample, Some(res))) + } + + fn run_baseline_iter( + host: &Host, + _iter: u64, + sample: $sample, + ) -> Self::RecycledType { + black_box( + host.charge_budget($cost, Some(1)) + .unwrap(), + ); + black_box((sample, None)) + } + } + }; +} + +#[macro_export] +macro_rules! impl_const_cost_runner_for_bls_deref_sample { + ($runner: ident, $cost: ident, $host_fn: ident, $sample: ident, $rt: ty, $($arg: ident),*) => { + impl CostRunner for $runner { + const COST_TYPE: CostType = CostType::Contract($cost); + + const RUN_ITERATIONS: u64 = 1; + + type SampleType = $sample; + + type RecycledType = (Option<$sample>, Option<$rt>); + + fn run_iter(host: &Host, _iter: u64, mut sample: $sample) -> Self::RecycledType { + let $sample($( $arg ),*) = &mut sample; + let res = host.$host_fn($($arg),*).unwrap(); + black_box((Some(sample), Some(res))) + } + + fn run_baseline_iter( + host: &Host, + _iter: u64, + sample: $sample, + ) -> Self::RecycledType { + black_box( + host.charge_budget($cost, None) + .unwrap(), + ); + black_box((Some(sample), None)) + } + } + }; +} From b4c8b7c8ed4f44b74a36909b6d2c576ea8808653 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Fri, 6 Sep 2024 12:34:54 -0400 Subject: [PATCH 05/18] Setup tests for host functions: G1/G2 arith, pairing, hashing-to_curve --- soroban-env-host/src/crypto/bls12_381.rs | 19 +- soroban-env-host/src/test.rs | 1 + soroban-env-host/src/test/bls12_381.rs | 1274 +++++++++++++++++ .../data/BLS12381G1_XMD_SHA-256_SSWU_RO_.json | 115 ++ .../data/BLS12381G2_XMD_SHA-256_SSWU_RO_.json | 115 ++ 5 files changed, 1514 insertions(+), 10 deletions(-) create mode 100644 soroban-env-host/src/test/bls12_381.rs create mode 100644 soroban-env-host/src/test/data/BLS12381G1_XMD_SHA-256_SSWU_RO_.json create mode 100644 soroban-env-host/src/test/data/BLS12381G2_XMD_SHA-256_SSWU_RO_.json diff --git a/soroban-env-host/src/crypto/bls12_381.rs b/soroban-env-host/src/crypto/bls12_381.rs index 545acfa09..d4380f8a6 100644 --- a/soroban-env-host/src/crypto/bls12_381.rs +++ b/soroban-env-host/src/crypto/bls12_381.rs @@ -183,7 +183,7 @@ impl Host { &self, g1: G1Affine, ) -> Result { - let mut buf = vec![0; G1_SERIALIZED_SIZE]; + let mut buf = [0; G1_SERIALIZED_SIZE]; // `CanonicalSerialize of Affine

` calls into // `P::serialize_with_mode`, where `P` is `ark_bls12_381::g1::Config`. The // output bytes will be in following format: `be_bytes(X) || be_bytes(Y)` @@ -191,10 +191,10 @@ impl Host { // // bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383] // - // This aligns with our standard (which is same as the ZCash standard - // https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) + // This aligns with our chosen standard + // (https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) self.serialize_uncompressed_into_slice(&g1, &mut buf, 2, "G1")?; - self.add_host_object(self.scbytes_from_vec(buf)?) + self.add_host_object(self.scbytes_from_slice(&buf)?) } pub(crate) fn g1_projective_serialize_uncompressed( @@ -249,7 +249,7 @@ impl Host { &self, g2: G2Affine, ) -> Result { - let mut buf = vec![0; G2_SERIALIZED_SIZE]; + let mut buf = [0; G2_SERIALIZED_SIZE]; // `CanonicalSerialization of Affine

` where `P` is `ark_bls12_381::curves::g2::Config`, // calls into `P::serialize_with_mode`. // @@ -259,10 +259,9 @@ impl Host { // The most significant three bits of `X_c1` encodes the flags, i.e. // `bits(X_c1) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` // - // This format conforms to the zcash standard https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization - // and is the one we picked. + // This aligns with the standard we've picked https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization self.serialize_uncompressed_into_slice(&g2, &mut buf, 4, "G2")?; - self.add_host_object(self.scbytes_from_vec(buf)?) + self.add_host_object(self.scbytes_from_slice(&buf)?) } pub(crate) fn g2_projective_serialize_uncompressed( @@ -343,8 +342,8 @@ impl Host { // bytes are expected in little-endian, with the highest bits being // empty flags. There is no check involved. // - // This is entirely reversed from the [zcash standard](https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) - // the one we have adopted. This is the input format we provide: + // This is entirely reversed from the [standard](https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) + // we have adopted. This is the input format we provide: // // `input = be_bytes(c1) || be_bytes(c0)` // diff --git a/soroban-env-host/src/test.rs b/soroban-env-host/src/test.rs index 6d8b6433f..7a607c93c 100644 --- a/soroban-env-host/src/test.rs +++ b/soroban-env-host/src/test.rs @@ -3,6 +3,7 @@ pub(crate) mod observe; mod address; mod auth; mod basic; +mod bls12_381; mod budget_metering; mod bytes; mod complex; diff --git a/soroban-env-host/src/test/bls12_381.rs b/soroban-env-host/src/test/bls12_381.rs new file mode 100644 index 000000000..67b375e68 --- /dev/null +++ b/soroban-env-host/src/test/bls12_381.rs @@ -0,0 +1,1274 @@ +use crate::{ + crypto::bls12_381::{ + FP2_SERIALIZED_SIZE, FP_SERIALIZED_SIZE, G1_SERIALIZED_SIZE, G2_SERIALIZED_SIZE, + }, + xdr::{ScErrorCode, ScErrorType}, + BytesObject, Env, EnvBase, Host, HostError, U256Val, U32Val, Val, VecObject, +}; +use ark_bls12_381::{Fq, Fq2, G1Affine, G2Affine}; +use ark_ec::AffineRepr; +use ark_ff::UniformRand; +use ark_serialize::CanonicalSerialize; +use hex::FromHex; +use rand::{rngs::StdRng, SeedableRng}; +use serde::Deserialize; +use std::cmp::Ordering; + +enum InvalidPointTypes { + TooManyBytes, + TooFewBytes, + CompressionFlagSet, + InfinityFlagSetBitsNotAllZero, + SortFlagSet, + PointNotOnCurve, + PointNotInSubgroup, +} + +#[allow(unused)] +#[derive(Deserialize, Debug)] +struct Field { + m: String, + p: String, +} + +#[allow(unused)] +#[derive(Deserialize, Debug)] +struct Map { + name: String, +} + +#[derive(Deserialize, Debug)] +struct Point { + x: String, + y: String, +} + +#[allow(non_snake_case)] +#[derive(Deserialize, Debug)] +struct TestCase { + P: Point, + Q0: Point, + Q1: Point, + msg: String, + u: [String; 2], +} + +#[allow(unused, non_snake_case)] +#[derive(Deserialize, Debug)] +struct HashToCurveTestSuite { + L: String, + Z: String, + ciphersuite: String, + curve: String, + dst: String, + expand: String, + field: Field, + hash: String, + k: String, + map: Map, + randomOracle: bool, + vectors: Vec, +} + +fn parse_hex(s: &str) -> Vec { + Vec::from_hex(s.trim_start_matches("0x")).unwrap() +} + +fn sample_g1(host: &Host) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + host.g1_affine_serialize_uncompressed(G1Affine::rand(&mut rng)) +} + +fn sample_g1_not_on_curve(host: &Host) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + loop { + let x = Fq::rand(&mut rng); + let y = Fq::rand(&mut rng); + let p = G1Affine::new_unchecked(x, y); + if !p.is_on_curve() { + return host.g1_affine_serialize_uncompressed(p); + } + } +} + +fn sample_g1_not_in_subgroup(host: &Host) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + loop { + let x = Fq::rand(&mut rng); + if let Some(p) = G1Affine::get_point_from_x_unchecked(x, true) { + assert!(p.is_on_curve()); + if !p.is_in_correct_subgroup_assuming_on_curve() { + return host.g1_affine_serialize_uncompressed(p); + } + } + } +} + +fn g1_zero(host: &Host) -> Result { + host.g1_affine_serialize_uncompressed(G1Affine::zero()) +} + +fn neg_g1(bo: BytesObject, host: &Host) -> Result { + let g1 = host.g1_affine_deserialize_from_bytesobj(bo)?; + host.g1_affine_serialize_uncompressed(-g1) +} + +fn invalid_g1(host: &Host, ty: InvalidPointTypes) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + let affine = G1Affine::rand(&mut rng); + assert!(!affine.is_zero()); + let bo = host.g1_affine_serialize_uncompressed(affine)?; + match ty { + InvalidPointTypes::TooManyBytes => { + // insert an empty byte to the end + host.bytes_insert(bo, U32Val::from(G1_SERIALIZED_SIZE as u32), U32Val::from(0)) + } + InvalidPointTypes::TooFewBytes => { + // delete the last byte + host.bytes_del(bo, U32Val::from(G1_SERIALIZED_SIZE as u32 - 1)) + } + InvalidPointTypes::CompressionFlagSet => { + let mut first_byte: u32 = host.bytes_get(bo, U32Val::from(0))?.into(); + first_byte = ((first_byte as u8) | (1 << 7)) as u32; + host.bytes_put(bo, U32Val::from(0), U32Val::from(first_byte)) + } + InvalidPointTypes::InfinityFlagSetBitsNotAllZero => { + let mut first_byte: u32 = host.bytes_get(bo, U32Val::from(0))?.into(); + first_byte = ((first_byte as u8) | (1 << 6)) as u32; + host.bytes_put(bo, U32Val::from(0), U32Val::from(first_byte)) + } + InvalidPointTypes::SortFlagSet => { + let mut first_byte: u32 = host.bytes_get(bo, U32Val::from(0))?.into(); + first_byte = ((first_byte as u8) | (1 << 5)) as u32; + host.bytes_put(bo, U32Val::from(0), U32Val::from(first_byte)) + } + InvalidPointTypes::PointNotOnCurve => sample_g1_not_on_curve(host), + InvalidPointTypes::PointNotInSubgroup => sample_g1_not_in_subgroup(host), + } +} + +fn sample_g2(host: &Host) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + host.g2_affine_serialize_uncompressed(G2Affine::rand(&mut rng)) +} + +fn sample_g2_not_on_curve(host: &Host) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + loop { + let x = Fq2::rand(&mut rng); + let y = Fq2::rand(&mut rng); + let p = G2Affine::new_unchecked(x, y); + if !p.is_on_curve() { + return host.g2_affine_serialize_uncompressed(p); + } + } +} + +fn sample_g2_not_in_subgroup(host: &Host) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + loop { + let x = Fq2::rand(&mut rng); + if let Some(p) = G2Affine::get_point_from_x_unchecked(x, true) { + assert!(p.is_on_curve()); + if !p.is_in_correct_subgroup_assuming_on_curve() { + return host.g2_affine_serialize_uncompressed(p); + } + } + } +} + +fn g2_zero(host: &Host) -> Result { + host.g2_affine_serialize_uncompressed(G2Affine::zero()) +} + +fn neg_g2(bo: BytesObject, host: &Host) -> Result { + let g2 = host.g2_affine_deserialize_from_bytesobj(bo)?; + host.g2_affine_serialize_uncompressed(-g2) +} + +fn invalid_g2(host: &Host, ty: InvalidPointTypes) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + let affine = G2Affine::rand(&mut rng); + assert!(!affine.is_zero()); + let bo = host.g2_affine_serialize_uncompressed(affine)?; + match ty { + InvalidPointTypes::TooManyBytes => { + // insert an empty byte to the end + host.bytes_insert(bo, U32Val::from(G2_SERIALIZED_SIZE as u32), U32Val::from(0)) + } + InvalidPointTypes::TooFewBytes => { + // delete the last byte + host.bytes_del(bo, U32Val::from(G2_SERIALIZED_SIZE as u32 - 1)) + } + InvalidPointTypes::CompressionFlagSet => { + let mut first_byte: u32 = host.bytes_get(bo, U32Val::from(0))?.into(); + first_byte = ((first_byte as u8) | (1 << 7)) as u32; + host.bytes_put(bo, U32Val::from(0), U32Val::from(first_byte)) + } + InvalidPointTypes::InfinityFlagSetBitsNotAllZero => { + let mut first_byte: u32 = host.bytes_get(bo, U32Val::from(0))?.into(); + first_byte = ((first_byte as u8) | (1 << 6)) as u32; + host.bytes_put(bo, U32Val::from(0), U32Val::from(first_byte)) + } + InvalidPointTypes::SortFlagSet => { + let mut first_byte: u32 = host.bytes_get(bo, U32Val::from(0))?.into(); + first_byte = ((first_byte as u8) | (1 << 5)) as u32; + host.bytes_put(bo, U32Val::from(0), U32Val::from(first_byte)) + } + InvalidPointTypes::PointNotOnCurve => sample_g2_not_on_curve(host), + InvalidPointTypes::PointNotInSubgroup => sample_g2_not_in_subgroup(host), + } +} + +fn parse_g2_point_test_case(host: &Host, p: Point) -> Result { + let mut p_bytes = [0u8; 192]; + // the input point format in each coordinate is (c0,c1), each part + // being a hex string starting '0x'. So we need to split it by comma, + // flip the two parts, and parse each part (each part is already + // big-endian, so all we need to do is to strip the prefix) + let qx: Vec<_> = p.x.split(',').collect(); + let qy: Vec<_> = p.y.split(',').collect(); + p_bytes[0..48].copy_from_slice(&parse_hex(qx[1])); + p_bytes[48..96].copy_from_slice(&parse_hex(qx[0])); + p_bytes[96..144].copy_from_slice(&parse_hex(qy[1])); + p_bytes[144..192].copy_from_slice(&parse_hex(qy[0])); + host.bytes_new_from_slice(&p_bytes) +} + +#[allow(unused)] +fn sample_fp(host: &Host) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + let fp = Fq::rand(&mut rng); + let mut buf = [0u8; FP_SERIALIZED_SIZE]; + host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; + host.bytes_new_from_slice(&buf) +} + +fn invalid_fp(host: &Host, ty: InvalidPointTypes) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + let fp = Fq::rand(&mut rng); + match ty { + InvalidPointTypes::TooManyBytes => { + let mut buf = [0u8; FP_SERIALIZED_SIZE + 1]; // one extra zero byte + host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; + host.bytes_new_from_slice(&buf) + } + InvalidPointTypes::TooFewBytes => { + let mut buf = [0u8; FP_SERIALIZED_SIZE]; + host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; + host.bytes_new_from_slice(&buf[0..FP_SERIALIZED_SIZE - 1]) // take one less byte + } + _ => panic!("not available"), + } +} + +#[allow(unused)] +fn sample_fp2(host: &Host) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + let fp = Fq2::rand(&mut rng); + let mut buf = [0u8; FP2_SERIALIZED_SIZE]; + host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; + host.bytes_new_from_slice(&buf) +} + +fn invalid_fp2(host: &Host, ty: InvalidPointTypes) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + let fp = Fq::rand(&mut rng); + match ty { + InvalidPointTypes::TooManyBytes => { + let mut buf = [0u8; FP2_SERIALIZED_SIZE + 1]; // one extra zero byte + host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; + host.bytes_new_from_slice(&buf) + } + InvalidPointTypes::TooFewBytes => { + let mut buf = [0u8; FP2_SERIALIZED_SIZE]; + host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; + host.bytes_new_from_slice(&buf[0..FP2_SERIALIZED_SIZE - 1]) // take one less byte + } + _ => panic!("not available"), + } +} + +fn sample_fr(host: &Host) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + let obj = host.obj_from_u256_pieces( + u64::rand(&mut rng), + u64::rand(&mut rng), + u64::rand(&mut rng), + u64::rand(&mut rng), + )?; + Ok(obj.into()) +} + +fn sample_host_vec( + host: &Host, + buf_size: usize, + vec_len: usize, +) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + let vals: Vec = (0..vec_len) + .into_iter() + .map(|_| { + let t = T::rand(&mut rng); + let mut buf = vec![0; buf_size]; + host.serialize_uncompressed_into_slice(&t, &mut buf, 1, "test") + .unwrap(); + host.bytes_new_from_slice(&buf).unwrap().to_val() + }) + .collect(); + host.vec_new_from_slice(&vals) +} + +fn sample_fr_vec(host: &Host, vec_len: usize) -> Result { + let mut rng = StdRng::from_seed([0xff; 32]); + let vals: Vec = (0..vec_len) + .into_iter() + .map(|_| { + host.obj_from_u256_pieces( + u64::rand(&mut rng), + u64::rand(&mut rng), + u64::rand(&mut rng), + u64::rand(&mut rng), + ) + .unwrap() + .to_val() + }) + .collect(); + host.vec_new_from_slice(&vals) +} + +#[test] +fn g1_add() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // invalid p1 + { + let p2 = sample_g1(&host)?; + assert!(HostError::result_matches_err( + host.bls12_381_g1_add(invalid_g1(&host, InvalidPointTypes::TooManyBytes)?, p2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add(invalid_g1(&host, InvalidPointTypes::TooFewBytes)?, p2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add( + invalid_g1(&host, InvalidPointTypes::CompressionFlagSet)?, + p2 + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add( + invalid_g1(&host, InvalidPointTypes::InfinityFlagSetBitsNotAllZero)?, + p2 + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add(invalid_g1(&host, InvalidPointTypes::SortFlagSet)?, p2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add(invalid_g1(&host, InvalidPointTypes::PointNotOnCurve)?, p2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add( + invalid_g1(&host, InvalidPointTypes::PointNotInSubgroup)?, + p2 + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // invalid p2 + { + let p1 = sample_g1(&host)?; + assert!(HostError::result_matches_err( + host.bls12_381_g1_add(p1, invalid_g1(&host, InvalidPointTypes::TooManyBytes)?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add(p1, invalid_g1(&host, InvalidPointTypes::TooFewBytes)?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add( + p1, + invalid_g1(&host, InvalidPointTypes::CompressionFlagSet)? + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add( + p1, + invalid_g1(&host, InvalidPointTypes::InfinityFlagSetBitsNotAllZero)? + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add(p1, invalid_g1(&host, InvalidPointTypes::SortFlagSet)?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add(p1, invalid_g1(&host, InvalidPointTypes::PointNotOnCurve)?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g1_add( + p1, + invalid_g1(&host, InvalidPointTypes::PointNotInSubgroup)? + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // 3. lhs.add(zero) = lhs + { + let p1 = sample_g1(&host)?; + let res = host.bls12_381_g1_add(p1, g1_zero(&host)?)?; + assert_eq!(host.obj_cmp(p1.into(), res.into())?, Ordering::Equal as i64); + } + // 4. zero.add(rhs) = rhs + { + let p2 = sample_g1(&host)?; + let res = host.bls12_381_g1_add(g1_zero(&host)?, p2)?; + assert_eq!(host.obj_cmp(p2.into(), res.into())?, Ordering::Equal as i64); + } + // 5. communitive a + b = b + a + { + let a = sample_g1(&host)?; + let b = sample_g1(&host)?; + let a_plus_b = host.bls12_381_g1_add(a, b)?; + let b_plus_a = host.bls12_381_g1_add(b, a)?; + assert_eq!( + host.obj_cmp(a_plus_b.into(), b_plus_a.into())?, + Ordering::Equal as i64 + ); + } + // 6. associative (a + b) + c = a + (b + c) + { + let a = sample_g1(&host)?; + let b = sample_g1(&host)?; + let c = sample_g1(&host)?; + let aplusb = host.bls12_381_g1_add(a, b)?; + let aplusb_plus_c = host.bls12_381_g1_add(aplusb, c)?; + let bplusc = host.bls12_381_g1_add(b, c)?; + let a_plus_bplusc = host.bls12_381_g1_add(a, bplusc)?; + assert_eq!( + host.obj_cmp(aplusb_plus_c.into(), a_plus_bplusc.into())?, + Ordering::Equal as i64 + ); + } + // 7. a - a = zero + { + let a = sample_g1(&host)?; + let neg_a = neg_g1(a.clone(), &host)?; + let res = host.bls12_381_g1_add(a, neg_a)?; + let zero = g1_zero(&host)?; + assert_eq!( + host.obj_cmp(res.into(), zero.into())?, + Ordering::Equal as i64 + ); + } + Ok(()) +} + +#[test] +fn g1_mul() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // 2. lhs * 0 = 0 + { + let lhs = sample_g1(&host)?; + let rhs = host.obj_from_u256_pieces(0, 0, 0, 0)?; + let res = host.bls12_381_g1_mul(lhs, rhs.into())?; + let zero = g1_zero(&host)?; + assert_eq!( + host.obj_cmp(res.into(), zero.into())?, + Ordering::Equal as i64 + ); + } + // 3. lhs * 1 = lhs + { + let lhs = sample_g1(&host)?; + let rhs = U256Val::from_u32(1); + let res = host.bls12_381_g1_mul(lhs, rhs.into())?; + assert_eq!( + host.obj_cmp(res.into(), lhs.into())?, + Ordering::Equal as i64 + ); + } + // 4. associative P * a * b = P * b * a + { + let p = sample_g1(&host)?; + let a = sample_fr(&host)?; + let b = sample_fr(&host)?; + let pa = host.bls12_381_g1_mul(p, a)?; + let pab = host.bls12_381_g1_mul(pa, b)?; + let pb = host.bls12_381_g1_mul(p, b)?; + let pba = host.bls12_381_g1_mul(pb, a)?; + assert_eq!( + host.obj_cmp(pab.into(), pba.into())?, + Ordering::Equal as i64 + ); + } + Ok(()) +} + +#[test] +fn g1_msm() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // vector lengths are zero + { + let vp = host.vec_new()?; + let vs = host.vec_new()?; + assert!(HostError::result_matches_err( + host.bls12_381_g1_msm(vp, vs), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // vector lengths not equal + { + let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 2)?; + let vs = sample_fr_vec(&host, 3)?; + assert!(HostError::result_matches_err( + host.bls12_381_g1_msm(vp, vs), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // vector g1 not valid + { + let vp = host.vec_new_from_slice(&[ + sample_g1(&host)?.to_val(), + invalid_g1(&host, InvalidPointTypes::PointNotInSubgroup)?.to_val(), + sample_g1(&host)?.to_val(), + ])?; + let vs = sample_fr_vec(&host, 3)?; + assert!(HostError::result_matches_err( + host.bls12_381_g1_msm(vp, vs), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // vector of zero points result zero + { + let vp = host.vec_new_from_slice(&[g1_zero(&host)?.to_val(); 3])?; + let vs = sample_fr_vec(&host, 3)?; + let res = host.bls12_381_g1_msm(vp, vs)?; + assert_eq!( + host.obj_cmp(res.into(), g1_zero(&host)?.into())?, + Ordering::Equal as i64 + ); + } + // vector of zero scalars result in zero point + { + let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3)?; + let vs = host.vec_new_from_slice(&[U256Val::from_u32(0).to_val(); 3])?; + let res = host.bls12_381_g1_msm(vp, vs)?; + assert_eq!( + host.obj_cmp(res.into(), g1_zero(&host)?.into())?, + Ordering::Equal as i64 + ); + } + // 6. g1 * (1) + g1 (-1) = 0 + { + let pt = sample_g1(&host)?; + let zero = g1_zero(&host)?; + assert_ne!( + host.obj_cmp(pt.into(), zero.into())?, + Ordering::Equal as i64 + ); + let neg_pt = neg_g1(pt, &host)?; + let vp = host.vec_new_from_slice(&[pt.to_val(), neg_pt.to_val()])?; + let vs = host.vec_new_from_slice(&[U256Val::from_u32(1).to_val(); 2])?; + let res = host.bls12_381_g1_msm(vp, vs)?; + assert_eq!( + host.obj_cmp(res.into(), g1_zero(&host)?.into())?, + Ordering::Equal as i64 + ); + } + // 7. associative: shuffle points orders results stay the same + { + host.budget_ref().reset_default()?; + let mut vp = vec![ + sample_g1(&host)?.to_val(), + sample_g1(&host)?.to_val(), + sample_g1(&host)?.to_val(), + sample_g1(&host)?.to_val(), + ]; + let mut vs = vec![ + sample_fr(&host)?.to_val(), + sample_fr(&host)?.to_val(), + sample_fr(&host)?.to_val(), + sample_fr(&host)?.to_val(), + ]; + let ref_res = + host.bls12_381_g1_msm(host.vec_new_from_slice(&vp)?, host.vec_new_from_slice(&vs)?)?; + let mut rng = StdRng::from_seed([0xff; 32]); + let mut shuffle_with_order = |v1: &mut Vec, v2: &mut Vec| { + use rand::seq::SliceRandom; + assert_eq!(v1.len(), v2.len()); + let mut indices: Vec = (0..v1.len()).collect(); + indices.shuffle(&mut rng); + let v1_shuffled: Vec = indices.iter().map(|&i| v1[i]).collect(); + let v2_shuffled: Vec = indices.iter().map(|&i| v2[i]).collect(); + *v1 = v1_shuffled; + *v2 = v2_shuffled; + }; + + for _ in 0..10 { + shuffle_with_order(&mut vp, &mut vs); + let vp_obj = host.vec_new_from_slice(&vp)?; + let vs_obj = host.vec_new_from_slice(&vs)?; + let res = host.bls12_381_g1_msm(vp_obj, vs_obj)?; + assert_eq!( + host.obj_cmp(res.into(), ref_res.into())?, + Ordering::Equal as i64 + ); + } + } + // 8. msm result is same as invidial mul and add + { + host.budget_ref().reset_default()?; + let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 10)?; + let vs = sample_fr_vec(&host, 10)?; + let ref_res = host.bls12_381_g1_msm(vp, vs)?; + let mut res = g1_zero(&host)?; + for i in 0..10 { + let p: BytesObject = host.vec_get(vp, U32Val::from(i))?.try_into()?; + let s: U256Val = host.vec_get(vs, U32Val::from(i))?.try_into()?; + let rhs = host.bls12_381_g1_mul(p, s)?; + res = host.bls12_381_g1_add(res, rhs)?; + } + assert_eq!( + host.obj_cmp(res.into(), ref_res.into())?, + Ordering::Equal as i64 + ); + } + Ok(()) +} + +#[test] +fn map_fp_to_g1() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // invalid fp: wrongth length + { + let p1 = invalid_fp(&host, InvalidPointTypes::TooFewBytes)?; + assert!(HostError::result_matches_err( + host.bls12_381_map_fp_to_g1(p1), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + let p2 = invalid_fp(&host, InvalidPointTypes::TooManyBytes)?; + assert!(HostError::result_matches_err( + host.bls12_381_map_fp_to_g1(p2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // Test cases from https://datatracker.ietf.org/doc/html/rfc9380#name-bls12381g1_xmdsha-256_sswu_ + // To interpret the results, understand the steps it takes to hash a msg to curve + // 1. u = hash_to_field(msg, 2) + // 2. Q0 = map_to_curve(u[0]) + // 3. Q1 = map_to_curve(u[1]) + // 4. R = Q0 + Q1 # Point addition + // 5. P = clear_cofactor(R) + // 6. return P + { + host.budget_ref().reset_default()?; + let test_map_fp_to_curve_inner = |u: String, q: Point| -> Result<(), HostError> { + let mut q_bytes = [0u8; 96]; + q_bytes[0..48].copy_from_slice(&parse_hex(&q.x)); + q_bytes[48..].copy_from_slice(&parse_hex(&q.y)); + let g1 = host.bytes_new_from_slice(&q_bytes)?; + let fp = host.bytes_new_from_slice(&parse_hex(&u))?; + let res = host.bls12_381_map_fp_to_g1(fp)?; + assert_eq!(host.obj_cmp(res.into(), g1.into())?, Ordering::Equal as i64); + Ok(()) + }; + + let test_suite: HashToCurveTestSuite = serde_json::from_slice( + &std::fs::read("./src/test/data/BLS12381G1_XMD_SHA-256_SSWU_RO_.json").unwrap(), + ) + .unwrap(); + println!("{test_suite:?}"); + for case in test_suite.vectors { + let [u0, u1] = case.u; + test_map_fp_to_curve_inner(u0, case.Q0)?; + test_map_fp_to_curve_inner(u1, case.Q1)?; + } + } + Ok(()) +} + +#[test] +fn hash_to_g1() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // 1. invalid input dst length = 0 + { + let dst = host.bytes_new_from_slice(&[])?; + let msg = host.bytes_new_from_slice("some message".as_bytes())?; + assert!(HostError::result_matches_err( + host.bls12_381_hash_to_g1(msg, dst), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // 2. invalid input dst length > 255 + { + let dst = host.bytes_new_from_slice(&[0; 256])?; + let msg = host.bytes_new_from_slice("some message".as_bytes())?; + assert!(HostError::result_matches_err( + host.bls12_381_hash_to_g1(msg, dst), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // 3. test vectors from https://datatracker.ietf.org/doc/html/rfc9380#name-bls12381g1_xmdsha-256_sswu_ + { + let test_suite: HashToCurveTestSuite = serde_json::from_slice( + &std::fs::read("./src/test/data/BLS12381G1_XMD_SHA-256_SSWU_RO_.json").unwrap(), + ) + .unwrap(); + let dst = host.bytes_new_from_slice(test_suite.dst.as_bytes())?; + let parse_g1 = |p: Point| -> Result { + let mut p_bytes = [0u8; 96]; + p_bytes[0..48].copy_from_slice(&parse_hex(&p.x)); + p_bytes[48..].copy_from_slice(&parse_hex(&p.y)); + host.bytes_new_from_slice(&p_bytes) + }; + + for case in test_suite.vectors { + let msg = host.bytes_new_from_slice(case.msg.as_bytes())?; + let g1 = host.bls12_381_hash_to_g1(msg, dst)?; + let g1_ref = parse_g1(case.P)?; + assert_eq!( + host.obj_cmp(g1.into(), g1_ref.into())?, + Ordering::Equal as i64 + ); + } + } + Ok(()) +} + +// g2 tests +#[test] +fn g2_add() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // invalid p1 + { + let p2 = sample_g2(&host)?; + assert!(HostError::result_matches_err( + host.bls12_381_g2_add(invalid_g2(&host, InvalidPointTypes::TooManyBytes)?, p2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add(invalid_g2(&host, InvalidPointTypes::TooFewBytes)?, p2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add( + invalid_g2(&host, InvalidPointTypes::CompressionFlagSet)?, + p2 + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add( + invalid_g2(&host, InvalidPointTypes::InfinityFlagSetBitsNotAllZero)?, + p2 + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add(invalid_g2(&host, InvalidPointTypes::SortFlagSet)?, p2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add(invalid_g2(&host, InvalidPointTypes::PointNotOnCurve)?, p2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add( + invalid_g2(&host, InvalidPointTypes::PointNotInSubgroup)?, + p2 + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // invalid p2 + { + let p1 = sample_g2(&host)?; + assert!(HostError::result_matches_err( + host.bls12_381_g2_add(p1, invalid_g2(&host, InvalidPointTypes::TooManyBytes)?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add(p1, invalid_g2(&host, InvalidPointTypes::TooFewBytes)?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add( + p1, + invalid_g2(&host, InvalidPointTypes::CompressionFlagSet)? + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add( + p1, + invalid_g2(&host, InvalidPointTypes::InfinityFlagSetBitsNotAllZero)? + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add(p1, invalid_g2(&host, InvalidPointTypes::SortFlagSet)?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add(p1, invalid_g2(&host, InvalidPointTypes::PointNotOnCurve)?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_g2_add( + p1, + invalid_g2(&host, InvalidPointTypes::PointNotInSubgroup)? + ), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // 3. lhs.add(zero) = lhs + { + let p1 = sample_g2(&host)?; + let res = host.bls12_381_g2_add(p1, g2_zero(&host)?)?; + assert_eq!(host.obj_cmp(p1.into(), res.into())?, Ordering::Equal as i64); + } + // 4. zero.add(rhs) = rhs + { + let p2 = sample_g2(&host)?; + let res = host.bls12_381_g2_add(g2_zero(&host)?, p2)?; + assert_eq!(host.obj_cmp(p2.into(), res.into())?, Ordering::Equal as i64); + } + // 5. communitive a + b = b + a + { + let a = sample_g2(&host)?; + let b = sample_g2(&host)?; + let a_plus_b = host.bls12_381_g2_add(a, b)?; + let b_plus_a = host.bls12_381_g2_add(b, a)?; + assert_eq!( + host.obj_cmp(a_plus_b.into(), b_plus_a.into())?, + Ordering::Equal as i64 + ); + } + // 6. associative (a + b) + c = a + (b + c) + { + let a = sample_g2(&host)?; + let b = sample_g2(&host)?; + let c = sample_g2(&host)?; + let aplusb = host.bls12_381_g2_add(a, b)?; + let aplusb_plus_c = host.bls12_381_g2_add(aplusb, c)?; + let bplusc = host.bls12_381_g2_add(b, c)?; + let a_plus_bplusc = host.bls12_381_g2_add(a, bplusc)?; + assert_eq!( + host.obj_cmp(aplusb_plus_c.into(), a_plus_bplusc.into())?, + Ordering::Equal as i64 + ); + } + // 7. a - a = zero + { + let a = sample_g2(&host)?; + let neg_a = neg_g2(a.clone(), &host)?; + let res = host.bls12_381_g2_add(a, neg_a)?; + let zero = g2_zero(&host)?; + assert_eq!( + host.obj_cmp(res.into(), zero.into())?, + Ordering::Equal as i64 + ); + } + Ok(()) +} + +#[test] +fn g2_mul() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // 2. lhs * 0 = 0 + { + let lhs = sample_g2(&host)?; + let rhs = host.obj_from_u256_pieces(0, 0, 0, 0)?; + let res = host.bls12_381_g2_mul(lhs, rhs.into())?; + let zero = g2_zero(&host)?; + assert_eq!( + host.obj_cmp(res.into(), zero.into())?, + Ordering::Equal as i64 + ); + } + // 3. lhs * 1 = lhs + { + let lhs = sample_g2(&host)?; + let rhs = U256Val::from_u32(1); + let res = host.bls12_381_g2_mul(lhs, rhs.into())?; + assert_eq!( + host.obj_cmp(res.into(), lhs.into())?, + Ordering::Equal as i64 + ); + } + // 4. associative P * a * b = P * b * a + { + let p = sample_g2(&host)?; + let a = sample_fr(&host)?; + let b = sample_fr(&host)?; + let pa = host.bls12_381_g2_mul(p, a)?; + let pab = host.bls12_381_g2_mul(pa, b)?; + let pb = host.bls12_381_g2_mul(p, b)?; + let pba = host.bls12_381_g2_mul(pb, a)?; + assert_eq!( + host.obj_cmp(pab.into(), pba.into())?, + Ordering::Equal as i64 + ); + } + Ok(()) +} + +#[test] +fn g2_msm() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // vector lengths are zero + { + let vp = host.vec_new()?; + let vs = host.vec_new()?; + assert!(HostError::result_matches_err( + host.bls12_381_g2_msm(vp, vs), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // vector lengths not equal + { + let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2)?; + let vs = sample_fr_vec(&host, 3)?; + assert!(HostError::result_matches_err( + host.bls12_381_g2_msm(vp, vs), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // vector g2 not valid + { + let vp = host.vec_new_from_slice(&[ + sample_g2(&host)?.to_val(), + invalid_g2(&host, InvalidPointTypes::PointNotInSubgroup)?.to_val(), + sample_g2(&host)?.to_val(), + ])?; + let vs = sample_fr_vec(&host, 3)?; + assert!(HostError::result_matches_err( + host.bls12_381_g2_msm(vp, vs), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // vector of zero points result zero + { + let vp = host.vec_new_from_slice(&[g2_zero(&host)?.to_val(); 3])?; + let vs = sample_fr_vec(&host, 3)?; + let res = host.bls12_381_g2_msm(vp, vs)?; + assert_eq!( + host.obj_cmp(res.into(), g2_zero(&host)?.into())?, + Ordering::Equal as i64 + ); + } + // vector of zero scalars result in zero point + { + let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3)?; + let vs = host.vec_new_from_slice(&[U256Val::from_u32(0).to_val(); 3])?; + let res = host.bls12_381_g2_msm(vp, vs)?; + assert_eq!( + host.obj_cmp(res.into(), g2_zero(&host)?.into())?, + Ordering::Equal as i64 + ); + } + // 6. g2 * (1) + g2 (-1) = 0 + { + let pt = sample_g2(&host)?; + let zero = g2_zero(&host)?; + assert_ne!( + host.obj_cmp(pt.into(), zero.into())?, + Ordering::Equal as i64 + ); + let neg_pt = neg_g2(pt, &host)?; + let vp = host.vec_new_from_slice(&[pt.to_val(), neg_pt.to_val()])?; + let vs = host.vec_new_from_slice(&[U256Val::from_u32(1).to_val(); 2])?; + let res = host.bls12_381_g2_msm(vp, vs)?; + assert_eq!( + host.obj_cmp(res.into(), g2_zero(&host)?.into())?, + Ordering::Equal as i64 + ); + } + // 7. associative: shuffle points orders results stay the same + { + let mut vp = vec![ + sample_g2(&host)?.to_val(), + sample_g2(&host)?.to_val(), + sample_g2(&host)?.to_val(), + sample_g2(&host)?.to_val(), + ]; + let mut vs = vec![ + sample_fr(&host)?.to_val(), + sample_fr(&host)?.to_val(), + sample_fr(&host)?.to_val(), + sample_fr(&host)?.to_val(), + ]; + let ref_res = + host.bls12_381_g2_msm(host.vec_new_from_slice(&vp)?, host.vec_new_from_slice(&vs)?)?; + let mut rng = StdRng::from_seed([0xff; 32]); + let mut shuffle_with_order = |v1: &mut Vec, v2: &mut Vec| { + use rand::seq::SliceRandom; + assert_eq!(v1.len(), v2.len()); + let mut indices: Vec = (0..v1.len()).collect(); + indices.shuffle(&mut rng); + let v1_shuffled: Vec = indices.iter().map(|&i| v1[i]).collect(); + let v2_shuffled: Vec = indices.iter().map(|&i| v2[i]).collect(); + *v1 = v1_shuffled; + *v2 = v2_shuffled; + }; + + for _ in 0..10 { + host.budget_ref().reset_default()?; + shuffle_with_order(&mut vp, &mut vs); + let vp_obj = host.vec_new_from_slice(&vp)?; + let vs_obj = host.vec_new_from_slice(&vs)?; + let res = host.bls12_381_g2_msm(vp_obj, vs_obj)?; + assert_eq!( + host.obj_cmp(res.into(), ref_res.into())?, + Ordering::Equal as i64 + ); + } + } + // 8. msm result is same as invidial mul and add + { + host.budget_ref().reset_default()?; + let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 5)?; + let vs = sample_fr_vec(&host, 5)?; + let ref_res = host.bls12_381_g2_msm(vp, vs)?; + let mut res = g2_zero(&host)?; + for i in 0..5 { + let p: BytesObject = host.vec_get(vp, U32Val::from(i))?.try_into()?; + let s: U256Val = host.vec_get(vs, U32Val::from(i))?.try_into()?; + let rhs = host.bls12_381_g2_mul(p, s)?; + res = host.bls12_381_g2_add(res, rhs)?; + } + assert_eq!( + host.obj_cmp(res.into(), ref_res.into())?, + Ordering::Equal as i64 + ); + } + Ok(()) +} + +#[test] +fn map_fp2_to_g2() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // invalid fp2: wrongth length + { + let p1 = invalid_fp2(&host, InvalidPointTypes::TooFewBytes)?; + assert!(HostError::result_matches_err( + host.bls12_381_map_fp2_to_g2(p1), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + let p2 = invalid_fp2(&host, InvalidPointTypes::TooManyBytes)?; + assert!(HostError::result_matches_err( + host.bls12_381_map_fp2_to_g2(p2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // Test cases from https://datatracker.ietf.org/doc/html/rfc9380#name-bls12381g2_xmdsha-256_sswu_ + // To interpret the results, understand the steps it takes to hash a msg to curve + // 1. u = hash_to_field(msg, 2) + // 2. Q0 = map_to_curve(u[0]) + // 3. Q1 = map_to_curve(u[1]) + // 4. R = Q0 + Q1 # Point addition + // 5. P = clear_cofactor(R) + // 6. return P + { + host.budget_ref().reset_default()?; + let test_map_fp2_to_curve_inner = |u: String, q: Point| -> Result<(), HostError> { + let g2 = parse_g2_point_test_case(&host, q)?; + let mut u_bytes = [0u8; 96]; + let uu: Vec<_> = u.split(',').collect(); + u_bytes[0..48].copy_from_slice(&parse_hex(uu[1])); + u_bytes[48..96].copy_from_slice(&parse_hex(uu[0])); + let fp2 = host.bytes_new_from_slice(&u_bytes)?; + let res = host.bls12_381_map_fp2_to_g2(fp2)?; + assert_eq!(host.obj_cmp(res.into(), g2.into())?, Ordering::Equal as i64); + Ok(()) + }; + + let test_suite: HashToCurveTestSuite = serde_json::from_slice( + &std::fs::read("./src/test/data/BLS12381G2_XMD_SHA-256_SSWU_RO_.json").unwrap(), + ) + .unwrap(); + for case in test_suite.vectors { + let [u0, u1] = case.u; + test_map_fp2_to_curve_inner(u0, case.Q0)?; + test_map_fp2_to_curve_inner(u1, case.Q1)?; + } + } + Ok(()) +} + +#[test] +fn hash_to_g2() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // 1. invalid input dst length = 0 + { + let dst = host.bytes_new_from_slice(&[])?; + let msg = host.bytes_new_from_slice("some message".as_bytes())?; + assert!(HostError::result_matches_err( + host.bls12_381_hash_to_g2(msg, dst), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // 2. invalid input dst length > 255 + { + let dst = host.bytes_new_from_slice(&[0; 256])?; + let msg = host.bytes_new_from_slice("some message".as_bytes())?; + assert!(HostError::result_matches_err( + host.bls12_381_hash_to_g2(msg, dst), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // 3. test vectors from https://datatracker.ietf.org/doc/html/rfc9380#name-bls12381g2_xmdsha-256_sswu_ + { + let test_suite: HashToCurveTestSuite = serde_json::from_slice( + &std::fs::read("./src/test/data/BLS12381G2_XMD_SHA-256_SSWU_RO_.json").unwrap(), + ) + .unwrap(); + let dst = host.bytes_new_from_slice(test_suite.dst.as_bytes())?; + for case in test_suite.vectors { + let msg = host.bytes_new_from_slice(case.msg.as_bytes())?; + let g2 = host.bls12_381_hash_to_g2(msg, dst)?; + let g2_ref = parse_g2_point_test_case(&host, case.P)?; + assert_eq!( + host.obj_cmp(g2.into(), g2_ref.into())?, + Ordering::Equal as i64 + ); + } + } + Ok(()) +} + +// pairing checks +#[test] +fn pairing() -> Result<(), HostError> { + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // 1. vector lengths don't match + { + let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3)?; + let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2)?; + assert!(HostError::result_matches_err( + host.bls12_381_multi_pairing_check(vp1, vp2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // 2. vector length is 0 + { + let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 0)?; + let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 0)?; + assert!(HostError::result_matches_err( + host.bls12_381_multi_pairing_check(vp1, vp2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // 3. any g1 is invalid + { + let mut vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3)?; + vp1 = host.vec_put( + vp1, + U32Val::from(1), + sample_g1_not_in_subgroup(&host)?.to_val(), + )?; + let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2)?; + assert!(HostError::result_matches_err( + host.bls12_381_multi_pairing_check(vp1, vp2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // 4. any g2 is invalid + { + let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3)?; + let mut vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3)?; + vp2 = host.vec_put( + vp2, + U32Val::from(1), + sample_g2_not_on_curve(&host)?.to_val(), + )?; + assert!(HostError::result_matches_err( + host.bls12_381_multi_pairing_check(vp1, vp2), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // 5. e(P, Q+R) = e(P, Q)*e(P, R) + { + host.budget_ref().reset_default()?; + let p = sample_g1(&host)?; + let neg_p = neg_g1(p, &host)?; + let q = sample_g2(&host)?; + let r = sample_g2(&host)?; + let q_plus_r = host.bls12_381_g2_add(q, r)?; + + //check e(-P, Q+R)*e(P, Q)*e(P, R) == 1 + let g1_vec = host.vec_new_from_slice(&[neg_p.to_val(), p.to_val(), p.to_val()])?; + let g2_vec = host.vec_new_from_slice(&[q_plus_r.to_val(), q.to_val(), r.to_val()])?; + let res = host.bls12_381_multi_pairing_check(g1_vec, g2_vec)?; + assert!(res.as_val().is_true()) + } + // 6. e(P+S, R) = e(P, R)*e(S, R) + { + host.budget_ref().reset_default()?; + let p = sample_g1(&host)?; + let s = sample_g1(&host)?; + let r = sample_g2(&host)?; + let neg_r = neg_g2(r, &host)?; + let p_plus_s = host.bls12_381_g1_add(p, s)?; + // check e(P+S, -R) * e(P, R)*e(S, R) == 1 + let g1_vec = host.vec_new_from_slice(&[p_plus_s.to_val(), p.to_val(), s.to_val()])?; + let g2_vec = host.vec_new_from_slice(&[neg_r.to_val(), r.to_val(), r.to_val()])?; + let res = host.bls12_381_multi_pairing_check(g1_vec, g2_vec)?; + assert!(res.as_val().is_true()) + } + + // 7. e([a]P, [b]Q) = e([b]P, [a]Q) = e([ab]P, Q)= e(P, [ab]Q) + { + host.budget_ref().reset_default()?; + let a = sample_fr(&host)?; + let b = sample_fr(&host)?; + let p = sample_g1(&host)?; + let neg_p = neg_g1(p, &host)?; + let q = sample_g2(&host)?; + let neg_q = neg_g2(q, &host)?; + let a_p = host.bls12_381_g1_mul(p, a)?; + let b_p = host.bls12_381_g1_mul(p, b)?; + let a_q = host.bls12_381_g2_mul(q, a)?; + let b_q = host.bls12_381_g2_mul(q, b)?; + let ab = host.bls12_381_fr_mul(a, b)?; + let ab_p = host.bls12_381_g1_mul(p, ab)?; + let ab_q = host.bls12_381_g2_mul(q, ab)?; + // check e([a]P, [b]Q) * e([b]P, [a]Q) * e([ab]P, -Q) * e(-P, [ab]Q) == 1 + let g1_vec = + host.vec_new_from_slice(&[a_p.to_val(), b_p.to_val(), ab_p.to_val(), neg_p.to_val()])?; + let g2_vec = + host.vec_new_from_slice(&[b_q.to_val(), a_q.to_val(), neg_q.to_val(), ab_q.to_val()])?; + let res = host.bls12_381_multi_pairing_check(g1_vec, g2_vec)?; + assert!(res.as_val().is_true()) + } + Ok(()) +} + +// ethereum test + +// fr arithmetics + +// serialization roundtrip + +// fuzzing tests diff --git a/soroban-env-host/src/test/data/BLS12381G1_XMD_SHA-256_SSWU_RO_.json b/soroban-env-host/src/test/data/BLS12381G1_XMD_SHA-256_SSWU_RO_.json new file mode 100644 index 000000000..46c7574f0 --- /dev/null +++ b/soroban-env-host/src/test/data/BLS12381G1_XMD_SHA-256_SSWU_RO_.json @@ -0,0 +1,115 @@ +{ + "L": "0x40", + "Z": "0xb", + "ciphersuite": "BLS12381G1_XMD:SHA-256_SSWU_RO_", + "curve": "BLS12-381 G1", + "dst": "QUUX-V01-CS02-with-BLS12381G1_XMD:SHA-256_SSWU_RO_", + "expand": "XMD", + "field": { + "m": "0x1", + "p": "0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab" + }, + "hash": "sha256", + "k": "0x80", + "map": { + "name": "SSWU" + }, + "randomOracle": true, + "vectors": [ + { + "P": { + "x": "0x052926add2207b76ca4fa57a8734416c8dc95e24501772c814278700eed6d1e4e8cf62d9c09db0fac349612b759e79a1", + "y": "0x08ba738453bfed09cb546dbb0783dbb3a5f1f566ed67bb6be0e8c67e2e81a4cc68ee29813bb7994998f3eae0c9c6a265" + }, + "Q0": { + "x": "0x11a3cce7e1d90975990066b2f2643b9540fa40d6137780df4e753a8054d07580db3b7f1f03396333d4a359d1fe3766fe", + "y": "0x0eeaf6d794e479e270da10fdaf768db4c96b650a74518fc67b04b03927754bac66f3ac720404f339ecdcc028afa091b7" + }, + "Q1": { + "x": "0x160003aaf1632b13396dbad518effa00fff532f604de1a7fc2082ff4cb0afa2d63b2c32da1bef2bf6c5ca62dc6b72f9c", + "y": "0x0d8bb2d14e20cf9f6036152ed386d79189415b6d015a20133acb4e019139b94e9c146aaad5817f866c95d609a361735e" + }, + "msg": "", + "u": [ + "0x0ba14bd907ad64a016293ee7c2d276b8eae71f25a4b941eece7b0d89f17f75cb3ae5438a614fb61d6835ad59f29c564f", + "0x019b9bd7979f12657976de2884c7cce192b82c177c80e0ec604436a7f538d231552f0d96d9f7babe5fa3b19b3ff25ac9" + ] + }, + { + "P": { + "x": "0x03567bc5ef9c690c2ab2ecdf6a96ef1c139cc0b2f284dca0a9a7943388a49a3aee664ba5379a7655d3c68900be2f6903", + "y": "0x0b9c15f3fe6e5cf4211f346271d7b01c8f3b28be689c8429c85b67af215533311f0b8dfaaa154fa6b88176c229f2885d" + }, + "Q0": { + "x": "0x125435adce8e1cbd1c803e7123f45392dc6e326d292499c2c45c5865985fd74fe8f042ecdeeec5ecac80680d04317d80", + "y": "0x0e8828948c989126595ee30e4f7c931cbd6f4570735624fd25aef2fa41d3f79cfb4b4ee7b7e55a8ce013af2a5ba20bf2" + }, + "Q1": { + "x": "0x11def93719829ecda3b46aa8c31fc3ac9c34b428982b898369608e4f042babee6c77ab9218aad5c87ba785481eff8ae4", + "y": "0x0007c9cef122ccf2efd233d6eb9bfc680aa276652b0661f4f820a653cec1db7ff69899f8e52b8e92b025a12c822a6ce6" + }, + "msg": "abc", + "u": [ + "0x0d921c33f2bad966478a03ca35d05719bdf92d347557ea166e5bba579eea9b83e9afa5c088573c2281410369fbd32951", + "0x003574a00b109ada2f26a37a91f9d1e740dffd8d69ec0c35e1e9f4652c7dba61123e9dd2e76c655d956e2b3462611139" + ] + }, + { + "P": { + "x": "0x11e0b079dea29a68f0383ee94fed1b940995272407e3bb916bbf268c263ddd57a6a27200a784cbc248e84f357ce82d98", + "y": "0x03a87ae2caf14e8ee52e51fa2ed8eefe80f02457004ba4d486d6aa1f517c0889501dc7413753f9599b099ebcbbd2d709" + }, + "Q0": { + "x": "0x08834484878c217682f6d09a4b51444802fdba3d7f2df9903a0ddadb92130ebbfa807fffa0eabf257d7b48272410afff", + "y": "0x0b318f7ecf77f45a0f038e62d7098221d2dbbca2a394164e2e3fe953dc714ac2cde412d8f2d7f0c03b259e6795a2508e" + }, + "Q1": { + "x": "0x158418ed6b27e2549f05531a8281b5822b31c3bf3144277fbb977f8d6e2694fedceb7011b3c2b192f23e2a44b2bd106e", + "y": "0x1879074f344471fac5f839e2b4920789643c075792bec5af4282c73f7941cda5aa77b00085eb10e206171b9787c4169f" + }, + "msg": "abcdef0123456789", + "u": [ + "0x062d1865eb80ebfa73dcfc45db1ad4266b9f3a93219976a3790ab8d52d3e5f1e62f3b01795e36834b17b70e7b76246d4", + "0x0cdc3e2f271f29c4ff75020857ce6c5d36008c9b48385ea2f2bf6f96f428a3deb798aa033cd482d1cdc8b30178b08e3a" + ] + }, + { + "P": { + "x": "0x15f68eaa693b95ccb85215dc65fa81038d69629f70aeee0d0f677cf22285e7bf58d7cb86eefe8f2e9bc3f8cb84fac488", + "y": "0x1807a1d50c29f430b8cafc4f8638dfeeadf51211e1602a5f184443076715f91bb90a48ba1e370edce6ae1062f5e6dd38" + }, + "Q0": { + "x": "0x0cbd7f84ad2c99643fea7a7ac8f52d63d66cefa06d9a56148e58b984b3dd25e1f41ff47154543343949c64f88d48a710", + "y": "0x052c00e4ed52d000d94881a5638ae9274d3efc8bc77bc0e5c650de04a000b2c334a9e80b85282a00f3148dfdface0865" + }, + "Q1": { + "x": "0x06493fb68f0d513af08be0372f849436a787e7b701ae31cb964d968021d6ba6bd7d26a38aaa5a68e8c21a6b17dc8b579", + "y": "0x02e98f2ccf5802b05ffaac7c20018bc0c0b2fd580216c4aa2275d2909dc0c92d0d0bdc979226adeb57a29933536b6bb4" + }, + "msg": "q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", + "u": [ + "0x010476f6a060453c0b1ad0b628f3e57c23039ee16eea5e71bb87c3b5419b1255dc0e5883322e563b84a29543823c0e86", + "0x0b1a912064fb0554b180e07af7e787f1f883a0470759c03c1b6509eb8ce980d1670305ae7b928226bb58fdc0a419f46e" + ] + }, + { + "P": { + "x": "0x082aabae8b7dedb0e78aeb619ad3bfd9277a2f77ba7fad20ef6aabdc6c31d19ba5a6d12283553294c1825c4b3ca2dcfe", + "y": "0x05b84ae5a942248eea39e1d91030458c40153f3b654ab7872d779ad1e942856a20c438e8d99bc8abfbf74729ce1f7ac8" + }, + "Q0": { + "x": "0x0cf97e6dbd0947857f3e578231d07b309c622ade08f2c08b32ff372bd90db19467b2563cc997d4407968d4ac80e154f8", + "y": "0x127f0cddf2613058101a5701f4cb9d0861fd6c2a1b8e0afe194fccf586a3201a53874a2761a9ab6d7220c68661a35ab3" + }, + "Q1": { + "x": "0x092f1acfa62b05f95884c6791fba989bbe58044ee6355d100973bf9553ade52b47929264e6ae770fb264582d8dce512a", + "y": "0x028e6d0169a72cfedb737be45db6c401d3adfb12c58c619c82b93a5dfcccef12290de530b0480575ddc8397cda0bbebf" + }, + "msg": "a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "u": [ + "0x0a8ffa7447f6be1c5a2ea4b959c9454b431e29ccc0802bc052413a9c5b4f9aac67a93431bd480d15be1e057c8a08e8c6", + "0x05d487032f602c90fa7625dbafe0f4a49ef4a6b0b33d7bb349ff4cf5410d297fd6241876e3e77b651cfc8191e40a68b7" + ] + } + ] +} diff --git a/soroban-env-host/src/test/data/BLS12381G2_XMD_SHA-256_SSWU_RO_.json b/soroban-env-host/src/test/data/BLS12381G2_XMD_SHA-256_SSWU_RO_.json new file mode 100644 index 000000000..5807ee6f6 --- /dev/null +++ b/soroban-env-host/src/test/data/BLS12381G2_XMD_SHA-256_SSWU_RO_.json @@ -0,0 +1,115 @@ +{ + "L": "0x40", + "Z": "0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaa9,0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaaa", + "ciphersuite": "BLS12381G2_XMD:SHA-256_SSWU_RO_", + "curve": "BLS12-381 G2", + "dst": "QUUX-V01-CS02-with-BLS12381G2_XMD:SHA-256_SSWU_RO_", + "expand": "XMD", + "field": { + "m": "0x2", + "p": "0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab" + }, + "hash": "sha256", + "k": "0x80", + "map": { + "name": "SSWU" + }, + "randomOracle": true, + "vectors": [ + { + "P": { + "x": "0x0141ebfbdca40eb85b87142e130ab689c673cf60f1a3e98d69335266f30d9b8d4ac44c1038e9dcdd5393faf5c41fb78a,0x05cb8437535e20ecffaef7752baddf98034139c38452458baeefab379ba13dff5bf5dd71b72418717047f5b0f37da03d", + "y": "0x0503921d7f6a12805e72940b963c0cf3471c7b2a524950ca195d11062ee75ec076daf2d4bc358c4b190c0c98064fdd92,0x12424ac32561493f3fe3c260708a12b7c620e7be00099a974e259ddc7d1f6395c3c811cdd19f1e8dbf3e9ecfdcbab8d6" + }, + "Q0": { + "x": "0x019ad3fc9c72425a998d7ab1ea0e646a1f6093444fc6965f1cad5a3195a7b1e099c050d57f45e3fa191cc6d75ed7458c,0x171c88b0b0efb5eb2b88913a9e74fe111a4f68867b59db252ce5868af4d1254bfab77ebde5d61cd1a86fb2fe4a5a1c1d", + "y": "0x0ba10604e62bdd9eeeb4156652066167b72c8d743b050fb4c1016c31b505129374f76e03fa127d6a156213576910fef3,0x0eb22c7a543d3d376e9716a49b72e79a89c9bfe9feee8533ed931cbb5373dde1fbcd7411d8052e02693654f71e15410a" + }, + "Q1": { + "x": "0x113d2b9cd4bd98aee53470b27abc658d91b47a78a51584f3d4b950677cfb8a3e99c24222c406128c91296ef6b45608be,0x13855912321c5cb793e9d1e88f6f8d342d49c0b0dbac613ee9e17e3c0b3c97dfbb5a49cc3fb45102fdbaf65e0efe2632", + "y": "0x0fd3def0b7574a1d801be44fde617162aa2e89da47f464317d9bb5abc3a7071763ce74180883ad7ad9a723a9afafcdca,0x056f617902b3c0d0f78a9a8cbda43a26b65f602f8786540b9469b060db7b38417915b413ca65f875c130bebfaa59790c" + }, + "msg": "", + "u": [ + "0x03dbc2cce174e91ba93cbb08f26b917f98194a2ea08d1cce75b2b9cc9f21689d80bd79b594a613d0a68eb807dfdc1cf8,0x05a2acec64114845711a54199ea339abd125ba38253b70a92c876df10598bd1986b739cad67961eb94f7076511b3b39a", + "0x02f99798e8a5acdeed60d7e18e9120521ba1f47ec090984662846bc825de191b5b7641148c0dbc237726a334473eee94,0x145a81e418d4010cc027a68f14391b30074e89e60ee7a22f87217b2f6eb0c4b94c9115b436e6fa4607e95a98de30a435" + ] + }, + { + "P": { + "x": "0x02c2d18e033b960562aae3cab37a27ce00d80ccd5ba4b7fe0e7a210245129dbec7780ccc7954725f4168aff2787776e6,0x139cddbccdc5e91b9623efd38c49f81a6f83f175e80b06fc374de9eb4b41dfe4ca3a230ed250fbe3a2acf73a41177fd8", + "y": "0x1787327b68159716a37440985269cf584bcb1e621d3a7202be6ea05c4cfe244aeb197642555a0645fb87bf7466b2ba48,0x00aa65dae3c8d732d10ecd2c50f8a1baf3001578f71c694e03866e9f3d49ac1e1ce70dd94a733534f106d4cec0eddd16" + }, + "Q0": { + "x": "0x12b2e525281b5f4d2276954e84ac4f42cf4e13b6ac4228624e17760faf94ce5706d53f0ca1952f1c5ef75239aeed55ad,0x05d8a724db78e570e34100c0bc4a5fa84ad5839359b40398151f37cff5a51de945c563463c9efbdda569850ee5a53e77", + "y": "0x02eacdc556d0bdb5d18d22f23dcb086dd106cad713777c7e6407943edbe0b3d1efe391eedf11e977fac55f9b94f2489c,0x04bbe48bfd5814648d0b9e30f0717b34015d45a861425fabc1ee06fdfce36384ae2c808185e693ae97dcde118f34de41" + }, + "Q1": { + "x": "0x19f18cc5ec0c2f055e47c802acc3b0e40c337256a208001dde14b25afced146f37ea3d3ce16834c78175b3ed61f3c537,0x15b0dadc256a258b4c68ea43605dffa6d312eef215c19e6474b3e101d33b661dfee43b51abbf96fee68fc6043ac56a58", + "y": "0x05e47c1781286e61c7ade887512bd9c2cb9f640d3be9cf87ea0bad24bd0ebfe946497b48a581ab6c7d4ca74b5147287f,0x19f98db2f4a1fcdf56a9ced7b320ea9deecf57c8e59236b0dc21f6ee7229aa9705ce9ac7fe7a31c72edca0d92370c096" + }, + "msg": "abc", + "u": [ + "0x15f7c0aa8f6b296ab5ff9c2c7581ade64f4ee6f1bf18f55179ff44a2cf355fa53dd2a2158c5ecb17d7c52f63e7195771,0x01c8067bf4c0ba709aa8b9abc3d1cef589a4758e09ef53732d670fd8739a7274e111ba2fcaa71b3d33df2a3a0c8529dd", + "0x187111d5e088b6b9acfdfad078c4dacf72dcd17ca17c82be35e79f8c372a693f60a033b461d81b025864a0ad051a06e4,0x08b852331c96ed983e497ebc6dee9b75e373d923b729194af8e72a051ea586f3538a6ebb1e80881a082fa2b24df9f566" + ] + }, + { + "P": { + "x": "0x121982811d2491fde9ba7ed31ef9ca474f0e1501297f68c298e9f4c0028add35aea8bb83d53c08cfc007c1e005723cd0,0x190d119345b94fbd15497bcba94ecf7db2cbfd1e1fe7da034d26cbba169fb3968288b3fafb265f9ebd380512a71c3f2c", + "y": "0x05571a0f8d3c08d094576981f4a3b8eda0a8e771fcdcc8ecceaf1356a6acf17574518acb506e435b639353c2e14827c8,0x0bb5e7572275c567462d91807de765611490205a941a5a6af3b1691bfe596c31225d3aabdf15faff860cb4ef17c7c3be" + }, + "Q0": { + "x": "0x0f48f1ea1318ddb713697708f7327781fb39718971d72a9245b9731faaca4dbaa7cca433d6c434a820c28b18e20ea208,0x06051467c8f85da5ba2540974758f7a1e0239a5981de441fdd87680a995649c211054869c50edbac1f3a86c561ba3162", + "y": "0x168b3d6df80069dbbedb714d41b32961ad064c227355e1ce5fac8e105de5e49d77f0c64867f3834848f152497eb76333,0x134e0e8331cee8cb12f9c2d0742714ed9eee78a84d634c9a95f6a7391b37125ed48bfc6e90bf3546e99930ff67cc97bc" + }, + "Q1": { + "x": "0x004fd03968cd1c99a0dd84551f44c206c84dcbdb78076c5bfee24e89a92c8508b52b88b68a92258403cbe1ea2da3495f,0x1674338ea298281b636b2eb0fe593008d03171195fd6dcd4531e8a1ed1f02a72da238a17a635de307d7d24aa2d969a47", + "y": "0x0dc7fa13fff6b12558419e0a1e94bfc3cfaf67238009991c5f24ee94b632c3d09e27eca329989aee348a67b50d5e236c,0x169585e164c131103d85324f2d7747b23b91d66ae5d947c449c8194a347969fc6bbd967729768da485ba71868df8aed2" + }, + "msg": "abcdef0123456789", + "u": [ + "0x0313d9325081b415bfd4e5364efaef392ecf69b087496973b229303e1816d2080971470f7da112c4eb43053130b785e1,0x062f84cb21ed89406890c051a0e8b9cf6c575cf6e8e18ecf63ba86826b0ae02548d83b483b79e48512b82a6c0686df8f", + "0x1739123845406baa7be5c5dc74492051b6d42504de008c635f3535bb831d478a341420e67dcc7b46b2e8cba5379cca97,0x01897665d9cb5db16a27657760bbea7951f67ad68f8d55f7113f24ba6ddd82caef240a9bfa627972279974894701d975" + ] + }, + { + "P": { + "x": "0x19a84dd7248a1066f737cc34502ee5555bd3c19f2ecdb3c7d9e24dc65d4e25e50d83f0f77105e955d78f4762d33c17da,0x0934aba516a52d8ae479939a91998299c76d39cc0c035cd18813bec433f587e2d7a4fef038260eef0cef4d02aae3eb91", + "y": "0x14f81cd421617428bc3b9fe25afbb751d934a00493524bc4e065635b0555084dd54679df1536101b2c979c0152d09192,0x09bcccfa036b4847c9950780733633f13619994394c23ff0b32fa6b795844f4a0673e20282d07bc69641cee04f5e5662" + }, + "Q0": { + "x": "0x09eccbc53df677f0e5814e3f86e41e146422834854a224bf5a83a50e4cc0a77bfc56718e8166ad180f53526ea9194b57,0x0c3633943f91daee715277bd644fba585168a72f96ded64fc5a384cce4ec884a4c3c30f08e09cd2129335dc8f67840ec", + "y": "0x0eb6186a0457d5b12d132902d4468bfeb7315d83320b6c32f1c875f344efcba979952b4aa418589cb01af712f98cc555,0x119e3cf167e69eb16c1c7830e8df88856d48be12e3ff0a40791a5cd2f7221311d4bf13b1847f371f467357b3f3c0b4c7" + }, + "Q1": { + "x": "0x0eb3aabc1ddfce17ff18455fcc7167d15ce6b60ddc9eb9b59f8d40ab49420d35558686293d046fc1e42f864b7f60e381,0x198bdfb19d7441ebcca61e8ff774b29d17da16547d2c10c273227a635cacea3f16826322ae85717630f0867539b5ed8b", + "y": "0x0aaf1dee3adf3ed4c80e481c09b57ea4c705e1b8d25b897f0ceeec3990748716575f92abff22a1c8f4582aff7b872d52,0x0d058d9061ed27d4259848a06c96c5ca68921a5d269b078650c882cb3c2bd424a8702b7a6ee4e0ead9982baf6843e924" + }, + "msg": "q128_qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", + "u": [ + "0x025820cefc7d06fd38de7d8e370e0da8a52498be9b53cba9927b2ef5c6de1e12e12f188bbc7bc923864883c57e49e253,0x034147b77ce337a52e5948f66db0bab47a8d038e712123bb381899b6ab5ad20f02805601e6104c29df18c254b8618c7b", + "0x0930315cae1f9a6017c3f0c8f2314baa130e1cf13f6532bff0a8a1790cd70af918088c3db94bda214e896e1543629795,0x10c4df2cacf67ea3cb3108b00d4cbd0b3968031ebc8eac4b1ebcefe84d6b715fde66bef0219951ece29d1facc8a520ef" + ] + }, + { + "P": { + "x": "0x01a6ba2f9a11fa5598b2d8ace0fbe0a0eacb65deceb476fbbcb64fd24557c2f4b18ecfc5663e54ae16a84f5ab7f62534,0x11fca2ff525572795a801eed17eb12785887c7b63fb77a42be46ce4a34131d71f7a73e95fee3f812aea3de78b4d01569", + "y": "0x0b6798718c8aed24bc19cb27f866f1c9effcdbf92397ad6448b5c9db90d2b9da6cbabf48adc1adf59a1a28344e79d57e,0x03a47f8e6d1763ba0cad63d6114c0accbef65707825a511b251a660a9b3994249ae4e63fac38b23da0c398689ee2ab52" + }, + "Q0": { + "x": "0x17cadf8d04a1a170f8347d42856526a24cc466cb2ddfd506cff01191666b7f944e31244d662c904de5440516a2b09004,0x0d13ba91f2a8b0051cf3279ea0ee63a9f19bc9cb8bfcc7d78b3cbd8cc4fc43ba726774b28038213acf2b0095391c523e", + "y": "0x17ef19497d6d9246fa94d35575c0f8d06ee02f21a284dbeaa78768cb1e25abd564e3381de87bda26acd04f41181610c5,0x12c3c913ba4ed03c24f0721a81a6be7430f2971ffca8fd1729aafe496bb725807531b44b34b59b3ae5495e5a2dcbd5c8" + }, + "Q1": { + "x": "0x16ec57b7fe04c71dfe34fb5ad84dbce5a2dbbd6ee085f1d8cd17f45e8868976fc3c51ad9eeda682c7869024d24579bfd,0x13103f7aace1ae1420d208a537f7d3a9679c287208026e4e3439ab8cd534c12856284d95e27f5e1f33eec2ce656533b0", + "y": "0x0958b2c4c2c10fcef5a6c59b9e92c4a67b0fae3e2e0f1b6b5edad9c940b8f3524ba9ebbc3f2ceb3cfe377655b3163bd7,0x0ccb594ed8bd14ca64ed9cb4e0aba221be540f25dd0d6ba15a4a4be5d67bcf35df7853b2d8dad3ba245f1ea3697f66aa" + }, + "msg": "a512_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "u": [ + "0x190b513da3e66fc9a3587b78c76d1d132b1152174d0b83e3c1114066392579a45824c5fa17649ab89299ddd4bda54935,0x12ab625b0fe0ebd1367fe9fac57bb1168891846039b4216b9d94007b674de2d79126870e88aeef54b2ec717a887dcf39", + "0x0e6a42010cf435fb5bacc156a585e1ea3294cc81d0ceb81924d95040298380b164f702275892cedd81b62de3aba3f6b5,0x117d9a0defc57a33ed208428cb84e54c85a6840e7648480ae428838989d25d97a0af8e3255be62b25c2a85630d2dddd8" + ] + } + ] +} From 13e4b3362743b9adc7a290581fd055b8d01c2575 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Tue, 10 Sep 2024 17:47:28 -0400 Subject: [PATCH 06/18] more experimental calibration --- .../benches/common/experimental/bls12_381.rs | 79 +++++++- soroban-env-host/benches/common/mod.rs | 6 + .../benches/variation_histograms.rs | 7 +- .../src/cost_runner/experimental/bls12_381.rs | 189 +++++++++++++++--- .../src/cost_runner/experimental/mod.rs | 16 ++ 5 files changed, 270 insertions(+), 27 deletions(-) diff --git a/soroban-env-host/benches/common/experimental/bls12_381.rs b/soroban-env-host/benches/common/experimental/bls12_381.rs index 67c39d15c..113741a04 100644 --- a/soroban-env-host/benches/common/experimental/bls12_381.rs +++ b/soroban-env-host/benches/common/experimental/bls12_381.rs @@ -1,13 +1,19 @@ use crate::common::HostCostMeasurement; -use ark_bls12_381::{Fq2, G1Affine, G2Affine}; +use ark_bls12_381::{Fq, Fq2, G1Affine, G2Affine}; use ark_ff::UniformRand; use ark_serialize::CanonicalSerialize; use rand::rngs::StdRng; use soroban_env_host::{ cost_runner::{ Bls12381Fp2DeserializeUncompressedRun, Bls12381G1AffineDeserializeUncompressedRun, - Bls12381G1AffineSerializeUncompressedRun, Bls12381G2AffineDeserializeUncompressedRun, - Bls12381G2AffineSerializeUncompressedRun, + Bls12381G1AffineSerializeUncompressedRun, Bls12381G1CheckPointInSubgroupRun, + Bls12381G1CheckPointInSubgroupSample, Bls12381G1CheckPointOnCurveRun, + Bls12381G1CheckPointOnCurveSample, Bls12381G1ComputeYFromXRun, + Bls12381G1ComputeYFromXSample, Bls12381G2AffineDeserializeUncompressedRun, + Bls12381G2AffineSerializeUncompressedRun, Bls12381G2CheckPointInSubgroupRun, + Bls12381G2CheckPointInSubgroupSample, Bls12381G2CheckPointOnCurveRun, + Bls12381G2CheckPointOnCurveSample, Bls12381G2ComputeYFromXRun, + Bls12381G2ComputeYFromXSample, CostRunner, }, Host, }; @@ -59,3 +65,70 @@ impl HostCostMeasurement for Bls12381Fp2DeserializeUncompressedMeasure { buf } } + +pub(crate) struct Bls12381G1CheckPointOnCurveMeasure; +impl HostCostMeasurement for Bls12381G1CheckPointOnCurveMeasure { + type Runner = Bls12381G1CheckPointOnCurveRun; + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> ::SampleType { + Bls12381G1CheckPointOnCurveSample(G1Affine::new_unchecked(Fq::rand(rng), Fq::rand(rng))) + } +} +pub(crate) struct Bls12381G1CheckPointInSubgroupMeasure; +impl HostCostMeasurement for Bls12381G1CheckPointInSubgroupMeasure { + type Runner = Bls12381G1CheckPointInSubgroupRun; + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> ::SampleType { + Bls12381G1CheckPointInSubgroupSample(G1Affine::rand(rng)) + } +} +pub(crate) struct Bls12381G1ComputeYFromXMeasure; +impl HostCostMeasurement for Bls12381G1ComputeYFromXMeasure { + type Runner = Bls12381G1ComputeYFromXRun; + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> ::SampleType { + Bls12381G1ComputeYFromXSample(G1Affine::rand(rng)) + } +} +pub(crate) struct Bls12381G2CheckPointOnCurveMeasure; +impl HostCostMeasurement for Bls12381G2CheckPointOnCurveMeasure { + type Runner = Bls12381G2CheckPointOnCurveRun; + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> ::SampleType { + Bls12381G2CheckPointOnCurveSample(G2Affine::new_unchecked(Fq2::rand(rng), Fq2::rand(rng))) + } +} +pub(crate) struct Bls12381G2CheckPointInSubgroupMeasure; +impl HostCostMeasurement for Bls12381G2CheckPointInSubgroupMeasure { + type Runner = Bls12381G2CheckPointInSubgroupRun; + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> ::SampleType { + Bls12381G2CheckPointInSubgroupSample(G2Affine::rand(rng)) + } +} +pub(crate) struct Bls12381G2ComputeYFromXMeasure; +impl HostCostMeasurement for Bls12381G2ComputeYFromXMeasure { + type Runner = Bls12381G2ComputeYFromXRun; + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> ::SampleType { + Bls12381G2ComputeYFromXSample(G2Affine::rand(rng)) + } +} diff --git a/soroban-env-host/benches/common/mod.rs b/soroban-env-host/benches/common/mod.rs index 798be807e..b3492f295 100644 --- a/soroban-env-host/benches/common/mod.rs +++ b/soroban-env-host/benches/common/mod.rs @@ -65,6 +65,12 @@ pub(crate) fn for_each_experimental_cost_measurement( call_bench::(&mut params)?; call_bench::(&mut params)?; call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; Ok(params) } diff --git a/soroban-env-host/benches/variation_histograms.rs b/soroban-env-host/benches/variation_histograms.rs index f95b7f9c0..d612f8d94 100644 --- a/soroban-env-host/benches/variation_histograms.rs +++ b/soroban-env-host/benches/variation_histograms.rs @@ -16,7 +16,12 @@ impl Benchmark for LinearModelTables { fn bench( ) -> std::io::Result<(MeteredCostComponent, MeteredCostComponent)> { // the inputs will be ignored if the measurment is for a constant model - let mut measurements = measure_cost_variation::(1_000, || 10, || 10, false)?; + let sample_count = std::env::var("SAMPLE_COUNT") + .ok() + .map(|v| v.parse::().ok()) + .flatten() + .unwrap_or(1000); + let mut measurements = measure_cost_variation::(sample_count, || 10, || 10, false)?; measurements.check_range_against_baseline(&HCM::Runner::COST_TYPE)?; measurements.preprocess(); measurements.report_histogram("cpu", |m| m.cpu_insns); diff --git a/soroban-env-host/src/cost_runner/experimental/bls12_381.rs b/soroban-env-host/src/cost_runner/experimental/bls12_381.rs index 509b478c4..12d3fcbc1 100644 --- a/soroban-env-host/src/cost_runner/experimental/bls12_381.rs +++ b/soroban-env-host/src/cost_runner/experimental/bls12_381.rs @@ -1,9 +1,11 @@ -use ark_bls12_381::{Fq2, G1Affine, G2Affine}; +use ark_bls12_381::{Fq, Fq2, G1Affine, G2Affine}; use super::ExperimentalCostType::*; use crate::{ budget::CostTracker, cost_runner::{CostRunner, CostType}, + xdr::ContractCostType, + Host, HostError, }; use std::hint::black_box; @@ -16,7 +18,7 @@ pub struct Bls12381Fp2DeserializeUncompressedRun; // ser/deser macro_rules! impl_ser_runner_for_bls { - ($runner: ident, $cost: ident, $units: literal, $sample: ident) => { + ($runner: ident, $cost: ident, $expected_size: literal, $sample: ident) => { impl CostRunner for $runner { const COST_TYPE: CostType = CostType::Experimental($cost); @@ -26,27 +28,25 @@ macro_rules! impl_ser_runner_for_bls { type RecycledType = (Option<$sample>, Option>); - fn run_iter(host: &crate::Host, _iter: u64, sample: $sample) -> Self::RecycledType { + fn run_iter(host: &Host, _iter: u64, sample: $sample) -> Self::RecycledType { let mut buf = vec![0u8; 1000]; let _ = host - .serialize_uncompressed_into_slice(&sample, &mut buf, $units, "test") + .serialize_uncompressed_into_slice::<$expected_size, _>( + &sample, &mut buf, "test", + ) .unwrap(); black_box((None, Some(buf))) } - fn run_baseline_iter( - host: &crate::Host, - _iter: u64, - sample: $sample, - ) -> Self::RecycledType { + fn run_baseline_iter(host: &Host, _iter: u64, sample: $sample) -> Self::RecycledType { black_box( - host.charge_budget(crate::xdr::ContractCostType::Int256AddSub, None) + host.charge_budget(ContractCostType::Int256AddSub, None) .unwrap(), ); black_box((Some(sample), None)) } - fn get_tracker(_host: &crate::Host, _sample: &$sample) -> CostTracker { + fn get_tracker(_host: &Host, _sample: &$sample) -> CostTracker { CostTracker { iterations: Self::RUN_ITERATIONS, inputs: None, @@ -61,18 +61,18 @@ macro_rules! impl_ser_runner_for_bls { impl_ser_runner_for_bls!( Bls12381G1AffineSerializeUncompressedRun, Bls12381G1AffineSerializeUncompressed, - 2, + 96, G1Affine ); impl_ser_runner_for_bls!( Bls12381G2AffineSerializeUncompressedRun, Bls12381G2AffineSerializeUncompressed, - 4, + 192, G2Affine ); macro_rules! impl_deser_runner_for_bls { - ($runner: ident, $cost: ident, $units: literal, $rt: ty) => { + ($runner: ident, $cost: ident, $expected_size: literal, $rt: ty) => { impl CostRunner for $runner { const COST_TYPE: CostType = CostType::Experimental($cost); @@ -82,30 +82,26 @@ macro_rules! impl_deser_runner_for_bls { type RecycledType = (Option, Option<$rt>); - fn run_iter( - host: &crate::Host, - _iter: u64, - sample: Self::SampleType, - ) -> Self::RecycledType { + fn run_iter(host: &Host, _iter: u64, sample: Self::SampleType) -> Self::RecycledType { let res = host - .deserialize_uncompessed_no_validate(&sample, $units, "test") + .deserialize_uncompessed_no_validate::<$expected_size, _>(&sample, "test") .unwrap(); black_box((None, Some(res))) } fn run_baseline_iter( - host: &crate::Host, + host: &Host, _iter: u64, sample: Self::SampleType, ) -> Self::RecycledType { black_box( - host.charge_budget(crate::xdr::ContractCostType::Int256AddSub, None) + host.charge_budget(ContractCostType::Int256AddSub, None) .unwrap(), ); black_box((Some(sample), None)) } - fn get_tracker(_host: &crate::Host, _sample: &Self::SampleType) -> CostTracker { + fn get_tracker(_host: &Host, _sample: &Self::SampleType) -> CostTracker { CostTracker { iterations: Self::RUN_ITERATIONS, inputs: None, @@ -135,3 +131,150 @@ impl_deser_runner_for_bls!( 2, Fq2 ); + +#[macro_export] +macro_rules! impl_experiment_const_cost_runner_for_bls_deref_sample { + ($runner: ident, $cost: ident, $host_fn: ident, $sample: ident, $rt: ty, $($arg: ident),*) => { + impl CostRunner for $runner { + const COST_TYPE: CostType = CostType::Experimental($cost); + + const RUN_ITERATIONS: u64 = 1; + + type SampleType = $sample; + + type RecycledType = (Option<$sample>, Option<$rt>); + + fn run_iter(host: &Host, _iter: u64, mut sample: $sample) -> Self::RecycledType { + let $sample($( $arg ),*) = &mut sample; + let res = host.$host_fn($($arg),*).unwrap(); + black_box((Some(sample), Some(res))) + } + + fn run_baseline_iter( + host: &Host, + _iter: u64, + sample: $sample, + ) -> Self::RecycledType { + black_box( + host.charge_budget(ContractCostType::Int256AddSub, None) + .unwrap(), + ); + black_box((Some(sample), None)) + } + + fn get_tracker(_host: &Host, _sample: &$sample) -> CostTracker { + CostTracker { + iterations: Self::RUN_ITERATIONS, + inputs: None, + cpu: 0, + mem: 0, + } + } + } + }; +} + +impl Host { + fn check_g1_on_curve(&self, pt: &G1Affine) -> Result { + Ok(pt.is_on_curve()) + } + fn check_g1_in_subgroup(&self, pt: &G1Affine) -> Result { + Ok(pt.is_in_correct_subgroup_assuming_on_curve()) + } + fn check_g2_on_curve(&self, pt: &G2Affine) -> Result { + Ok(pt.is_on_curve()) + } + fn check_g2_in_subgroup(&self, pt: &G2Affine) -> Result { + Ok(pt.is_in_correct_subgroup_assuming_on_curve()) + } + fn g1_compute_y_from_x(&self, pt: &G1Affine) -> Result { + Ok(G1Affine::get_ys_from_x_unchecked(pt.x).unwrap().0) + } + fn g2_compute_y_from_x(&self, pt: &G2Affine) -> Result { + Ok(G2Affine::get_ys_from_x_unchecked(pt.x).unwrap().0) + } +} + +pub struct Bls12381G1CheckPointOnCurveRun; + +#[derive(Clone)] +pub struct Bls12381G1CheckPointOnCurveSample(pub G1Affine); + +impl_experiment_const_cost_runner_for_bls_deref_sample!( + Bls12381G1CheckPointOnCurveRun, + Bls12381G1CheckPointOnCurve, + check_g1_on_curve, + Bls12381G1CheckPointOnCurveSample, + bool, + pt +); + +pub struct Bls12381G1CheckPointInSubgroupRun; + +#[derive(Clone)] +pub struct Bls12381G1CheckPointInSubgroupSample(pub G1Affine); + +impl_experiment_const_cost_runner_for_bls_deref_sample!( + Bls12381G1CheckPointInSubgroupRun, + Bls12381G1CheckPointInSubgroup, + check_g1_in_subgroup, + Bls12381G1CheckPointInSubgroupSample, + bool, + pt +); + +pub struct Bls12381G1ComputeYFromXRun; + +#[derive(Clone)] +pub struct Bls12381G1ComputeYFromXSample(pub G1Affine); + +impl_experiment_const_cost_runner_for_bls_deref_sample!( + Bls12381G1ComputeYFromXRun, + Bls12381G1ComputeYFromX, + g1_compute_y_from_x, + Bls12381G1ComputeYFromXSample, + Fq, + pt +); + +pub struct Bls12381G2CheckPointOnCurveRun; + +#[derive(Clone)] +pub struct Bls12381G2CheckPointOnCurveSample(pub G2Affine); + +impl_experiment_const_cost_runner_for_bls_deref_sample!( + Bls12381G2CheckPointOnCurveRun, + Bls12381G2CheckPointOnCurve, + check_g2_on_curve, + Bls12381G2CheckPointOnCurveSample, + bool, + pt +); + +pub struct Bls12381G2CheckPointInSubgroupRun; + +#[derive(Clone)] +pub struct Bls12381G2CheckPointInSubgroupSample(pub G2Affine); + +impl_experiment_const_cost_runner_for_bls_deref_sample!( + Bls12381G2CheckPointInSubgroupRun, + Bls12381G2CheckPointInSubgroup, + check_g2_in_subgroup, + Bls12381G2CheckPointInSubgroupSample, + bool, + pt +); + +pub struct Bls12381G2ComputeYFromXRun; + +#[derive(Clone)] +pub struct Bls12381G2ComputeYFromXSample(pub G2Affine); + +impl_experiment_const_cost_runner_for_bls_deref_sample!( + Bls12381G2ComputeYFromXRun, + Bls12381G2ComputeYFromX, + g2_compute_y_from_x, + Bls12381G2ComputeYFromXSample, + Fq2, + pt +); diff --git a/soroban-env-host/src/cost_runner/experimental/mod.rs b/soroban-env-host/src/cost_runner/experimental/mod.rs index 66260672a..9eb3730d4 100644 --- a/soroban-env-host/src/cost_runner/experimental/mod.rs +++ b/soroban-env-host/src/cost_runner/experimental/mod.rs @@ -30,6 +30,12 @@ pub enum ExperimentalCostType { Bls12381G2AffineDeserializeUncompressed, Bls12381G2AffineSerializeUncompressed, Bls12381Fp2DeserializeUncompressed, + Bls12381G1CheckPointOnCurve, + Bls12381G1CheckPointInSubgroup, + Bls12381G1ComputeYFromX, + Bls12381G2CheckPointOnCurve, + Bls12381G2CheckPointInSubgroup, + Bls12381G2ComputeYFromX, } impl Name for ExperimentalCostType { @@ -58,6 +64,16 @@ impl Name for ExperimentalCostType { ExperimentalCostType::Bls12381Fp2DeserializeUncompressed => { "Bls12381Fp2DeserializeUncompressed" } + ExperimentalCostType::Bls12381G1CheckPointOnCurve => "Bls12381G1CheckPointOnCurve", + ExperimentalCostType::Bls12381G1CheckPointInSubgroup => { + "Bls12381G1CheckPointInSubgroup" + } + ExperimentalCostType::Bls12381G1ComputeYFromX => "Bls12381G1ComputeYFromX", + ExperimentalCostType::Bls12381G2CheckPointOnCurve => "Bls12381G2CheckPointOnCurve", + ExperimentalCostType::Bls12381G2CheckPointInSubgroup => { + "Bls12381G2CheckPointInSubgroup" + } + ExperimentalCostType::Bls12381G2ComputeYFromX => "Bls12381G2ComputeYFromX", } } } From f7e38bf125d5562dc15b0d4e0e58e124b7acc8fa Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Thu, 12 Sep 2024 16:42:14 -0400 Subject: [PATCH 07/18] address some PR comments --- Cargo.toml | 1 + soroban-env-common/env.json | 26 ++++++++++++------------ soroban-env-host/src/crypto/bls12_381.rs | 20 ++++++++++++------ soroban-env-host/src/test/bls12_381.rs | 4 ++-- 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 422c36e85..c4c5a4260 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,6 +47,7 @@ rev = "122a74a7c491929e5ac9de876099154ef7c06d06" features = ["no-hash-maps"] # [patch."https://github.com/stellar/rs-stellar-xdr"] +# [patch.crates-io] # stellar-xdr = { path = "../rs-stellar-xdr" } # [patch."https://github.com/stellar/wasmi"] # soroban-wasmi = { path = "../wasmi/crates/wasmi/" } diff --git a/soroban-env-common/env.json b/soroban-env-common/env.json index f2589226b..b3e984bbe 100644 --- a/soroban-env-common/env.json +++ b/soroban-env-common/env.json @@ -2062,7 +2062,7 @@ } ], "return": "BytesObject", - "docs": "Adds two BLS12-381 G1 points given in bytes format and returns the resulting G1 point in bytes format. G1 serialization format: `be_bytes(X) || be_bytes(Y)` and the most significant three bits of X encodes flags, i.e. bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]", + "docs": "Adds two BLS12-381 G1 points given in bytes format and returns the resulting G1 point in bytes format. G1 serialization format: `concat(be_bytes(X), be_bytes(Y))` and the most significant three bits of X encodes flags, i.e. bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]", "min_supported_protocol": 22 }, { @@ -2079,7 +2079,7 @@ } ], "return": "BytesObject", - "docs": "Multiplies a BLS12-381 G1 point by a scalar, and returns the resulting G1 point in bytes format.", + "docs": "Multiplies a BLS12-381 G1 point by a scalar (Fr), and returns the resulting G1 point in bytes format.", "min_supported_protocol": 22 }, { @@ -2096,7 +2096,7 @@ } ], "return": "BytesObject", - "docs": "Performs multi-scalar-multiplication (inner product) on a vector of BLS12-381 G1 points by a vector of scalars, and returns the resulting G1 point in bytes format.", + "docs": "Performs multi-scalar-multiplication (inner product) on a vector of BLS12-381 G1 points (`Vec`) by a vector of scalars (`Vec`), and returns the resulting G1 point in bytes format.", "min_supported_protocol": 22 }, { @@ -2143,7 +2143,7 @@ } ], "return": "BytesObject", - "docs": "Adds two BLS12-381 G2 points given in bytes format and returns the resulting G2 point in bytes format. G2 serialization format: be_bytes(X_c1) || be_bytes(X_c0) || be_bytes(Y_c1) || be_bytes(Y_c0), and the most significant three bits of X_c1 are flags i.e. bits(X_c1) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]", + "docs": "Adds two BLS12-381 G2 points given in bytes format and returns the resulting G2 point in bytes format. G2 serialization format: concat(be_bytes(X_c1), be_bytes(X_c0), be_bytes(Y_c1), be_bytes(Y_c0)), and the most significant three bits of X_c1 are flags i.e. bits(X_c1) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]", "min_supported_protocol": 22 }, { @@ -2160,7 +2160,7 @@ } ], "return": "BytesObject", - "docs": "Multiplies a BLS12-381 G2 point by a scalar, and returns the resulting G2 point in bytes format.", + "docs": "Multiplies a BLS12-381 G2 point by a scalar (Fr), and returns the resulting G2 point in bytes format.", "min_supported_protocol": 22 }, { @@ -2177,7 +2177,7 @@ } ], "return": "BytesObject", - "docs": "Performs multi-scalar-multiplication (inner product) on a BLS12-381 G2 point by a vector of scalars, and returns the resulting G2 point in bytes format.", + "docs": "Performs multi-scalar-multiplication (inner product) on a vector of BLS12-381 G2 points (`Vec`) by a vector of scalars (`Vec`) , and returns the resulting G2 point in bytes format.", "min_supported_protocol": 22 }, { @@ -2190,7 +2190,7 @@ } ], "return": "BytesObject", - "docs": "Maps a BLS12-381 quadratic extension field element (Fp2) to G2 point. Fp2 serialization format: be_bytes(c1) || be_bytes(c0)", + "docs": "Maps a BLS12-381 quadratic extension field element (Fp2) to G2 point. Fp2 serialization format: concat(be_bytes(c1), be_bytes(c0))", "min_supported_protocol": 22 }, { @@ -2224,7 +2224,7 @@ } ], "return": "Bool", - "docs": "performs pairing operation on a vector of `G1` and a vector of `G2` points, return true if the result equals `1_fp12`", + "docs": "performs pairing operation on a vector of `G1` (`Vec`) and a vector of `G2` points (`Vec`) , return true if the result equals `1_fp12`", "min_supported_protocol": 22 }, { @@ -2241,7 +2241,7 @@ } ], "return": "U256Val", - "docs": "performs addition `(lhs + rhs) mod r` between two BLS12-381 scalar elements", + "docs": "performs addition `(lhs + rhs) mod r` between two BLS12-381 scalar elements (Fr), where r is the subgroup order", "min_supported_protocol": 22 }, { @@ -2258,7 +2258,7 @@ } ], "return": "U256Val", - "docs": "performs subtraction `(lhs - rhs) mod r` between two BLS12-381 scalar elements", + "docs": "performs subtraction `(lhs - rhs) mod r` between two BLS12-381 scalar elements (Fr), where r is the subgroup order", "min_supported_protocol": 22 }, { @@ -2275,7 +2275,7 @@ } ], "return": "U256Val", - "docs": "performs multiplication `(lhs * rhs) mod r` between two BLS12-381 scalar elements", + "docs": "performs multiplication `(lhs * rhs) mod r` between two BLS12-381 scalar elements (Fr), where r is the subgroup order", "min_supported_protocol": 22 }, { @@ -2292,7 +2292,7 @@ } ], "return": "U256Val", - "docs": "performs exponentiation of a BLS12-381 scalar element with a u64 exponent i.e. `lhs.exp(rhs) mod r`", + "docs": "performs exponentiation of a BLS12-381 scalar element (Fr) with a u64 exponent i.e. `lhs.exp(rhs) mod r`, where r is the subgroup order", "min_supported_protocol": 22 }, { @@ -2305,7 +2305,7 @@ } ], "return": "U256Val", - "docs": "performs inversion of a BLS12-381 scalar element", + "docs": "performs inversion of a BLS12-381 scalar element (Fr) modulo r (the subgroup order)", "min_supported_protocol": 22 } ] diff --git a/soroban-env-host/src/crypto/bls12_381.rs b/soroban-env-host/src/crypto/bls12_381.rs index d4380f8a6..56c673664 100644 --- a/soroban-env-host/src/crypto/bls12_381.rs +++ b/soroban-env-host/src/crypto/bls12_381.rs @@ -28,6 +28,7 @@ use std::ops::{Add, AddAssign, Mul, MulAssign, SubAssign}; pub(crate) const FP_SERIALIZED_SIZE: usize = 48; pub(crate) const FP2_SERIALIZED_SIZE: usize = FP_SERIALIZED_SIZE * 2; +pub(crate) const FP12_SERIALIZED_SIZE: usize = FP_SERIALIZED_SIZE * 12; pub(crate) const G1_SERIALIZED_SIZE: usize = FP_SERIALIZED_SIZE * 2; pub(crate) const G2_SERIALIZED_SIZE: usize = FP2_SERIALIZED_SIZE * 2; pub(crate) const FR_SERIALIZED_SIZE: usize = 32; @@ -107,9 +108,8 @@ impl Host { match flags { 0b0100_0000 => { // infinite bit is set, check all other bits are zero - let mut expected_bytes = [0; EXPECTED_SIZE]; - expected_bytes[0] = flags; - if bytes != expected_bytes { + let is_valid = bytes[0] == 0b0100_0000 && bytes[1..].iter().all(|x| x.is_zero()); + if !is_valid { Err(self.err(ScErrorType::Crypto, ScErrorCode::InvalidInput, format!("bls12-381 {msg} deserialize: infinity flag (bit 1) is set while remaining bits are not all zero").as_str(), &[])) } else { Ok(()) @@ -287,6 +287,11 @@ impl Host { pub(crate) fn fr_to_u256val(&self, scalar: Fr) -> Result { self.charge_budget(ContractCostType::Bls12381FrToU256, None)?; + // The `into_bigint` carries the majority of the cost. It performs the + // Montgomery reduction on the internal representation, which is doing a + // number of wrapping arithmetics on each u64 word (`Fr` contains 4 + // words). The core routine is in `ark_ff::MontConfig::into_bigint`, + // this cannot panic. let bytes: [u8; 32] = scalar .into_bigint() .to_bytes_be() @@ -329,7 +334,7 @@ impl Host { return Err(self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, - "bls12-381 quadradic extention field element (Fp2): invalid input length to deserialize", + "bls12-381 quadradic extension field element (Fp2): invalid input length to deserialize", &[ Val::from_u32(bytes.len() as u32).into(), Val::from_u32(expected_size as u32).into(), @@ -348,6 +353,7 @@ impl Host { // `input = be_bytes(c1) || be_bytes(c0)` // // So we just need to reverse our input. + self.charge_budget(ContractCostType::MemCpy, Some(FP2_SERIALIZED_SIZE as u64))?; let mut buf = [0u8; FP2_SERIALIZED_SIZE]; buf.copy_from_slice(&bytes); buf.reverse(); @@ -609,7 +615,7 @@ impl Host { &self, output: &PairingOutput, ) -> Result { - self.charge_budget(ContractCostType::MemCmp, Some(576))?; + self.charge_budget(ContractCostType::MemCmp, Some(FP12_SERIALIZED_SIZE as u64))?; match output.0.cmp(&Fq12::ONE) { Ordering::Equal => Ok(true.into()), _ => Ok(false.into()), @@ -652,11 +658,13 @@ impl Host { )); } self.charge_budget(ContractCostType::Bls12381FrInv, None)?; + // `inverse()` returns `None` only if the rhs is zero, which we have + // checked upfront, so this cannot fail. lhs.inverse().ok_or_else(|| { self.err( ScErrorType::Crypto, ScErrorCode::InternalError, - format!("scalar inversion {lhs} failed").as_str(), + "scalar inversion failed", &[], ) }) diff --git a/soroban-env-host/src/test/bls12_381.rs b/soroban-env-host/src/test/bls12_381.rs index 67b375e68..a08130c14 100644 --- a/soroban-env-host/src/test/bls12_381.rs +++ b/soroban-env-host/src/test/bls12_381.rs @@ -653,7 +653,7 @@ fn g1_msm() -> Result<(), HostError> { fn map_fp_to_g1() -> Result<(), HostError> { let host = observe_host!(Host::test_host()); host.enable_debug()?; - // invalid fp: wrongth length + // invalid fp: wrong length { let p1 = invalid_fp(&host, InvalidPointTypes::TooFewBytes)?; assert!(HostError::result_matches_err( @@ -1067,7 +1067,7 @@ fn g2_msm() -> Result<(), HostError> { fn map_fp2_to_g2() -> Result<(), HostError> { let host = observe_host!(Host::test_host()); host.enable_debug()?; - // invalid fp2: wrongth length + // invalid fp2: wrong length { let p1 = invalid_fp2(&host, InvalidPointTypes::TooFewBytes)?; assert!(HostError::result_matches_err( From 9ad3cad708b45d6c3fa461f403a8f5e3a115ed30 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Fri, 13 Sep 2024 00:11:39 -0400 Subject: [PATCH 08/18] add check-subgroup functions, allow points not-in-subgroup for addition --- Cargo.lock | 2 +- Cargo.toml | 2 +- soroban-env-common/env.json | 60 +- soroban-env-host/Cargo.toml | 2 +- .../benches/common/cost_types/bls12_381.rs | 79 ++- .../benches/common/experimental/bls12_381.rs | 54 +- soroban-env-host/benches/common/mod.rs | 6 +- ...t__bls12_381__check_g1_is_in_subgroup.json | 74 +++ ...t__bls12_381__check_g2_is_in_subgroup.json | 74 +++ .../22/test__bls12_381__g1_add.json | 168 ++--- .../22/test__bls12_381__g1_msm.json | 474 ++++++------- .../22/test__bls12_381__g1_mul.json | 36 +- .../22/test__bls12_381__g2_add.json | 168 ++--- .../22/test__bls12_381__g2_msm.json | 364 +++++----- .../22/test__bls12_381__g2_mul.json | 36 +- .../22/test__bls12_381__hash_to_g1.json | 40 +- .../22/test__bls12_381__hash_to_g2.json | 40 +- .../22/test__bls12_381__map_fp2_to_g2.json | 84 +-- .../22/test__bls12_381__map_fp_to_g1.json | 84 +-- .../22/test__bls12_381__pairing.json | 156 ++--- ..._with_wrong_arg_type_bls12_381_fr_pow.json | 276 ++++---- ...s12_381_check_g1_is_in_subgroup_arg_0.json | 29 + ...s12_381_check_g2_is_in_subgroup_arg_0.json | 29 + ..._object_handle_bls12_381_g1_add_arg_0.json | 36 +- ..._object_handle_bls12_381_g1_add_arg_1.json | 36 +- ..._object_handle_bls12_381_g1_msm_arg_0.json | 36 +- ..._object_handle_bls12_381_g1_msm_arg_1.json | 36 +- ..._object_handle_bls12_381_g1_mul_arg_0.json | 36 +- ..._object_handle_bls12_381_g2_add_arg_0.json | 36 +- ..._object_handle_bls12_381_g2_add_arg_1.json | 36 +- ..._object_handle_bls12_381_g2_msm_arg_0.json | 36 +- ..._object_handle_bls12_381_g2_msm_arg_1.json | 36 +- ..._object_handle_bls12_381_g2_mul_arg_0.json | 36 +- ...ect_handle_bls12_381_hash_to_g1_arg_0.json | 36 +- ...ect_handle_bls12_381_hash_to_g1_arg_1.json | 36 +- ...ect_handle_bls12_381_hash_to_g2_arg_0.json | 36 +- ...ect_handle_bls12_381_hash_to_g2_arg_1.json | 36 +- ..._handle_bls12_381_map_fp2_to_g2_arg_0.json | 36 +- ...t_handle_bls12_381_map_fp_to_g1_arg_0.json | 36 +- ...e_bls12_381_multi_pairing_check_arg_0.json | 36 +- ...e_bls12_381_multi_pairing_check_arg_1.json | 36 +- soroban-env-host/src/budget.rs | 34 +- .../src/cost_runner/cost_types/bls12_381.rs | 77 ++- .../src/cost_runner/experimental/bls12_381.rs | 68 -- .../src/cost_runner/experimental/mod.rs | 12 - soroban-env-host/src/crypto/bls12_381.rs | 157 +++-- soroban-env-host/src/host.rs | 32 +- soroban-env-host/src/test/bls12_381.rs | 628 ++++++++++++------ soroban-env-host/src/test/budget_metering.rs | 18 +- soroban-env-host/src/test/hostile.rs | 6 +- 50 files changed, 2262 insertions(+), 1755 deletions(-) create mode 100644 soroban-env-host/observations/22/test__bls12_381__check_g1_is_in_subgroup.json create mode 100644 soroban-env-host/observations/22/test__bls12_381__check_g2_is_in_subgroup.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_check_g1_is_in_subgroup_arg_0.json create mode 100644 soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_check_g2_is_in_subgroup_arg_0.json diff --git a/Cargo.lock b/Cargo.lock index 19801a4ca..afade81e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1718,7 +1718,7 @@ dependencies = [ [[package]] name = "stellar-xdr" version = "22.0.0" -source = "git+https://github.com/stellar/rs-stellar-xdr?rev=5315f4c583784860c0accbb8d3bd234055a19751#5315f4c583784860c0accbb8d3bd234055a19751" +source = "git+https://github.com/stellar/rs-stellar-xdr?rev=b5516843b6379e4e29520bf2ba156484f62edc46#b5516843b6379e4e29520bf2ba156484f62edc46" dependencies = [ "arbitrary", "base64 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index c4c5a4260..cf6281186 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ wasmparser = "=0.116.1" [workspace.dependencies.stellar-xdr] version = "=22.0.0" git = "https://github.com/stellar/rs-stellar-xdr" -rev = "5315f4c583784860c0accbb8d3bd234055a19751" +rev = "b5516843b6379e4e29520bf2ba156484f62edc46" default-features = false [workspace.dependencies.wasmi] diff --git a/soroban-env-common/env.json b/soroban-env-common/env.json index b3e984bbe..d421dca2f 100644 --- a/soroban-env-common/env.json +++ b/soroban-env-common/env.json @@ -2050,6 +2050,19 @@ }, { "export": "4", + "name": "bls12_381_check_g1_is_in_subgroup", + "args": [ + { + "name": "point", + "type": "BytesObject" + } + ], + "return": "Bool", + "docs": "Checks if the input G1 point is in the correct subgroup.", + "min_supported_protocol": 22 + }, + { + "export": "5", "name": "bls12_381_g1_add", "args": [ { @@ -2062,11 +2075,11 @@ } ], "return": "BytesObject", - "docs": "Adds two BLS12-381 G1 points given in bytes format and returns the resulting G1 point in bytes format. G1 serialization format: `concat(be_bytes(X), be_bytes(Y))` and the most significant three bits of X encodes flags, i.e. bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]", + "docs": "Adds two BLS12-381 G1 points given in bytes format and returns the resulting G1 point in bytes format. G1 serialization format: `concat(be_bytes(X), be_bytes(Y))` and the most significant three bits of X encodes flags, i.e. bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]. This function does NOT perform subgroup check on the inputs.", "min_supported_protocol": 22 }, { - "export": "5", + "export": "6", "name": "bls12_381_g1_mul", "args": [ { @@ -2083,7 +2096,7 @@ "min_supported_protocol": 22 }, { - "export": "6", + "export": "7", "name": "bls12_381_g1_msm", "args": [ { @@ -2100,7 +2113,7 @@ "min_supported_protocol": 22 }, { - "export": "7", + "export": "8", "name": "bls12_381_map_fp_to_g1", "args": [ { @@ -2113,7 +2126,7 @@ "min_supported_protocol": 22 }, { - "export": "8", + "export": "9", "name": "bls12_381_hash_to_g1", "args": [ { @@ -2130,7 +2143,20 @@ "min_supported_protocol": 22 }, { - "export": "9", + "export": "a", + "name": "bls12_381_check_g2_is_in_subgroup", + "args": [ + { + "name": "point", + "type": "BytesObject" + } + ], + "return": "Bool", + "docs": "Checks if the input G2 point is in the correct subgroup.", + "min_supported_protocol": 22 + }, + { + "export": "b", "name": "bls12_381_g2_add", "args": [ { @@ -2143,11 +2169,11 @@ } ], "return": "BytesObject", - "docs": "Adds two BLS12-381 G2 points given in bytes format and returns the resulting G2 point in bytes format. G2 serialization format: concat(be_bytes(X_c1), be_bytes(X_c0), be_bytes(Y_c1), be_bytes(Y_c0)), and the most significant three bits of X_c1 are flags i.e. bits(X_c1) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]", + "docs": "Adds two BLS12-381 G2 points given in bytes format and returns the resulting G2 point in bytes format. G2 serialization format: concat(be_bytes(X_c1), be_bytes(X_c0), be_bytes(Y_c1), be_bytes(Y_c0)), and the most significant three bits of X_c1 are flags i.e. bits(X_c1) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]. This function does NOT perform subgroup check on the inputs.", "min_supported_protocol": 22 }, { - "export": "a", + "export": "c", "name": "bls12_381_g2_mul", "args": [ { @@ -2164,7 +2190,7 @@ "min_supported_protocol": 22 }, { - "export": "b", + "export": "d", "name": "bls12_381_g2_msm", "args": [ { @@ -2181,7 +2207,7 @@ "min_supported_protocol": 22 }, { - "export": "c", + "export": "e", "name": "bls12_381_map_fp2_to_g2", "args": [ { @@ -2194,7 +2220,7 @@ "min_supported_protocol": 22 }, { - "export": "d", + "export": "f", "name": "bls12_381_hash_to_g2", "args": [ { @@ -2211,7 +2237,7 @@ "min_supported_protocol": 22 }, { - "export": "e", + "export": "g", "name": "bls12_381_multi_pairing_check", "args": [ { @@ -2228,7 +2254,7 @@ "min_supported_protocol": 22 }, { - "export": "f", + "export": "h", "name": "bls12_381_fr_add", "args": [ { @@ -2245,7 +2271,7 @@ "min_supported_protocol": 22 }, { - "export": "g", + "export": "i", "name": "bls12_381_fr_sub", "args": [ { @@ -2262,7 +2288,7 @@ "min_supported_protocol": 22 }, { - "export": "h", + "export": "j", "name": "bls12_381_fr_mul", "args": [ { @@ -2279,7 +2305,7 @@ "min_supported_protocol": 22 }, { - "export": "i", + "export": "k", "name": "bls12_381_fr_pow", "args": [ { @@ -2296,7 +2322,7 @@ "min_supported_protocol": 22 }, { - "export": "j", + "export": "l", "name": "bls12_381_fr_inv", "args": [ { diff --git a/soroban-env-host/Cargo.toml b/soroban-env-host/Cargo.toml index 5c1982a68..4b1f51ff3 100644 --- a/soroban-env-host/Cargo.toml +++ b/soroban-env-host/Cargo.toml @@ -105,7 +105,7 @@ p256 = {version = "0.13.2", default-features = false, features = ["alloc"]} [dev-dependencies.stellar-xdr] version = "=22.0.0" git = "https://github.com/stellar/rs-stellar-xdr" -rev = "5315f4c583784860c0accbb8d3bd234055a19751" +rev = "b5516843b6379e4e29520bf2ba156484f62edc46" default-features = false features = ["arbitrary"] diff --git a/soroban-env-host/benches/common/cost_types/bls12_381.rs b/soroban-env-host/benches/common/cost_types/bls12_381.rs index b2b818df3..dbe888a2e 100644 --- a/soroban-env-host/benches/common/cost_types/bls12_381.rs +++ b/soroban-env-host/benches/common/cost_types/bls12_381.rs @@ -9,17 +9,20 @@ use soroban_env_host::{ Bls12381FrAddRun, Bls12381FrAddSubMulSample, Bls12381FrFromU256Run, Bls12381FrFromU256Sample, Bls12381FrInvRun, Bls12381FrInvSample, Bls12381FrMulRun, Bls12381FrPowRun, Bls12381FrPowSample, Bls12381FrSubRun, Bls12381FrToU256Run, - Bls12381FrToU256Sample, Bls12381G1AddRun, Bls12381G1AddSample, Bls12381G1MsmRun, + Bls12381FrToU256Sample, Bls12381G1AddRun, Bls12381G1AddSample, + Bls12381G1CheckPointInSubgroupRun, Bls12381G1CheckPointInSubgroupSample, + Bls12381G1CheckPointOnCurveRun, Bls12381G1CheckPointOnCurveSample, Bls12381G1MsmRun, Bls12381G1MsmSample, Bls12381G1MulRun, Bls12381G1MulSample, - Bls12381G1ProjectiveToAffineRun, Bls12381G1ProjectiveToAffineSample, Bls12381G1ValidateRun, - Bls12381G1ValidateSample, Bls12381G2AddRun, Bls12381G2AddSample, Bls12381G2MsmRun, - Bls12381G2MsmSample, Bls12381G2MulRun, Bls12381G2MulSample, - Bls12381G2ProjectiveToAffineRun, Bls12381G2ProjectiveToAffineSample, Bls12381G2ValidateRun, - Bls12381G2ValidateSample, Bls12381HashToG1Run, Bls12381HashToG1Sample, Bls12381HashToG2Run, - Bls12381HashToG2Sample, Bls12381MapFp2ToG2Run, Bls12381MapFp2ToG2Sample, - Bls12381MapFpToG1Run, Bls12381MapFpToG1Sample, Bls12381PairingRun, Bls12381PairingSample, + Bls12381G1ProjectiveToAffineRun, Bls12381G1ProjectiveToAffineSample, Bls12381G2AddRun, + Bls12381G2AddSample, Bls12381G2CheckPointInSubgroupRun, + Bls12381G2CheckPointInSubgroupSample, Bls12381G2CheckPointOnCurveRun, + Bls12381G2CheckPointOnCurveSample, Bls12381G2MsmRun, Bls12381G2MsmSample, Bls12381G2MulRun, + Bls12381G2MulSample, Bls12381G2ProjectiveToAffineRun, Bls12381G2ProjectiveToAffineSample, + Bls12381HashToG1Run, Bls12381HashToG1Sample, Bls12381HashToG2Run, Bls12381HashToG2Sample, + Bls12381MapFp2ToG2Run, Bls12381MapFp2ToG2Sample, Bls12381MapFpToG1Run, + Bls12381MapFpToG1Sample, Bls12381PairingRun, Bls12381PairingSample, }, - xdr::ContractCostType, + xdr::ContractCostType::*, Host, TryIntoVal, U256Val, U256, }; @@ -43,20 +46,54 @@ impl HostCostMeasurement for Bls12381DecodeFpMeasure { Bls12381DecodeFpSample(buf) } } -pub(crate) struct Bls12381G1ValidateMeasure; -impl HostCostMeasurement for Bls12381G1ValidateMeasure { - type Runner = Bls12381G1ValidateRun; - - fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381G1ValidateSample { - Bls12381G1ValidateSample(G1Affine::rand(rng), ContractCostType::Bls12381G1Validate) +pub(crate) struct Bls12381G1CheckPointOnCurveMeasure; +impl HostCostMeasurement for Bls12381G1CheckPointOnCurveMeasure { + type Runner = Bls12381G1CheckPointOnCurveRun; + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> Bls12381G1CheckPointOnCurveSample { + Bls12381G1CheckPointOnCurveSample( + G1Affine::new_unchecked(Fq::rand(rng), Fq::rand(rng)), + Bls12381G1CheckPointOnCurve, + ) } } -pub(crate) struct Bls12381G2ValidateMeasure; -impl HostCostMeasurement for Bls12381G2ValidateMeasure { - type Runner = Bls12381G2ValidateRun; - - fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381G2ValidateSample { - Bls12381G2ValidateSample(G2Affine::rand(rng), ContractCostType::Bls12381G2Validate) +pub(crate) struct Bls12381G1CheckPointInSubgroupMeasure; +impl HostCostMeasurement for Bls12381G1CheckPointInSubgroupMeasure { + type Runner = Bls12381G1CheckPointInSubgroupRun; + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> Bls12381G1CheckPointInSubgroupSample { + Bls12381G1CheckPointInSubgroupSample(G1Affine::rand(rng), Bls12381G1CheckPointInSubgroup) + } +} +pub(crate) struct Bls12381G2CheckPointOnCurveMeasure; +impl HostCostMeasurement for Bls12381G2CheckPointOnCurveMeasure { + type Runner = Bls12381G2CheckPointOnCurveRun; + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> Bls12381G2CheckPointOnCurveSample { + Bls12381G2CheckPointOnCurveSample( + G2Affine::new_unchecked(Fq2::rand(rng), Fq2::rand(rng)), + Bls12381G2CheckPointOnCurve, + ) + } +} +pub(crate) struct Bls12381G2CheckPointInSubgroupMeasure; +impl HostCostMeasurement for Bls12381G2CheckPointInSubgroupMeasure { + type Runner = Bls12381G2CheckPointInSubgroupRun; + fn new_random_case( + _host: &Host, + rng: &mut StdRng, + _input: u64, + ) -> Bls12381G2CheckPointInSubgroupSample { + Bls12381G2CheckPointInSubgroupSample(G2Affine::rand(rng), Bls12381G2CheckPointInSubgroup) } } pub(crate) struct Bls12381FrFromU256Measure; diff --git a/soroban-env-host/benches/common/experimental/bls12_381.rs b/soroban-env-host/benches/common/experimental/bls12_381.rs index 113741a04..10ba9454f 100644 --- a/soroban-env-host/benches/common/experimental/bls12_381.rs +++ b/soroban-env-host/benches/common/experimental/bls12_381.rs @@ -1,18 +1,14 @@ use crate::common::HostCostMeasurement; -use ark_bls12_381::{Fq, Fq2, G1Affine, G2Affine}; +use ark_bls12_381::{Fq2, G1Affine, G2Affine}; use ark_ff::UniformRand; use ark_serialize::CanonicalSerialize; use rand::rngs::StdRng; use soroban_env_host::{ cost_runner::{ Bls12381Fp2DeserializeUncompressedRun, Bls12381G1AffineDeserializeUncompressedRun, - Bls12381G1AffineSerializeUncompressedRun, Bls12381G1CheckPointInSubgroupRun, - Bls12381G1CheckPointInSubgroupSample, Bls12381G1CheckPointOnCurveRun, - Bls12381G1CheckPointOnCurveSample, Bls12381G1ComputeYFromXRun, + Bls12381G1AffineSerializeUncompressedRun, Bls12381G1ComputeYFromXRun, Bls12381G1ComputeYFromXSample, Bls12381G2AffineDeserializeUncompressedRun, - Bls12381G2AffineSerializeUncompressedRun, Bls12381G2CheckPointInSubgroupRun, - Bls12381G2CheckPointInSubgroupSample, Bls12381G2CheckPointOnCurveRun, - Bls12381G2CheckPointOnCurveSample, Bls12381G2ComputeYFromXRun, + Bls12381G2AffineSerializeUncompressedRun, Bls12381G2ComputeYFromXRun, Bls12381G2ComputeYFromXSample, CostRunner, }, Host, @@ -66,28 +62,6 @@ impl HostCostMeasurement for Bls12381Fp2DeserializeUncompressedMeasure { } } -pub(crate) struct Bls12381G1CheckPointOnCurveMeasure; -impl HostCostMeasurement for Bls12381G1CheckPointOnCurveMeasure { - type Runner = Bls12381G1CheckPointOnCurveRun; - fn new_random_case( - _host: &Host, - rng: &mut StdRng, - _input: u64, - ) -> ::SampleType { - Bls12381G1CheckPointOnCurveSample(G1Affine::new_unchecked(Fq::rand(rng), Fq::rand(rng))) - } -} -pub(crate) struct Bls12381G1CheckPointInSubgroupMeasure; -impl HostCostMeasurement for Bls12381G1CheckPointInSubgroupMeasure { - type Runner = Bls12381G1CheckPointInSubgroupRun; - fn new_random_case( - _host: &Host, - rng: &mut StdRng, - _input: u64, - ) -> ::SampleType { - Bls12381G1CheckPointInSubgroupSample(G1Affine::rand(rng)) - } -} pub(crate) struct Bls12381G1ComputeYFromXMeasure; impl HostCostMeasurement for Bls12381G1ComputeYFromXMeasure { type Runner = Bls12381G1ComputeYFromXRun; @@ -99,28 +73,6 @@ impl HostCostMeasurement for Bls12381G1ComputeYFromXMeasure { Bls12381G1ComputeYFromXSample(G1Affine::rand(rng)) } } -pub(crate) struct Bls12381G2CheckPointOnCurveMeasure; -impl HostCostMeasurement for Bls12381G2CheckPointOnCurveMeasure { - type Runner = Bls12381G2CheckPointOnCurveRun; - fn new_random_case( - _host: &Host, - rng: &mut StdRng, - _input: u64, - ) -> ::SampleType { - Bls12381G2CheckPointOnCurveSample(G2Affine::new_unchecked(Fq2::rand(rng), Fq2::rand(rng))) - } -} -pub(crate) struct Bls12381G2CheckPointInSubgroupMeasure; -impl HostCostMeasurement for Bls12381G2CheckPointInSubgroupMeasure { - type Runner = Bls12381G2CheckPointInSubgroupRun; - fn new_random_case( - _host: &Host, - rng: &mut StdRng, - _input: u64, - ) -> ::SampleType { - Bls12381G2CheckPointInSubgroupSample(G2Affine::rand(rng)) - } -} pub(crate) struct Bls12381G2ComputeYFromXMeasure; impl HostCostMeasurement for Bls12381G2ComputeYFromXMeasure { type Runner = Bls12381G2ComputeYFromXRun; diff --git a/soroban-env-host/benches/common/mod.rs b/soroban-env-host/benches/common/mod.rs index b3492f295..0571c2644 100644 --- a/soroban-env-host/benches/common/mod.rs +++ b/soroban-env-host/benches/common/mod.rs @@ -130,8 +130,10 @@ pub(crate) fn for_each_host_cost_measurement( // P22 cost types call_bench::(&mut params)?; call_bench::(&mut params)?; - call_bench::(&mut params)?; - call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; + call_bench::(&mut params)?; call_bench::(&mut params)?; call_bench::(&mut params)?; call_bench::(&mut params)?; diff --git a/soroban-env-host/observations/22/test__bls12_381__check_g1_is_in_subgroup.json b/soroban-env-host/observations/22/test__bls12_381__check_g1_is_in_subgroup.json new file mode 100644 index 000000000..6010b2502 --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__check_g1_is_in_subgroup.json @@ -0,0 +1,74 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_insert(Bytes(obj#1), U32(96), U32(0))": "cpu:2307, mem:176, objs:-/1@2142c5f5", + " 2 ret bytes_insert -> Ok(Bytes(obj#3))": "cpu:3475, mem:353, objs:-/2@9a3f90d4", + " 3 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#3))": "", + " 4 ret bls12_381_check_g1_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:3597", + " 5 call bytes_del(Bytes(obj#5), U32(95))": "cpu:5904, mem:529, objs:-/3@abbe8c98", + " 6 ret bytes_del -> Ok(Bytes(obj#7))": "cpu:7114, mem:705, objs:-/4@49ff18c1", + " 7 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#7))": "", + " 8 ret bls12_381_check_g1_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:7236", + " 9 call bytes_get(Bytes(obj#9), U32(0))": "cpu:9543, mem:881, objs:-/5@6bc306d7", + " 10 ret bytes_get -> Ok(U32(9))": "cpu:9665", + " 11 call bytes_put(Bytes(obj#9), U32(0), U32(137))": "", + " 12 ret bytes_put -> Ok(Bytes(obj#11))": "cpu:10833, mem:1057, objs:-/6@d0338803", + " 13 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#11))": "", + " 14 ret bls12_381_check_g1_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:10955", + " 15 call bytes_get(Bytes(obj#13), U32(0))": "cpu:13262, mem:1233, objs:-/7@9cb6052", + " 16 ret bytes_get -> Ok(U32(25))": "cpu:13384", + " 17 call bytes_put(Bytes(obj#13), U32(0), U32(89))": "", + " 18 ret bytes_put -> Ok(Bytes(obj#15))": "cpu:14552, mem:1409, objs:-/8@b54f75b7", + " 19 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#15))": "", + " 20 ret bls12_381_check_g1_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:14674", + " 21 call bytes_get(Bytes(obj#17), U32(0))": "cpu:16981, mem:1585, objs:-/9@3d7c315e", + " 22 ret bytes_get -> Ok(U32(4))": "cpu:17103", + " 23 call bytes_put(Bytes(obj#17), U32(0), U32(36))": "", + " 24 ret bytes_put -> Ok(Bytes(obj#19))": "cpu:18271, mem:1761, objs:-/10@926d6fcb", + " 25 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#19))": "", + " 26 ret bls12_381_check_g1_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:18393", + " 27 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#23))": "cpu:23007, mem:2113, objs:-/12@85f05c1a", + " 28 ret bls12_381_check_g1_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:27033", + " 29 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#25))": "cpu:29340, mem:2289, objs:-/13@5aa03fef", + " 30 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:763876", + " 31 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#27))": "cpu:766183, mem:2465, objs:-/14@38656519", + " 32 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:1500719", + " 33 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#29))": "cpu:1503026, mem:2641, objs:-/15@c4a5e239", + " 34 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:2237562", + " 35 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#31))": "cpu:2239869, mem:2817, objs:-/16@8ba02515", + " 36 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:2974405", + " 37 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#33))": "cpu:2976712, mem:2993, objs:-/17@c29b4e55", + " 38 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:3711248", + " 39 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#35))": "cpu:3713555, mem:3169, objs:-/18@1641d2ec", + " 40 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:4448091", + " 41 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#37))": "cpu:4450398, mem:3345, objs:-/19@cc8d23ee", + " 42 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:5184934", + " 43 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#39))": "cpu:5187241, mem:3521, objs:-/20@797d6389", + " 44 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:5921777", + " 45 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#41))": "cpu:5924084, mem:3697, objs:-/21@1c345573", + " 46 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:6658620", + " 47 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#43))": "cpu:6660927, mem:3873, objs:-/22@54d1ee5f", + " 48 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:7395463", + " 49 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#45))": "cpu:7397770, mem:4049, objs:-/23@44d12712", + " 50 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:8132306", + " 51 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#49))": "cpu:8136920, mem:4401, objs:-/25@eadeeca2", + " 52 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:8871456", + " 53 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#53))": "cpu:8876070, mem:4753, objs:-/27@710f61db", + " 54 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:9610606", + " 55 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#57))": "cpu:9615220, mem:5105, objs:-/29@7508f59d", + " 56 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:10349756", + " 57 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#61))": "cpu:10354370, mem:5457, objs:-/31@8f31f30b", + " 58 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:11088906", + " 59 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#65))": "cpu:11093520, mem:5809, objs:-/33@c198683c", + " 60 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:11828056", + " 61 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#69))": "cpu:11832670, mem:6161, objs:-/35@324358fe", + " 62 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:12567206", + " 63 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#73))": "cpu:12571820, mem:6513, objs:-/37@c149e38f", + " 64 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:13306356", + " 65 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#77))": "cpu:13310970, mem:6865, objs:-/39@45c38f7f", + " 66 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:14045506", + " 67 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#81))": "cpu:14050120, mem:7217, objs:-/41@1aa8b119", + " 68 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:14784656", + " 69 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#85))": "cpu:14789270, mem:7569, objs:-/43@cb657d13", + " 70 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:15523806", + " 71 end": "cpu:15523806, mem:7569, prngs:-/-, objs:-/43@cb657d13, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__check_g2_is_in_subgroup.json b/soroban-env-host/observations/22/test__bls12_381__check_g2_is_in_subgroup.json new file mode 100644 index 000000000..c3d937a23 --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__check_g2_is_in_subgroup.json @@ -0,0 +1,74 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_insert(Bytes(obj#1), U32(192), U32(0))": "cpu:3653, mem:272, objs:-/1@f4e2a936", + " 2 ret bytes_insert -> Ok(Bytes(obj#3))": "cpu:4845, mem:545, objs:-/2@50b483f6", + " 3 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#3))": "", + " 4 ret bls12_381_check_g2_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:4967", + " 5 call bytes_del(Bytes(obj#5), U32(191))": "cpu:8620, mem:817, objs:-/3@b63c31e6", + " 6 ret bytes_del -> Ok(Bytes(obj#7))": "cpu:9854, mem:1089, objs:-/4@9429b9d3", + " 7 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#7))": "", + " 8 ret bls12_381_check_g2_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:9976", + " 9 call bytes_get(Bytes(obj#9), U32(0))": "cpu:13629, mem:1361, objs:-/5@b129e6eb", + " 10 ret bytes_get -> Ok(U32(15))": "cpu:13751", + " 11 call bytes_put(Bytes(obj#9), U32(0), U32(143))": "", + " 12 ret bytes_put -> Ok(Bytes(obj#11))": "cpu:14943, mem:1633, objs:-/6@ce0a242c", + " 13 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#11))": "", + " 14 ret bls12_381_check_g2_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:15065", + " 15 call bytes_get(Bytes(obj#13), U32(0))": "cpu:18718, mem:1905, objs:-/7@a3615ea0", + " 16 ret bytes_get -> Ok(U32(19))": "cpu:18840", + " 17 call bytes_put(Bytes(obj#13), U32(0), U32(83))": "", + " 18 ret bytes_put -> Ok(Bytes(obj#15))": "cpu:20032, mem:2177, objs:-/8@ddf0ef86", + " 19 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#15))": "", + " 20 ret bls12_381_check_g2_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:20154", + " 21 call bytes_get(Bytes(obj#17), U32(0))": "cpu:23807, mem:2449, objs:-/9@b15fcfaf", + " 22 ret bytes_get -> Ok(U32(8))": "cpu:23929", + " 23 call bytes_put(Bytes(obj#17), U32(0), U32(40))": "", + " 24 ret bytes_put -> Ok(Bytes(obj#19))": "cpu:25121, mem:2721, objs:-/10@ff15ca10", + " 25 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#19))": "", + " 26 ret bls12_381_check_g2_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:25243", + " 27 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#23))": "cpu:32549, mem:3265, objs:-/12@345f9e87", + " 28 ret bls12_381_check_g2_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:42532", + " 29 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#25))": "cpu:46185, mem:3537, objs:-/13@376ef5fd", + " 30 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:1113990", + " 31 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#27))": "cpu:1117643, mem:3809, objs:-/14@5bbf9054", + " 32 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:2185448", + " 33 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#29))": "cpu:2189101, mem:4081, objs:-/15@416695be", + " 34 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:3256906", + " 35 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#31))": "cpu:3260559, mem:4353, objs:-/16@8e09b5f", + " 36 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:4328364", + " 37 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#33))": "cpu:4332017, mem:4625, objs:-/17@f009aea2", + " 38 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:5399822", + " 39 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#35))": "cpu:5403475, mem:4897, objs:-/18@9ae14428", + " 40 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:6471280", + " 41 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#37))": "cpu:6474933, mem:5169, objs:-/19@bd9dfac1", + " 42 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:7542738", + " 43 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#39))": "cpu:7546391, mem:5441, objs:-/20@dcc1270c", + " 44 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:8614196", + " 45 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#41))": "cpu:8617849, mem:5713, objs:-/21@a6b0db9", + " 46 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:9685654", + " 47 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#43))": "cpu:9689307, mem:5985, objs:-/22@4a3f6fb7", + " 48 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:10757112", + " 49 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#45))": "cpu:10760765, mem:6257, objs:-/23@d4c84a78", + " 50 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:11828570", + " 51 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#49))": "cpu:11835876, mem:6801, objs:-/25@430fa4aa", + " 52 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:12903681", + " 53 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#53))": "cpu:12910987, mem:7345, objs:-/27@9e31a04c", + " 54 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:13978792", + " 55 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#57))": "cpu:13986098, mem:7889, objs:-/29@6047ea8d", + " 56 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:15053903", + " 57 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#61))": "cpu:15061209, mem:8433, objs:-/31@3deb0a32", + " 58 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:16129014", + " 59 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#65))": "cpu:16136320, mem:8977, objs:-/33@6c658f19", + " 60 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:17204125", + " 61 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#69))": "cpu:17211431, mem:9521, objs:-/35@1eca5ef7", + " 62 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:18279236", + " 63 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#73))": "cpu:18286542, mem:10065, objs:-/37@65689e4f", + " 64 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:19354347", + " 65 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#77))": "cpu:19361653, mem:10609, objs:-/39@a28f171b", + " 66 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:20429458", + " 67 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#81))": "cpu:20436764, mem:11153, objs:-/41@25bfb586", + " 68 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:21504569", + " 69 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#85))": "cpu:21511875, mem:11697, objs:-/43@268e18bf", + " 70 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:22579680", + " 71 end": "cpu:22579680, mem:11697, prngs:-/-, objs:-/43@268e18bf, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g1_add.json b/soroban-env-host/observations/22/test__bls12_381__g1_add.json index 79514920f..003bb349d 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g1_add.json +++ b/soroban-env-host/observations/22/test__bls12_381__g1_add.json @@ -1,92 +1,92 @@ { " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", - " 1 call bytes_insert(Bytes(obj#3), U32(96), U32(0))": "cpu:3524, mem:128, objs:-/2@ed0b37be", - " 2 ret bytes_insert -> Ok(Bytes(obj#5))": "cpu:4692, mem:305, objs:-/3@bea4ca12", + " 1 call bytes_insert(Bytes(obj#3), U32(96), U32(0))": "cpu:4614, mem:352, objs:-/2@a5d3f802", + " 2 ret bytes_insert -> Ok(Bytes(obj#5))": "cpu:5782, mem:529, objs:-/3@7b4d6097", " 3 call bls12_381_g1_add(Bytes(obj#5), Bytes(obj#1))": "", - " 4 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:4875", - " 5 call bytes_del(Bytes(obj#7), U32(95))": "cpu:6637, mem:369, objs:-/4@eac0b36a", - " 6 ret bytes_del -> Ok(Bytes(obj#9))": "cpu:7847, mem:545, objs:-/5@b60c4bf2", + " 4 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:5965", + " 5 call bytes_del(Bytes(obj#7), U32(95))": "cpu:8272, mem:705, objs:-/4@f718b107", + " 6 ret bytes_del -> Ok(Bytes(obj#9))": "cpu:9482, mem:881, objs:-/5@8bb34c65", " 7 call bls12_381_g1_add(Bytes(obj#9), Bytes(obj#1))": "", - " 8 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:8030", - " 9 call bytes_get(Bytes(obj#11), U32(0))": "cpu:9792, mem:609, objs:-/6@815f60e", - " 10 ret bytes_get -> Ok(U32(0))": "cpu:9914", - " 11 call bytes_put(Bytes(obj#11), U32(0), U32(128))": "", - " 12 ret bytes_put -> Ok(Bytes(obj#13))": "cpu:11082, mem:785, objs:-/7@47368e87", + " 8 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:9665", + " 9 call bytes_get(Bytes(obj#11), U32(0))": "cpu:11972, mem:1057, objs:-/6@e3a21556", + " 10 ret bytes_get -> Ok(U32(25))": "cpu:12094", + " 11 call bytes_put(Bytes(obj#11), U32(0), U32(153))": "", + " 12 ret bytes_put -> Ok(Bytes(obj#13))": "cpu:13262, mem:1233, objs:-/7@d85c26db", " 13 call bls12_381_g1_add(Bytes(obj#13), Bytes(obj#1))": "", - " 14 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:11265", - " 15 call bytes_get(Bytes(obj#15), U32(0))": "cpu:13027, mem:849, objs:-/8@df0e6ac3", - " 16 ret bytes_get -> Ok(U32(0))": "cpu:13149", - " 17 call bytes_put(Bytes(obj#15), U32(0), U32(64))": "", - " 18 ret bytes_put -> Ok(Bytes(obj#17))": "cpu:14317, mem:1025, objs:-/9@da30bd7b", + " 14 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:13445", + " 15 call bytes_get(Bytes(obj#15), U32(0))": "cpu:15752, mem:1409, objs:-/8@85513dde", + " 16 ret bytes_get -> Ok(U32(4))": "cpu:15874", + " 17 call bytes_put(Bytes(obj#15), U32(0), U32(68))": "", + " 18 ret bytes_put -> Ok(Bytes(obj#17))": "cpu:17042, mem:1585, objs:-/9@a1a8357e", " 19 call bls12_381_g1_add(Bytes(obj#17), Bytes(obj#1))": "", - " 20 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:14500", - " 21 call bytes_get(Bytes(obj#19), U32(0))": "cpu:16262, mem:1089, objs:-/10@ae2703c0", - " 22 ret bytes_get -> Ok(U32(0))": "cpu:16384", - " 23 call bytes_put(Bytes(obj#19), U32(0), U32(32))": "", - " 24 ret bytes_put -> Ok(Bytes(obj#21))": "cpu:17552, mem:1265, objs:-/11@3be8899", + " 20 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:17225", + " 21 call bytes_get(Bytes(obj#19), U32(0))": "cpu:19532, mem:1761, objs:-/10@7b1eabc1", + " 22 ret bytes_get -> Ok(U32(15))": "cpu:19654", + " 23 call bytes_put(Bytes(obj#19), U32(0), U32(47))": "", + " 24 ret bytes_put -> Ok(Bytes(obj#21))": "cpu:20822, mem:1937, objs:-/11@a79b741d", " 25 call bls12_381_g1_add(Bytes(obj#21), Bytes(obj#1))": "", - " 26 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:17735", - " 27 call bls12_381_g1_add(Bytes(obj#25), Bytes(obj#1))": "cpu:21259, mem:1393, objs:-/13@2f190ca5", - " 28 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:755713", - " 29 call bls12_381_g1_add(Bytes(obj#29), Bytes(obj#1))": "cpu:759237, mem:1521, objs:-/15@6a6ff748", - " 30 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:1493691", - " 31 call bytes_insert(Bytes(obj#33), U32(96), U32(0))": "cpu:1497215, mem:1649, objs:-/17@466c1d02", - " 32 ret bytes_insert -> Ok(Bytes(obj#35))": "cpu:1498383, mem:1826, objs:-/18@b978e08e", - " 33 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#35))": "", - " 34 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:2232898", - " 35 call bytes_del(Bytes(obj#37), U32(95))": "cpu:2234660, mem:1890, objs:-/19@147c5316", - " 36 ret bytes_del -> Ok(Bytes(obj#39))": "cpu:2235870, mem:2066, objs:-/20@17175fb3", - " 37 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#39))": "", - " 38 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:2970385", - " 39 call bytes_get(Bytes(obj#41), U32(0))": "cpu:2972147, mem:2130, objs:-/21@a0e83378", - " 40 ret bytes_get -> Ok(U32(0))": "cpu:2972269", - " 41 call bytes_put(Bytes(obj#41), U32(0), U32(128))": "", - " 42 ret bytes_put -> Ok(Bytes(obj#43))": "cpu:2973437, mem:2306, objs:-/22@13b81969", - " 43 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#43))": "", - " 44 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:3707952", - " 45 call bytes_get(Bytes(obj#45), U32(0))": "cpu:3709714, mem:2370, objs:-/23@ef4f6d88", - " 46 ret bytes_get -> Ok(U32(0))": "cpu:3709836", - " 47 call bytes_put(Bytes(obj#45), U32(0), U32(64))": "", - " 48 ret bytes_put -> Ok(Bytes(obj#47))": "cpu:3711004, mem:2546, objs:-/24@4e30c0f9", - " 49 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#47))": "", - " 50 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:4445519", - " 51 call bytes_get(Bytes(obj#49), U32(0))": "cpu:4447281, mem:2610, objs:-/25@b2e3dac2", - " 52 ret bytes_get -> Ok(U32(0))": "cpu:4447403", - " 53 call bytes_put(Bytes(obj#49), U32(0), U32(32))": "", - " 54 ret bytes_put -> Ok(Bytes(obj#51))": "cpu:4448571, mem:2786, objs:-/26@5c6f9d9a", - " 55 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#51))": "", - " 56 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:5183086", - " 57 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#55))": "cpu:5186610, mem:2914, objs:-/28@d7f6df3c", - " 58 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:6655396", - " 59 call bls12_381_g1_add(Bytes(obj#31), Bytes(obj#59))": "cpu:6658920, mem:3042, objs:-/30@4bba4cc6", - " 60 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:8127706", - " 61 call bls12_381_g1_add(Bytes(obj#61), Bytes(obj#63))": "cpu:8131230, mem:3170, objs:-/32@fad360ae", - " 62 ret bls12_381_g1_add -> Ok(Bytes(obj#65))": "cpu:9702170, mem:3234, objs:-/33@cc2ca130", - " 63 call obj_cmp(Bytes(obj#61), Bytes(obj#65))": "", - " 64 ret obj_cmp -> Ok(0)": "cpu:9702470", - " 65 call bls12_381_g1_add(Bytes(obj#69), Bytes(obj#67))": "cpu:9705994, mem:3362, objs:-/35@c4905e8d", - " 66 ret bls12_381_g1_add -> Ok(Bytes(obj#71))": "cpu:11276934, mem:3426, objs:-/36@7d2daf56", - " 67 call obj_cmp(Bytes(obj#67), Bytes(obj#71))": "", - " 68 ret obj_cmp -> Ok(0)": "cpu:11277234", - " 69 call bls12_381_g1_add(Bytes(obj#73), Bytes(obj#75))": "cpu:11280758, mem:3554, objs:-/38@7fe06cb0", - " 70 ret bls12_381_g1_add -> Ok(Bytes(obj#77))": "cpu:12851698, mem:3618, objs:-/39@9453ad33", - " 71 call bls12_381_g1_add(Bytes(obj#75), Bytes(obj#73))": "", - " 72 ret bls12_381_g1_add -> Ok(Bytes(obj#79))": "cpu:14422638, mem:3682, objs:-/40@2e48dea9", - " 73 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "", - " 74 ret obj_cmp -> Ok(0)": "cpu:14422938", - " 75 call bls12_381_g1_add(Bytes(obj#81), Bytes(obj#83))": "cpu:14428224, mem:3874, objs:-/43@25c037a2", - " 76 ret bls12_381_g1_add -> Ok(Bytes(obj#87))": "cpu:15999164, mem:3938, objs:-/44@a152c6f1", - " 77 call bls12_381_g1_add(Bytes(obj#87), Bytes(obj#85))": "", - " 78 ret bls12_381_g1_add -> Ok(Bytes(obj#89))": "cpu:17570104, mem:4002, objs:-/45@4a05f35", - " 79 call bls12_381_g1_add(Bytes(obj#83), Bytes(obj#85))": "", - " 80 ret bls12_381_g1_add -> Ok(Bytes(obj#91))": "cpu:19141044, mem:4066, objs:-/46@d032b224", - " 81 call bls12_381_g1_add(Bytes(obj#81), Bytes(obj#91))": "", - " 82 ret bls12_381_g1_add -> Ok(Bytes(obj#93))": "cpu:20711984, mem:4130, objs:-/47@2914ad5d", - " 83 call obj_cmp(Bytes(obj#89), Bytes(obj#93))": "", - " 84 ret obj_cmp -> Ok(0)": "cpu:20712284", - " 85 call bls12_381_g1_add(Bytes(obj#95), Bytes(obj#97))": "cpu:21450140, mem:4258, objs:-/49@35cf21f2", - " 86 ret bls12_381_g1_add -> Ok(Bytes(obj#99))": "cpu:23021080, mem:4322, objs:-/50@203bb175", - " 87 call obj_cmp(Bytes(obj#99), Bytes(obj#101))": "cpu:23022842, mem:4386, objs:-/51@72363613", - " 88 ret obj_cmp -> Ok(0)": "cpu:23023142", - " 89 end": "cpu:23023142, mem:4386, prngs:-/-, objs:-/51@72363613, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 26 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:21005", + " 27 call bls12_381_g1_add(Bytes(obj#25), Bytes(obj#1))": "cpu:25619, mem:2289, objs:-/13@245336f9", + " 28 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:29706", + " 29 call bls12_381_g1_add(Bytes(obj#29), Bytes(obj#1))": "cpu:34320, mem:2641, objs:-/15@d7205b72", + " 30 ret bls12_381_g1_add -> Ok(Bytes(obj#31))": "cpu:145071, mem:2817, objs:-/16@aa5ae19f", + " 31 call bytes_insert(Bytes(obj#35), U32(96), U32(0))": "cpu:149685, mem:3169, objs:-/18@6a3073a3", + " 32 ret bytes_insert -> Ok(Bytes(obj#37))": "cpu:150853, mem:3346, objs:-/19@453802c4", + " 33 call bls12_381_g1_add(Bytes(obj#33), Bytes(obj#37))": "", + " 34 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:155001", + " 35 call bytes_del(Bytes(obj#39), U32(95))": "cpu:157308, mem:3522, objs:-/20@cfc20b80", + " 36 ret bytes_del -> Ok(Bytes(obj#41))": "cpu:158518, mem:3698, objs:-/21@2343916f", + " 37 call bls12_381_g1_add(Bytes(obj#33), Bytes(obj#41))": "", + " 38 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:162666", + " 39 call bytes_get(Bytes(obj#43), U32(0))": "cpu:164973, mem:3874, objs:-/22@d960e8e0", + " 40 ret bytes_get -> Ok(U32(0))": "cpu:165095", + " 41 call bytes_put(Bytes(obj#43), U32(0), U32(128))": "", + " 42 ret bytes_put -> Ok(Bytes(obj#45))": "cpu:166263, mem:4050, objs:-/23@38f39e6", + " 43 call bls12_381_g1_add(Bytes(obj#33), Bytes(obj#45))": "", + " 44 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:170411", + " 45 call bytes_get(Bytes(obj#47), U32(0))": "cpu:172718, mem:4226, objs:-/24@41a5ebfe", + " 46 ret bytes_get -> Ok(U32(18))": "cpu:172840", + " 47 call bytes_put(Bytes(obj#47), U32(0), U32(82))": "", + " 48 ret bytes_put -> Ok(Bytes(obj#49))": "cpu:174008, mem:4402, objs:-/25@b2897deb", + " 49 call bls12_381_g1_add(Bytes(obj#33), Bytes(obj#49))": "", + " 50 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:178156", + " 51 call bytes_get(Bytes(obj#51), U32(0))": "cpu:180463, mem:4578, objs:-/26@d0fe1b2e", + " 52 ret bytes_get -> Ok(U32(11))": "cpu:180585", + " 53 call bytes_put(Bytes(obj#51), U32(0), U32(43))": "", + " 54 ret bytes_put -> Ok(Bytes(obj#53))": "cpu:181753, mem:4754, objs:-/27@cca6f00c", + " 55 call bls12_381_g1_add(Bytes(obj#33), Bytes(obj#53))": "", + " 56 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:185901", + " 57 call bls12_381_g1_add(Bytes(obj#33), Bytes(obj#57))": "cpu:190515, mem:5106, objs:-/29@8354f99f", + " 58 ret bls12_381_g1_add -> Err(Error(Crypto, InvalidInput))": "cpu:198567", + " 59 call bls12_381_g1_add(Bytes(obj#33), Bytes(obj#61))": "cpu:203181, mem:5458, objs:-/31@841dd7d8", + " 60 ret bls12_381_g1_add -> Ok(Bytes(obj#63))": "cpu:313932, mem:5634, objs:-/32@e053b471", + " 61 call bls12_381_g1_add(Bytes(obj#65), Bytes(obj#67))": "cpu:318546, mem:5986, objs:-/34@267e3ee", + " 62 ret bls12_381_g1_add -> Ok(Bytes(obj#69))": "cpu:429297, mem:6162, objs:-/35@6c45b139", + " 63 call obj_cmp(Bytes(obj#65), Bytes(obj#69))": "", + " 64 ret obj_cmp -> Ok(0)": "cpu:429597", + " 65 call bls12_381_g1_add(Bytes(obj#73), Bytes(obj#71))": "cpu:434211, mem:6514, objs:-/37@11069e21", + " 66 ret bls12_381_g1_add -> Ok(Bytes(obj#75))": "cpu:544962, mem:6690, objs:-/38@e93dc5e6", + " 67 call obj_cmp(Bytes(obj#71), Bytes(obj#75))": "", + " 68 ret obj_cmp -> Ok(0)": "cpu:545262", + " 69 call bls12_381_g1_add(Bytes(obj#77), Bytes(obj#79))": "cpu:549876, mem:7042, objs:-/40@cc04c3a", + " 70 ret bls12_381_g1_add -> Ok(Bytes(obj#81))": "cpu:660627, mem:7218, objs:-/41@5356466f", + " 71 call bls12_381_g1_add(Bytes(obj#79), Bytes(obj#77))": "", + " 72 ret bls12_381_g1_add -> Ok(Bytes(obj#83))": "cpu:771378, mem:7394, objs:-/42@5c17d0f7", + " 73 call obj_cmp(Bytes(obj#81), Bytes(obj#83))": "", + " 74 ret obj_cmp -> Ok(0)": "cpu:771678", + " 75 call bls12_381_g1_add(Bytes(obj#85), Bytes(obj#87))": "cpu:778599, mem:7922, objs:-/45@1408a61a", + " 76 ret bls12_381_g1_add -> Ok(Bytes(obj#91))": "cpu:889350, mem:8098, objs:-/46@8ae35b94", + " 77 call bls12_381_g1_add(Bytes(obj#91), Bytes(obj#89))": "", + " 78 ret bls12_381_g1_add -> Ok(Bytes(obj#93))": "cpu:1000101, mem:8274, objs:-/47@65c18b7b", + " 79 call bls12_381_g1_add(Bytes(obj#87), Bytes(obj#89))": "", + " 80 ret bls12_381_g1_add -> Ok(Bytes(obj#95))": "cpu:1110852, mem:8450, objs:-/48@7eb6fc3e", + " 81 call bls12_381_g1_add(Bytes(obj#85), Bytes(obj#95))": "", + " 82 ret bls12_381_g1_add -> Ok(Bytes(obj#97))": "cpu:1221603, mem:8626, objs:-/49@1a3348a6", + " 83 call obj_cmp(Bytes(obj#93), Bytes(obj#97))": "", + " 84 ret obj_cmp -> Ok(0)": "cpu:1221903", + " 85 call bls12_381_g1_add(Bytes(obj#99), Bytes(obj#101))": "cpu:1960992, mem:8978, objs:-/51@d725a826", + " 86 ret bls12_381_g1_add -> Ok(Bytes(obj#103))": "cpu:2071743, mem:9154, objs:-/52@ef372ebe", + " 87 call obj_cmp(Bytes(obj#103), Bytes(obj#105))": "cpu:2074050, mem:9330, objs:-/53@b789aa09", + " 88 ret obj_cmp -> Ok(0)": "cpu:2074350", + " 89 end": "cpu:2074350, mem:9330, prngs:-/-, objs:-/53@b789aa09, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g1_msm.json b/soroban-env-host/observations/22/test__bls12_381__g1_msm.json index c1405000d..e80e531ad 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g1_msm.json +++ b/soroban-env-host/observations/22/test__bls12_381__g1_msm.json @@ -12,351 +12,351 @@ " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:4538, mem:480, objs:-/4@f550cb25", " 11 call vec_new_from_slice(2)": "", " 12 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:5625, mem:576, objs:-/5@27393823", - " 13 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:6126, mem:640, objs:-/6@cdf18d51", - " 15 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", - " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:6627, mem:704, objs:-/7@32ea1191", - " 17 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", - " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:7128, mem:768, objs:-/8@212b406c", + " 13 call obj_from_u256_pieces(2515383451482204963, 3798294199605637777, 9874121741094930036, 5634530503602181405)": "", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:6126, mem:640, objs:-/6@3f49b7c2", + " 15 call obj_from_u256_pieces(16161944172311556037, 9348631246554537043, 7119928359786205760, 2656543668720567255)": "", + " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:6627, mem:704, objs:-/7@2ed0a706", + " 17 call obj_from_u256_pieces(9580499452994475139, 12513764331848801915, 17507952593492800906, 8551509165293236575)": "", + " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:7128, mem:768, objs:-/8@43230a4b", " 19 call vec_new_from_slice(3)": "", - " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:8278, mem:872, objs:-/9@478d08d6", + " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:8278, mem:872, objs:-/9@ac0e3b8c", " 21 call bls12_381_g1_msm(Vec(obj#9), Vec(obj#17))": "", " 22 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:8522", - " 23 call vec_new_from_slice(3)": "cpu:15570, mem:1128, objs:-/13@a6af80ce", - " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:16720, mem:1232, objs:-/14@d54cb669", - " 25 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:17221, mem:1296, objs:-/15@6141f20f", - " 27 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", - " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:17722, mem:1360, objs:-/16@cf8fa86b", - " 29 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", - " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:18223, mem:1424, objs:-/17@fb010bfc", + " 23 call vec_new_from_slice(3)": "cpu:17750, mem:1576, objs:-/13@561be3e7", + " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:18900, mem:1680, objs:-/14@c49c6ff2", + " 25 call obj_from_u256_pieces(11943197420912477102, 14634913559439210090, 15499375484791752188, 12925620935896195067)": "", + " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:19401, mem:1744, objs:-/15@3da47540", + " 27 call obj_from_u256_pieces(5622195026378228418, 9560417407481221846, 8127851712333271140, 4557073498745857109)": "", + " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:19902, mem:1808, objs:-/16@d07ec2c0", + " 29 call obj_from_u256_pieces(12072680829433668232, 2892971212195715449, 599041459787463398, 17399677212821182399)": "", + " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:20403, mem:1872, objs:-/17@2d23aeeb", " 31 call vec_new_from_slice(3)": "", - " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:19373, mem:1528, objs:-/18@e177307b", + " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:21553, mem:1976, objs:-/18@9ffeec8c", " 33 call bls12_381_g1_msm(Vec(obj#27), Vec(obj#35))": "", - " 34 call vec_len(Vec(obj#27))": "cpu:19617", - " 35 ret vec_len -> Ok(U32(3))": "cpu:19739", - " 36 call vec_len(Vec(obj#35))": "cpu:1488934, mem:1832", - " 37 ret vec_len -> Ok(U32(3))": "cpu:1489056", - " 38 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1495728, mem:1944", - " 39 call vec_new_from_slice(3)": "cpu:1497490, mem:2008, objs:-/19@bb4c10e0", - " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:1498640, mem:2112, objs:-/20@edfb14a3", - " 41 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:1499141, mem:2176, objs:-/21@262b1fca", - " 43 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", - " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:1499642, mem:2240, objs:-/22@f7594d43", - " 45 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", - " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:1500143, mem:2304, objs:-/23@f2575ba5", + " 34 call vec_len(Vec(obj#27))": "cpu:21797", + " 35 ret vec_len -> Ok(U32(3))": "cpu:21919", + " 36 call vec_len(Vec(obj#35))": "cpu:1491400, mem:2280", + " 37 ret vec_len -> Ok(U32(3))": "cpu:1491522", + " 38 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1498194, mem:2392", + " 39 call vec_new_from_slice(3)": "cpu:1500501, mem:2568, objs:-/19@42952458", + " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:1501651, mem:2672, objs:-/20@a0bd3ff", + " 41 call obj_from_u256_pieces(9030446305465662626, 6854247188031249140, 3026823929057343686, 5018424221301027056)": "", + " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:1502152, mem:2736, objs:-/21@5d27dd7c", + " 43 call obj_from_u256_pieces(17540322581155608940, 9042723259083353182, 9336846948556567215, 15266620357577816939)": "", + " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:1502653, mem:2800, objs:-/22@32305aea", + " 45 call obj_from_u256_pieces(2273584195287690476, 203274327658109228, 545101579437905274, 9593152778203258958)": "", + " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:1503154, mem:2864, objs:-/23@d5672c27", " 47 call vec_new_from_slice(3)": "", - " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:1501293, mem:2408, objs:-/24@2704baa1", + " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:1504304, mem:2968, objs:-/24@f299ae2e", " 49 call bls12_381_g1_msm(Vec(obj#39), Vec(obj#47))": "", - " 50 call vec_len(Vec(obj#39))": "cpu:1501537", - " 51 ret vec_len -> Ok(U32(3))": "cpu:1501659", - " 52 call vec_len(Vec(obj#47))": "cpu:3705186, mem:2712", - " 53 ret vec_len -> Ok(U32(3))": "cpu:3705308", - " 54 ret bls12_381_g1_msm -> Ok(Bytes(obj#49))": "cpu:8492487, mem:120694, objs:-/25@1e7410d5", - " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:8494249, mem:120758, objs:-/26@54de0ee8", - " 56 ret obj_cmp -> Ok(0)": "cpu:8494549", - " 57 call bytes_new_from_slice(96)": "cpu:8495210", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:8496195, mem:120934, objs:-/27@de262326", - " 59 call bytes_new_from_slice(96)": "cpu:8496856", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:8497841, mem:121110, objs:-/28@3c763a82", - " 61 call bytes_new_from_slice(96)": "cpu:8498502", - " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:8499487, mem:121286, objs:-/29@4d732bc8", + " 50 call vec_len(Vec(obj#39))": "cpu:1504548", + " 51 ret vec_len -> Ok(U32(3))": "cpu:1504670", + " 52 call vec_len(Vec(obj#47))": "cpu:3708626, mem:3272", + " 53 ret vec_len -> Ok(U32(3))": "cpu:3708748", + " 54 ret bls12_381_g1_msm -> Ok(Bytes(obj#49))": "cpu:8496472, mem:121366, objs:-/25@e3c1a53", + " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:8498779, mem:121542, objs:-/26@f6f4e327", + " 56 ret obj_cmp -> Ok(0)": "cpu:8499079", + " 57 call bytes_new_from_slice(96)": "cpu:8499740", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:8500725, mem:121718, objs:-/27@de36fc43", + " 59 call bytes_new_from_slice(96)": "cpu:8501386", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:8502371, mem:121894, objs:-/28@d5575135", + " 61 call bytes_new_from_slice(96)": "cpu:8503032", + " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:8504017, mem:122070, objs:-/29@75b6bfd6", " 63 call vec_new_from_slice(3)": "", - " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:8500637, mem:121390, objs:-/30@32f23a1e", + " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:8505167, mem:122174, objs:-/30@a0da8ba2", " 65 call vec_new_from_slice(3)": "", - " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:8501604, mem:121494, objs:-/31@28c74935", + " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:8506134, mem:122278, objs:-/31@3969541b", " 67 call bls12_381_g1_msm(Vec(obj#59), Vec(obj#61))": "", - " 68 call vec_len(Vec(obj#59))": "cpu:8501848", - " 69 ret vec_len -> Ok(U32(3))": "cpu:8501970", - " 70 call vec_len(Vec(obj#61))": "cpu:10705497, mem:121798", - " 71 ret vec_len -> Ok(U32(3))": "cpu:10705619", - " 72 ret bls12_381_g1_msm -> Ok(Bytes(obj#63))": "cpu:15492615, mem:239780, objs:-/32@9bf95036", - " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:15494377, mem:239844, objs:-/33@f03a2a69", - " 74 ret obj_cmp -> Ok(0)": "cpu:15494677", - " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:15498201, mem:239972, objs:-/35@bb07e5a", - " 76 ret obj_cmp -> Ok(-1)": "cpu:15498501", - " 77 call vec_new_from_slice(2)": "cpu:16234595, mem:240036, objs:-/36@416423f7", - " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:16235682, mem:240132, objs:-/37@8add02ae", + " 68 call vec_len(Vec(obj#59))": "cpu:8506378", + " 69 ret vec_len -> Ok(U32(3))": "cpu:8506500", + " 70 call vec_len(Vec(obj#61))": "cpu:10710456, mem:122582", + " 71 ret vec_len -> Ok(U32(3))": "cpu:10710578", + " 72 ret bls12_381_g1_msm -> Ok(Bytes(obj#63))": "cpu:15498119, mem:240676, objs:-/32@4cf72b63", + " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:15500426, mem:240852, objs:-/33@2b1e328c", + " 74 ret obj_cmp -> Ok(0)": "cpu:15500726", + " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:15505340, mem:241204, objs:-/35@c5e3864a", + " 76 ret obj_cmp -> Ok(-1)": "cpu:15505640", + " 77 call vec_new_from_slice(2)": "cpu:16242422, mem:241380, objs:-/36@48960b91", + " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:16243509, mem:241476, objs:-/37@9fba2a30", " 79 call vec_new_from_slice(2)": "", - " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:16236647, mem:240228, objs:-/38@8f72dcef", + " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:16244474, mem:241572, objs:-/38@417ebf06", " 81 call bls12_381_g1_msm(Vec(obj#73), Vec(obj#75))": "", - " 82 call vec_len(Vec(obj#73))": "cpu:16236891", - " 83 ret vec_len -> Ok(U32(2))": "cpu:16237013", - " 84 call vec_len(Vec(obj#75))": "cpu:17706196, mem:240436", - " 85 ret vec_len -> Ok(U32(2))": "cpu:17706318", - " 86 ret bls12_381_g1_msm -> Ok(Bytes(obj#77))": "cpu:21738209, mem:355615, objs:-/39@980fb6be", - " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:21739971, mem:355679, objs:-/40@9d054362", - " 88 ret obj_cmp -> Ok(0)": "cpu:21740271", - " 89 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "cpu:7048, mem:256, objs:-/44@b02e8718", - " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:7549, mem:320, objs:-/45@e290dabe", - " 91 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 92 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:8050, mem:384, objs:-/46@b8a3e3e0", - " 93 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 94 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:8551, mem:448, objs:-/47@ccad87bb", - " 95 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 96 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:9052, mem:512, objs:-/48@a3d80b5e", + " 82 call vec_len(Vec(obj#73))": "cpu:16244718", + " 83 ret vec_len -> Ok(U32(2))": "cpu:16244840", + " 84 call vec_len(Vec(obj#75))": "cpu:17714309, mem:241780", + " 85 ret vec_len -> Ok(U32(2))": "cpu:17714431", + " 86 ret bls12_381_g1_msm -> Ok(Bytes(obj#77))": "cpu:21746867, mem:357071, objs:-/39@d2932e3e", + " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:21749174, mem:357247, objs:-/40@3b58e936", + " 88 ret obj_cmp -> Ok(0)": "cpu:21749474", + " 89 call obj_from_u256_pieces(2137869300824195577, 2408943964792666977, 4119820914549582912, 10689500621133072587)": "cpu:9228, mem:704, objs:-/44@bdf24bea", + " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:9729, mem:768, objs:-/45@ff9db193", + " 91 call obj_from_u256_pieces(1962485755387024656, 9106496787558144827, 9789057793268231909, 16221084701331329973)": "", + " 92 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:10230, mem:832, objs:-/46@c719630e", + " 93 call obj_from_u256_pieces(1296515190507321084, 10989324616177374759, 8226479548446315792, 5867014538613133674)": "", + " 94 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:10731, mem:896, objs:-/47@a3ded57a", + " 95 call obj_from_u256_pieces(15796377402950621781, 1952675446632466581, 13889210310322241459, 7969271833534144739)": "", + " 96 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:11232, mem:960, objs:-/48@d367c748", " 97 call vec_new_from_slice(4)": "", - " 98 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:10265, mem:624, objs:-/49@930b5e85", + " 98 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:12445, mem:1072, objs:-/49@4aa6caa5", " 99 call vec_new_from_slice(4)": "", - " 100 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:11478, mem:736, objs:-/50@b445fb7b", + " 100 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:13658, mem:1184, objs:-/50@d6716ebc", " 101 call bls12_381_g1_msm(Vec(obj#97), Vec(obj#99))": "", - " 102 call vec_len(Vec(obj#97))": "cpu:11722", - " 103 ret vec_len -> Ok(U32(4))": "cpu:11844", - " 104 call vec_len(Vec(obj#99))": "cpu:2949715, mem:1136", - " 105 ret vec_len -> Ok(U32(4))": "cpu:2949837", - " 106 ret bls12_381_g1_msm -> Ok(Bytes(obj#101))": "cpu:8492182, mem:121921, objs:-/51@15c6fada", + " 102 call vec_len(Vec(obj#97))": "cpu:13902", + " 103 ret vec_len -> Ok(U32(4))": "cpu:14024", + " 104 call vec_len(Vec(obj#99))": "cpu:2952467, mem:1584", + " 105 ret vec_len -> Ok(U32(4))": "cpu:2952589", + " 106 ret bls12_381_g1_msm -> Ok(Bytes(obj#101))": "cpu:8495479, mem:122481, objs:-/51@38fc93bb", " 107 call vec_new_from_slice(4)": "", - " 108 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:8493395, mem:122033, objs:-/52@329b96ba", + " 108 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:8496692, mem:122593, objs:-/52@332932d6", " 109 call vec_new_from_slice(4)": "", - " 110 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:8494608, mem:122145, objs:-/53@a190f17c", + " 110 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:8497905, mem:122705, objs:-/53@eb9d99bf", " 111 call bls12_381_g1_msm(Vec(obj#103), Vec(obj#105))": "", - " 112 call vec_len(Vec(obj#103))": "cpu:8494852", - " 113 ret vec_len -> Ok(U32(4))": "cpu:8494974", - " 114 call vec_len(Vec(obj#105))": "cpu:11432845, mem:122545", - " 115 ret vec_len -> Ok(U32(4))": "cpu:11432967", - " 116 ret bls12_381_g1_msm -> Ok(Bytes(obj#107))": "cpu:16975312, mem:243330, objs:-/54@253f5e82", + " 112 call vec_len(Vec(obj#103))": "cpu:8498149", + " 113 ret vec_len -> Ok(U32(4))": "cpu:8498271", + " 114 call vec_len(Vec(obj#105))": "cpu:11436714, mem:123105", + " 115 ret vec_len -> Ok(U32(4))": "cpu:11436836", + " 116 ret bls12_381_g1_msm -> Ok(Bytes(obj#107))": "cpu:16979726, mem:244002, objs:-/54@f3e7e2fb", " 117 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", - " 118 ret obj_cmp -> Ok(0)": "cpu:16975612", + " 118 ret obj_cmp -> Ok(0)": "cpu:16980026", " 119 call vec_new_from_slice(4)": "", - " 120 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:16976825, mem:243442, objs:-/55@ab90985a", + " 120 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:16981239, mem:244114, objs:-/55@c50146aa", " 121 call vec_new_from_slice(4)": "", - " 122 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:16978038, mem:243554, objs:-/56@37997c1f", + " 122 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:16982452, mem:244226, objs:-/56@c60df128", " 123 call bls12_381_g1_msm(Vec(obj#109), Vec(obj#111))": "", - " 124 call vec_len(Vec(obj#109))": "cpu:16978282", - " 125 ret vec_len -> Ok(U32(4))": "cpu:16978404", - " 126 call vec_len(Vec(obj#111))": "cpu:19916275, mem:243954", - " 127 ret vec_len -> Ok(U32(4))": "cpu:19916397", - " 128 ret bls12_381_g1_msm -> Ok(Bytes(obj#113))": "cpu:25458742, mem:364739, objs:-/57@45f9aef8", + " 124 call vec_len(Vec(obj#109))": "cpu:16982696", + " 125 ret vec_len -> Ok(U32(4))": "cpu:16982818", + " 126 call vec_len(Vec(obj#111))": "cpu:19921261, mem:244626", + " 127 ret vec_len -> Ok(U32(4))": "cpu:19921383", + " 128 ret bls12_381_g1_msm -> Ok(Bytes(obj#113))": "cpu:25464273, mem:365523, objs:-/57@bcaec10e", " 129 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", - " 130 ret obj_cmp -> Ok(0)": "cpu:25459042", + " 130 ret obj_cmp -> Ok(0)": "cpu:25464573", " 131 call vec_new_from_slice(4)": "", - " 132 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:25460255, mem:364851, objs:-/58@922a4b40", + " 132 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:25465786, mem:365635, objs:-/58@c312d486", " 133 call vec_new_from_slice(4)": "", - " 134 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:25461468, mem:364963, objs:-/59@8dd0ef66", + " 134 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:25466999, mem:365747, objs:-/59@8118160e", " 135 call bls12_381_g1_msm(Vec(obj#115), Vec(obj#117))": "", - " 136 call vec_len(Vec(obj#115))": "cpu:25461712", - " 137 ret vec_len -> Ok(U32(4))": "cpu:25461834", - " 138 call vec_len(Vec(obj#117))": "cpu:28399705, mem:365363", - " 139 ret vec_len -> Ok(U32(4))": "cpu:28399827", - " 140 ret bls12_381_g1_msm -> Ok(Bytes(obj#119))": "cpu:33942172, mem:486148, objs:-/60@8bdaca17", + " 136 call vec_len(Vec(obj#115))": "cpu:25467243", + " 137 ret vec_len -> Ok(U32(4))": "cpu:25467365", + " 138 call vec_len(Vec(obj#117))": "cpu:28405808, mem:366147", + " 139 ret vec_len -> Ok(U32(4))": "cpu:28405930", + " 140 ret bls12_381_g1_msm -> Ok(Bytes(obj#119))": "cpu:33948820, mem:487044, objs:-/60@2f469956", " 141 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", - " 142 ret obj_cmp -> Ok(0)": "cpu:33942472", + " 142 ret obj_cmp -> Ok(0)": "cpu:33949120", " 143 call vec_new_from_slice(4)": "", - " 144 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:33943685, mem:486260, objs:-/61@df7f799", + " 144 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:33950333, mem:487156, objs:-/61@e3634851", " 145 call vec_new_from_slice(4)": "", - " 146 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:33944898, mem:486372, objs:-/62@f4da3e99", + " 146 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:33951546, mem:487268, objs:-/62@efcd97c0", " 147 call bls12_381_g1_msm(Vec(obj#121), Vec(obj#123))": "", - " 148 call vec_len(Vec(obj#121))": "cpu:33945142", - " 149 ret vec_len -> Ok(U32(4))": "cpu:33945264", - " 150 call vec_len(Vec(obj#123))": "cpu:36883135, mem:486772", - " 151 ret vec_len -> Ok(U32(4))": "cpu:36883257", - " 152 ret bls12_381_g1_msm -> Ok(Bytes(obj#125))": "cpu:42425602, mem:607557, objs:-/63@35eabd26", + " 148 call vec_len(Vec(obj#121))": "cpu:33951790", + " 149 ret vec_len -> Ok(U32(4))": "cpu:33951912", + " 150 call vec_len(Vec(obj#123))": "cpu:36890355, mem:487668", + " 151 ret vec_len -> Ok(U32(4))": "cpu:36890477", + " 152 ret bls12_381_g1_msm -> Ok(Bytes(obj#125))": "cpu:42433367, mem:608565, objs:-/63@56df4afe", " 153 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", - " 154 ret obj_cmp -> Ok(0)": "cpu:42425902", + " 154 ret obj_cmp -> Ok(0)": "cpu:42433667", " 155 call vec_new_from_slice(4)": "", - " 156 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:42427115, mem:607669, objs:-/64@6c5d9f29", + " 156 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:42434880, mem:608677, objs:-/64@c6fa44ae", " 157 call vec_new_from_slice(4)": "", - " 158 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:42428328, mem:607781, objs:-/65@496e95da", + " 158 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:42436093, mem:608789, objs:-/65@4be879d9", " 159 call bls12_381_g1_msm(Vec(obj#127), Vec(obj#129))": "", - " 160 call vec_len(Vec(obj#127))": "cpu:42428572", - " 161 ret vec_len -> Ok(U32(4))": "cpu:42428694", - " 162 call vec_len(Vec(obj#129))": "cpu:45366565, mem:608181", - " 163 ret vec_len -> Ok(U32(4))": "cpu:45366687", - " 164 ret bls12_381_g1_msm -> Ok(Bytes(obj#131))": "cpu:50909032, mem:728966, objs:-/66@5ca7aeea", + " 160 call vec_len(Vec(obj#127))": "cpu:42436337", + " 161 ret vec_len -> Ok(U32(4))": "cpu:42436459", + " 162 call vec_len(Vec(obj#129))": "cpu:45374902, mem:609189", + " 163 ret vec_len -> Ok(U32(4))": "cpu:45375024", + " 164 ret bls12_381_g1_msm -> Ok(Bytes(obj#131))": "cpu:50917914, mem:730086, objs:-/66@cd9321cc", " 165 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", - " 166 ret obj_cmp -> Ok(0)": "cpu:50909332", + " 166 ret obj_cmp -> Ok(0)": "cpu:50918214", " 167 call vec_new_from_slice(4)": "", - " 168 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:50910545, mem:729078, objs:-/67@4a92bac5", + " 168 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:50919427, mem:730198, objs:-/67@83139207", " 169 call vec_new_from_slice(4)": "", - " 170 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:50911758, mem:729190, objs:-/68@d3b0b9d1", + " 170 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:50920640, mem:730310, objs:-/68@bff98043", " 171 call bls12_381_g1_msm(Vec(obj#133), Vec(obj#135))": "", - " 172 call vec_len(Vec(obj#133))": "cpu:50912002", - " 173 ret vec_len -> Ok(U32(4))": "cpu:50912124", - " 174 call vec_len(Vec(obj#135))": "cpu:53849995, mem:729590", - " 175 ret vec_len -> Ok(U32(4))": "cpu:53850117", - " 176 ret bls12_381_g1_msm -> Ok(Bytes(obj#137))": "cpu:59392462, mem:850375, objs:-/69@cb830a6b", + " 172 call vec_len(Vec(obj#133))": "cpu:50920884", + " 173 ret vec_len -> Ok(U32(4))": "cpu:50921006", + " 174 call vec_len(Vec(obj#135))": "cpu:53859449, mem:730710", + " 175 ret vec_len -> Ok(U32(4))": "cpu:53859571", + " 176 ret bls12_381_g1_msm -> Ok(Bytes(obj#137))": "cpu:59402461, mem:851607, objs:-/69@57b33ea5", " 177 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", - " 178 ret obj_cmp -> Ok(0)": "cpu:59392762", + " 178 ret obj_cmp -> Ok(0)": "cpu:59402761", " 179 call vec_new_from_slice(4)": "", - " 180 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:59393975, mem:850487, objs:-/70@a6b0753a", + " 180 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:59403974, mem:851719, objs:-/70@67ce2467", " 181 call vec_new_from_slice(4)": "", - " 182 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:59395188, mem:850599, objs:-/71@79e58678", + " 182 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:59405187, mem:851831, objs:-/71@1a3a91ea", " 183 call bls12_381_g1_msm(Vec(obj#139), Vec(obj#141))": "", - " 184 call vec_len(Vec(obj#139))": "cpu:59395432", - " 185 ret vec_len -> Ok(U32(4))": "cpu:59395554", - " 186 call vec_len(Vec(obj#141))": "cpu:62333425, mem:850999", - " 187 ret vec_len -> Ok(U32(4))": "cpu:62333547", - " 188 ret bls12_381_g1_msm -> Ok(Bytes(obj#143))": "cpu:67875892, mem:971784, objs:-/72@e635821a", + " 184 call vec_len(Vec(obj#139))": "cpu:59405431", + " 185 ret vec_len -> Ok(U32(4))": "cpu:59405553", + " 186 call vec_len(Vec(obj#141))": "cpu:62343996, mem:852231", + " 187 ret vec_len -> Ok(U32(4))": "cpu:62344118", + " 188 ret bls12_381_g1_msm -> Ok(Bytes(obj#143))": "cpu:67887008, mem:973128, objs:-/72@d3eea58f", " 189 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", - " 190 ret obj_cmp -> Ok(0)": "cpu:67876192", + " 190 ret obj_cmp -> Ok(0)": "cpu:67887308", " 191 call vec_new_from_slice(4)": "", - " 192 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:67877405, mem:971896, objs:-/73@e9ef5fe0", + " 192 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:67888521, mem:973240, objs:-/73@d260e80a", " 193 call vec_new_from_slice(4)": "", - " 194 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:67878618, mem:972008, objs:-/74@322908e2", + " 194 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:67889734, mem:973352, objs:-/74@fc820513", " 195 call bls12_381_g1_msm(Vec(obj#145), Vec(obj#147))": "", - " 196 call vec_len(Vec(obj#145))": "cpu:67878862", - " 197 ret vec_len -> Ok(U32(4))": "cpu:67878984", - " 198 call vec_len(Vec(obj#147))": "cpu:70816855, mem:972408", - " 199 ret vec_len -> Ok(U32(4))": "cpu:70816977", - " 200 ret bls12_381_g1_msm -> Ok(Bytes(obj#149))": "cpu:76359322, mem:1093193, objs:-/75@36a9773b", + " 196 call vec_len(Vec(obj#145))": "cpu:67889978", + " 197 ret vec_len -> Ok(U32(4))": "cpu:67890100", + " 198 call vec_len(Vec(obj#147))": "cpu:70828543, mem:973752", + " 199 ret vec_len -> Ok(U32(4))": "cpu:70828665", + " 200 ret bls12_381_g1_msm -> Ok(Bytes(obj#149))": "cpu:76371555, mem:1094649, objs:-/75@14642af", " 201 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", - " 202 ret obj_cmp -> Ok(0)": "cpu:76359622", + " 202 ret obj_cmp -> Ok(0)": "cpu:76371855", " 203 call vec_new_from_slice(4)": "", - " 204 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:76360835, mem:1093305, objs:-/76@2f819631", + " 204 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:76373068, mem:1094761, objs:-/76@8e00d86c", " 205 call vec_new_from_slice(4)": "", - " 206 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:76362048, mem:1093417, objs:-/77@e275a1fc", + " 206 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:76374281, mem:1094873, objs:-/77@8e3de39e", " 207 call bls12_381_g1_msm(Vec(obj#151), Vec(obj#153))": "", - " 208 call vec_len(Vec(obj#151))": "cpu:76362292", - " 209 ret vec_len -> Ok(U32(4))": "cpu:76362414", - " 210 call vec_len(Vec(obj#153))": "cpu:79300285, mem:1093817", - " 211 ret vec_len -> Ok(U32(4))": "cpu:79300407", - " 212 ret bls12_381_g1_msm -> Ok(Bytes(obj#155))": "cpu:84842752, mem:1214602, objs:-/78@b6e9921d", + " 208 call vec_len(Vec(obj#151))": "cpu:76374525", + " 209 ret vec_len -> Ok(U32(4))": "cpu:76374647", + " 210 call vec_len(Vec(obj#153))": "cpu:79313090, mem:1095273", + " 211 ret vec_len -> Ok(U32(4))": "cpu:79313212", + " 212 ret bls12_381_g1_msm -> Ok(Bytes(obj#155))": "cpu:84856102, mem:1216170, objs:-/78@8bf03081", " 213 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", - " 214 ret obj_cmp -> Ok(0)": "cpu:84843052", + " 214 ret obj_cmp -> Ok(0)": "cpu:84856402", " 215 call vec_new_from_slice(4)": "", - " 216 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:84844265, mem:1214714, objs:-/79@c816d3a2", + " 216 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:84857615, mem:1216282, objs:-/79@df97cf2f", " 217 call vec_new_from_slice(4)": "", - " 218 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:84845478, mem:1214826, objs:-/80@d30bb3da", + " 218 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:84858828, mem:1216394, objs:-/80@a4dbe930", " 219 call bls12_381_g1_msm(Vec(obj#157), Vec(obj#159))": "", - " 220 call vec_len(Vec(obj#157))": "cpu:84845722", - " 221 ret vec_len -> Ok(U32(4))": "cpu:84845844", - " 222 call vec_len(Vec(obj#159))": "cpu:87783715, mem:1215226", - " 223 ret vec_len -> Ok(U32(4))": "cpu:87783837", - " 224 ret bls12_381_g1_msm -> Ok(Bytes(obj#161))": "cpu:93326182, mem:1336011, objs:-/81@807a3d69", + " 220 call vec_len(Vec(obj#157))": "cpu:84859072", + " 221 ret vec_len -> Ok(U32(4))": "cpu:84859194", + " 222 call vec_len(Vec(obj#159))": "cpu:87797637, mem:1216794", + " 223 ret vec_len -> Ok(U32(4))": "cpu:87797759", + " 224 ret bls12_381_g1_msm -> Ok(Bytes(obj#161))": "cpu:93340649, mem:1337691, objs:-/81@9f62a7d5", " 225 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", - " 226 ret obj_cmp -> Ok(0)": "cpu:93326482", + " 226 ret obj_cmp -> Ok(0)": "cpu:93340949", " 227 call bytes_new_from_slice(96)": "cpu:661, mem:0", - " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:1646, mem:176, objs:-/82@564277db", + " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:1646, mem:176, objs:-/82@dd48ce00", " 229 call bytes_new_from_slice(96)": "cpu:2307", - " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:3292, mem:352, objs:-/83@e2a51f5f", + " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:3292, mem:352, objs:-/83@2ba0a36c", " 231 call bytes_new_from_slice(96)": "cpu:3953", - " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:4938, mem:528, objs:-/84@935c1ff5", + " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:4938, mem:528, objs:-/84@a00db887", " 233 call bytes_new_from_slice(96)": "cpu:5599", - " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:6584, mem:704, objs:-/85@9f799d28", + " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:6584, mem:704, objs:-/85@2ff3a0e7", " 235 call bytes_new_from_slice(96)": "cpu:7245", - " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:8230, mem:880, objs:-/86@2110ea71", + " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:8230, mem:880, objs:-/86@67a727f9", " 237 call bytes_new_from_slice(96)": "cpu:8891", - " 238 ret bytes_new_from_slice -> Ok(Bytes(obj#173))": "cpu:9876, mem:1056, objs:-/87@a31f3f5d", + " 238 ret bytes_new_from_slice -> Ok(Bytes(obj#173))": "cpu:9876, mem:1056, objs:-/87@928f7064", " 239 call bytes_new_from_slice(96)": "cpu:10537", - " 240 ret bytes_new_from_slice -> Ok(Bytes(obj#175))": "cpu:11522, mem:1232, objs:-/88@dab27ae", + " 240 ret bytes_new_from_slice -> Ok(Bytes(obj#175))": "cpu:11522, mem:1232, objs:-/88@8e6f6128", " 241 call bytes_new_from_slice(96)": "cpu:12183", - " 242 ret bytes_new_from_slice -> Ok(Bytes(obj#177))": "cpu:13168, mem:1408, objs:-/89@14ab5c53", + " 242 ret bytes_new_from_slice -> Ok(Bytes(obj#177))": "cpu:13168, mem:1408, objs:-/89@8b355a07", " 243 call bytes_new_from_slice(96)": "cpu:13829", - " 244 ret bytes_new_from_slice -> Ok(Bytes(obj#179))": "cpu:14814, mem:1584, objs:-/90@cee21a21", + " 244 ret bytes_new_from_slice -> Ok(Bytes(obj#179))": "cpu:14814, mem:1584, objs:-/90@2bebefc3", " 245 call bytes_new_from_slice(96)": "cpu:15475", - " 246 ret bytes_new_from_slice -> Ok(Bytes(obj#181))": "cpu:16460, mem:1760, objs:-/91@ff89dba1", + " 246 ret bytes_new_from_slice -> Ok(Bytes(obj#181))": "cpu:16460, mem:1760, objs:-/91@87d223bb", " 247 call vec_new_from_slice(10)": "", - " 248 ret vec_new_from_slice -> Ok(Vec(obj#183))": "cpu:18051, mem:1920, objs:-/92@faa48f5", - " 249 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 250 ret obj_from_u256_pieces -> Ok(U256(obj#185))": "cpu:18552, mem:1984, objs:-/93@b4b734d", - " 251 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", - " 252 ret obj_from_u256_pieces -> Ok(U256(obj#187))": "cpu:19053, mem:2048, objs:-/94@7ae7ea62", - " 253 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", - " 254 ret obj_from_u256_pieces -> Ok(U256(obj#189))": "cpu:19554, mem:2112, objs:-/95@e434c126", - " 255 call obj_from_u256_pieces(12052668375261465624, 1115056820630111376, 18258964384967382160, 2376171010711085994)": "", - " 256 ret obj_from_u256_pieces -> Ok(U256(obj#191))": "cpu:20055, mem:2176, objs:-/96@183d8ea4", - " 257 call obj_from_u256_pieces(8424913463146644043, 9405616456888726852, 9448465455624499961, 13755081130528028509)": "", - " 258 ret obj_from_u256_pieces -> Ok(U256(obj#193))": "cpu:20556, mem:2240, objs:-/97@32535bd6", - " 259 call obj_from_u256_pieces(15932224105337669142, 15525077366759919847, 6907659503856715709, 14782459034950873929)": "", - " 260 ret obj_from_u256_pieces -> Ok(U256(obj#195))": "cpu:21057, mem:2304, objs:-/98@ccf04083", - " 261 call obj_from_u256_pieces(17479366267685995856, 2356981524146247225, 7204796457943508788, 837992310336682530)": "", - " 262 ret obj_from_u256_pieces -> Ok(U256(obj#197))": "cpu:21558, mem:2368, objs:-/99@8af3c26a", - " 263 call obj_from_u256_pieces(8412423812554252592, 7175749094301908688, 722094618885055393, 391155872238797487)": "", - " 264 ret obj_from_u256_pieces -> Ok(U256(obj#199))": "cpu:22059, mem:2432, objs:-/100@9dc760bc", - " 265 call obj_from_u256_pieces(828146814120262544, 5182432132645548012, 9145903145685500019, 15514783195400236392)": "", - " 266 ret obj_from_u256_pieces -> Ok(U256(obj#201))": "cpu:22560, mem:2496, objs:-/101@3290cab6", - " 267 call obj_from_u256_pieces(6220368034795741091, 7710193708629148312, 14360099323855569558, 5217142916942598430)": "", - " 268 ret obj_from_u256_pieces -> Ok(U256(obj#203))": "cpu:23061, mem:2560, objs:-/102@d4af0c4e", + " 248 ret vec_new_from_slice -> Ok(Vec(obj#183))": "cpu:18051, mem:1920, objs:-/92@e05d7d45", + " 249 call obj_from_u256_pieces(17618770950827998744, 14662068724577735075, 2249062990298394979, 9977923089826089615)": "", + " 250 ret obj_from_u256_pieces -> Ok(U256(obj#185))": "cpu:18552, mem:1984, objs:-/93@e4abda0a", + " 251 call obj_from_u256_pieces(2821194631792961874, 16547277464900892467, 14819559542962736549, 17981056101655367365)": "", + " 252 ret obj_from_u256_pieces -> Ok(U256(obj#187))": "cpu:19053, mem:2048, objs:-/94@59894c0f", + " 253 call obj_from_u256_pieces(14823680325444367514, 16057910356200631686, 11653412393475167983, 17971148540471083046)": "", + " 254 ret obj_from_u256_pieces -> Ok(U256(obj#189))": "cpu:19554, mem:2112, objs:-/95@f611f183", + " 255 call obj_from_u256_pieces(16502273625602787483, 2713688267813643125, 15061415354752276271, 16690818686241479208)": "", + " 256 ret obj_from_u256_pieces -> Ok(U256(obj#191))": "cpu:20055, mem:2176, objs:-/96@b6efa1b5", + " 257 call obj_from_u256_pieces(7027192125185647877, 17045944964573428771, 10144290202347477085, 10705035438189734679)": "", + " 258 ret obj_from_u256_pieces -> Ok(U256(obj#193))": "cpu:20556, mem:2240, objs:-/97@f626d632", + " 259 call obj_from_u256_pieces(14552017996338670628, 17384320552016825872, 12623460464266321339, 2351693706725345962)": "", + " 260 ret obj_from_u256_pieces -> Ok(U256(obj#195))": "cpu:21057, mem:2304, objs:-/98@dc0fd6a8", + " 261 call obj_from_u256_pieces(4037855643097226315, 3588748593401323528, 18145554024939280631, 6805129555195258487)": "", + " 262 ret obj_from_u256_pieces -> Ok(U256(obj#197))": "cpu:21558, mem:2368, objs:-/99@3a43cf0d", + " 263 call obj_from_u256_pieces(10690484396013942008, 3220507769215303921, 6575779185716732641, 1735816512470570891)": "", + " 264 ret obj_from_u256_pieces -> Ok(U256(obj#199))": "cpu:22059, mem:2432, objs:-/100@72aa4d1", + " 265 call obj_from_u256_pieces(854729243539327218, 14181304886955281704, 12059208175304010597, 16702944845996181439)": "", + " 266 ret obj_from_u256_pieces -> Ok(U256(obj#201))": "cpu:22560, mem:2496, objs:-/101@898aec71", + " 267 call obj_from_u256_pieces(11497158191995684079, 43326291776979156, 14533160951240524555, 12852174102015084654)": "", + " 268 ret obj_from_u256_pieces -> Ok(U256(obj#203))": "cpu:23061, mem:2560, objs:-/102@a0762125", " 269 call vec_new_from_slice(10)": "", - " 270 ret vec_new_from_slice -> Ok(Vec(obj#205))": "cpu:24652, mem:2720, objs:-/103@3eb62ff6", + " 270 ret vec_new_from_slice -> Ok(Vec(obj#205))": "cpu:24652, mem:2720, objs:-/103@d1b8c868", " 271 call bls12_381_g1_msm(Vec(obj#183), Vec(obj#205))": "", " 272 call vec_len(Vec(obj#183))": "cpu:24896", " 273 ret vec_len -> Ok(U32(10))": "cpu:25018", - " 274 call vec_len(Vec(obj#205))": "cpu:7368953, mem:3696", - " 275 ret vec_len -> Ok(U32(10))": "cpu:7369075", - " 276 ret bls12_381_g1_msm -> Ok(Bytes(obj#207))": "cpu:17442415, mem:141298, objs:-/104@fdb04eb5", - " 277 call vec_get(Vec(obj#183), U32(0))": "cpu:17444177, mem:141362, objs:-/105@ec4ddb12", - " 278 ret vec_get -> Ok(Bytes(obj#163))": "cpu:17444403", + " 274 call vec_len(Vec(obj#205))": "cpu:7370383, mem:3696", + " 275 ret vec_len -> Ok(U32(10))": "cpu:7370505", + " 276 ret bls12_381_g1_msm -> Ok(Bytes(obj#207))": "cpu:17444390, mem:141410, objs:-/104@5e3fb337", + " 277 call vec_get(Vec(obj#183), U32(0))": "cpu:17446697, mem:141586, objs:-/105@cc1ad99a", + " 278 ret vec_get -> Ok(Bytes(obj#163))": "cpu:17446923", " 279 call vec_get(Vec(obj#205), U32(0))": "", - " 280 ret vec_get -> Ok(U256(obj#185))": "cpu:17444629", + " 280 ret vec_get -> Ok(U256(obj#185))": "cpu:17447149", " 281 call bls12_381_g1_mul(Bytes(obj#163), U256(obj#185))": "", - " 282 ret bls12_381_g1_mul -> Ok(Bytes(obj#211))": "cpu:20734588, mem:141426, objs:-/106@cc7eaa6b", + " 282 ret bls12_381_g1_mul -> Ok(Bytes(obj#211))": "cpu:20737796, mem:141762, objs:-/106@4d87b466", " 283 call bls12_381_g1_add(Bytes(obj#209), Bytes(obj#211))": "", - " 284 ret bls12_381_g1_add -> Ok(Bytes(obj#213))": "cpu:22305528, mem:141490, objs:-/107@3a1a670c", + " 284 ret bls12_381_g1_add -> Ok(Bytes(obj#213))": "cpu:20848547, mem:141938, objs:-/107@a668862", " 285 call vec_get(Vec(obj#183), U32(1))": "", - " 286 ret vec_get -> Ok(Bytes(obj#165))": "cpu:22305754", + " 286 ret vec_get -> Ok(Bytes(obj#165))": "cpu:20848773", " 287 call vec_get(Vec(obj#205), U32(1))": "", - " 288 ret vec_get -> Ok(U256(obj#187))": "cpu:22305980", + " 288 ret vec_get -> Ok(U256(obj#187))": "cpu:20848999", " 289 call bls12_381_g1_mul(Bytes(obj#165), U256(obj#187))": "", - " 290 ret bls12_381_g1_mul -> Ok(Bytes(obj#215))": "cpu:25595939, mem:141554, objs:-/108@6e42150e", + " 290 ret bls12_381_g1_mul -> Ok(Bytes(obj#215))": "cpu:24139646, mem:142114, objs:-/108@26939bdb", " 291 call bls12_381_g1_add(Bytes(obj#213), Bytes(obj#215))": "", - " 292 ret bls12_381_g1_add -> Ok(Bytes(obj#217))": "cpu:27166879, mem:141618, objs:-/109@6a2aded5", + " 292 ret bls12_381_g1_add -> Ok(Bytes(obj#217))": "cpu:24250397, mem:142290, objs:-/109@afa942f2", " 293 call vec_get(Vec(obj#183), U32(2))": "", - " 294 ret vec_get -> Ok(Bytes(obj#167))": "cpu:27167105", + " 294 ret vec_get -> Ok(Bytes(obj#167))": "cpu:24250623", " 295 call vec_get(Vec(obj#205), U32(2))": "", - " 296 ret vec_get -> Ok(U256(obj#189))": "cpu:27167331", + " 296 ret vec_get -> Ok(U256(obj#189))": "cpu:24250849", " 297 call bls12_381_g1_mul(Bytes(obj#167), U256(obj#189))": "", - " 298 ret bls12_381_g1_mul -> Ok(Bytes(obj#219))": "cpu:30457290, mem:141682, objs:-/110@dc6ffdf8", + " 298 ret bls12_381_g1_mul -> Ok(Bytes(obj#219))": "cpu:27541496, mem:142466, objs:-/110@80ebabcb", " 299 call bls12_381_g1_add(Bytes(obj#217), Bytes(obj#219))": "", - " 300 ret bls12_381_g1_add -> Ok(Bytes(obj#221))": "cpu:32028230, mem:141746, objs:-/111@52ea29b3", + " 300 ret bls12_381_g1_add -> Ok(Bytes(obj#221))": "cpu:27652247, mem:142642, objs:-/111@c5129985", " 301 call vec_get(Vec(obj#183), U32(3))": "", - " 302 ret vec_get -> Ok(Bytes(obj#169))": "cpu:32028456", + " 302 ret vec_get -> Ok(Bytes(obj#169))": "cpu:27652473", " 303 call vec_get(Vec(obj#205), U32(3))": "", - " 304 ret vec_get -> Ok(U256(obj#191))": "cpu:32028682", + " 304 ret vec_get -> Ok(U256(obj#191))": "cpu:27652699", " 305 call bls12_381_g1_mul(Bytes(obj#169), U256(obj#191))": "", - " 306 ret bls12_381_g1_mul -> Ok(Bytes(obj#223))": "cpu:35318641, mem:141810, objs:-/112@cc74967e", + " 306 ret bls12_381_g1_mul -> Ok(Bytes(obj#223))": "cpu:30943346, mem:142818, objs:-/112@185b22ec", " 307 call bls12_381_g1_add(Bytes(obj#221), Bytes(obj#223))": "", - " 308 ret bls12_381_g1_add -> Ok(Bytes(obj#225))": "cpu:36889581, mem:141874, objs:-/113@36be824", + " 308 ret bls12_381_g1_add -> Ok(Bytes(obj#225))": "cpu:31054097, mem:142994, objs:-/113@c4f97300", " 309 call vec_get(Vec(obj#183), U32(4))": "", - " 310 ret vec_get -> Ok(Bytes(obj#171))": "cpu:36889807", + " 310 ret vec_get -> Ok(Bytes(obj#171))": "cpu:31054323", " 311 call vec_get(Vec(obj#205), U32(4))": "", - " 312 ret vec_get -> Ok(U256(obj#193))": "cpu:36890033", + " 312 ret vec_get -> Ok(U256(obj#193))": "cpu:31054549", " 313 call bls12_381_g1_mul(Bytes(obj#171), U256(obj#193))": "", - " 314 ret bls12_381_g1_mul -> Ok(Bytes(obj#227))": "cpu:40179992, mem:141938, objs:-/114@7a253d36", + " 314 ret bls12_381_g1_mul -> Ok(Bytes(obj#227))": "cpu:34345196, mem:143170, objs:-/114@5dcb2245", " 315 call bls12_381_g1_add(Bytes(obj#225), Bytes(obj#227))": "", - " 316 ret bls12_381_g1_add -> Ok(Bytes(obj#229))": "cpu:41750932, mem:142002, objs:-/115@99fe060a", + " 316 ret bls12_381_g1_add -> Ok(Bytes(obj#229))": "cpu:34455947, mem:143346, objs:-/115@9b8b7719", " 317 call vec_get(Vec(obj#183), U32(5))": "", - " 318 ret vec_get -> Ok(Bytes(obj#173))": "cpu:41751158", + " 318 ret vec_get -> Ok(Bytes(obj#173))": "cpu:34456173", " 319 call vec_get(Vec(obj#205), U32(5))": "", - " 320 ret vec_get -> Ok(U256(obj#195))": "cpu:41751384", + " 320 ret vec_get -> Ok(U256(obj#195))": "cpu:34456399", " 321 call bls12_381_g1_mul(Bytes(obj#173), U256(obj#195))": "", - " 322 ret bls12_381_g1_mul -> Ok(Bytes(obj#231))": "cpu:45041343, mem:142066, objs:-/116@a9d3bff3", + " 322 ret bls12_381_g1_mul -> Ok(Bytes(obj#231))": "cpu:37747046, mem:143522, objs:-/116@7e32132b", " 323 call bls12_381_g1_add(Bytes(obj#229), Bytes(obj#231))": "", - " 324 ret bls12_381_g1_add -> Ok(Bytes(obj#233))": "cpu:46612283, mem:142130, objs:-/117@17c7b36e", + " 324 ret bls12_381_g1_add -> Ok(Bytes(obj#233))": "cpu:37857797, mem:143698, objs:-/117@820927b5", " 325 call vec_get(Vec(obj#183), U32(6))": "", - " 326 ret vec_get -> Ok(Bytes(obj#175))": "cpu:46612509", + " 326 ret vec_get -> Ok(Bytes(obj#175))": "cpu:37858023", " 327 call vec_get(Vec(obj#205), U32(6))": "", - " 328 ret vec_get -> Ok(U256(obj#197))": "cpu:46612735", + " 328 ret vec_get -> Ok(U256(obj#197))": "cpu:37858249", " 329 call bls12_381_g1_mul(Bytes(obj#175), U256(obj#197))": "", - " 330 ret bls12_381_g1_mul -> Ok(Bytes(obj#235))": "cpu:49902694, mem:142194, objs:-/118@1df5bedb", + " 330 ret bls12_381_g1_mul -> Ok(Bytes(obj#235))": "cpu:41148896, mem:143874, objs:-/118@734cedc3", " 331 call bls12_381_g1_add(Bytes(obj#233), Bytes(obj#235))": "", - " 332 ret bls12_381_g1_add -> Ok(Bytes(obj#237))": "cpu:51473634, mem:142258, objs:-/119@aa439247", + " 332 ret bls12_381_g1_add -> Ok(Bytes(obj#237))": "cpu:41259647, mem:144050, objs:-/119@9f782901", " 333 call vec_get(Vec(obj#183), U32(7))": "", - " 334 ret vec_get -> Ok(Bytes(obj#177))": "cpu:51473860", + " 334 ret vec_get -> Ok(Bytes(obj#177))": "cpu:41259873", " 335 call vec_get(Vec(obj#205), U32(7))": "", - " 336 ret vec_get -> Ok(U256(obj#199))": "cpu:51474086", + " 336 ret vec_get -> Ok(U256(obj#199))": "cpu:41260099", " 337 call bls12_381_g1_mul(Bytes(obj#177), U256(obj#199))": "", - " 338 ret bls12_381_g1_mul -> Ok(Bytes(obj#239))": "cpu:54764045, mem:142322, objs:-/120@9af9e040", + " 338 ret bls12_381_g1_mul -> Ok(Bytes(obj#239))": "cpu:44550746, mem:144226, objs:-/120@6222b65f", " 339 call bls12_381_g1_add(Bytes(obj#237), Bytes(obj#239))": "", - " 340 ret bls12_381_g1_add -> Ok(Bytes(obj#241))": "cpu:56334985, mem:142386, objs:-/121@c40edba", + " 340 ret bls12_381_g1_add -> Ok(Bytes(obj#241))": "cpu:44661497, mem:144402, objs:-/121@ec08d7b8", " 341 call vec_get(Vec(obj#183), U32(8))": "", - " 342 ret vec_get -> Ok(Bytes(obj#179))": "cpu:56335211", + " 342 ret vec_get -> Ok(Bytes(obj#179))": "cpu:44661723", " 343 call vec_get(Vec(obj#205), U32(8))": "", - " 344 ret vec_get -> Ok(U256(obj#201))": "cpu:56335437", + " 344 ret vec_get -> Ok(U256(obj#201))": "cpu:44661949", " 345 call bls12_381_g1_mul(Bytes(obj#179), U256(obj#201))": "", - " 346 ret bls12_381_g1_mul -> Ok(Bytes(obj#243))": "cpu:59625396, mem:142450, objs:-/122@1ece2a5b", + " 346 ret bls12_381_g1_mul -> Ok(Bytes(obj#243))": "cpu:47952596, mem:144578, objs:-/122@ed50266c", " 347 call bls12_381_g1_add(Bytes(obj#241), Bytes(obj#243))": "", - " 348 ret bls12_381_g1_add -> Ok(Bytes(obj#245))": "cpu:61196336, mem:142514, objs:-/123@dd3ac0cb", + " 348 ret bls12_381_g1_add -> Ok(Bytes(obj#245))": "cpu:48063347, mem:144754, objs:-/123@c4adee2a", " 349 call vec_get(Vec(obj#183), U32(9))": "", - " 350 ret vec_get -> Ok(Bytes(obj#181))": "cpu:61196562", + " 350 ret vec_get -> Ok(Bytes(obj#181))": "cpu:48063573", " 351 call vec_get(Vec(obj#205), U32(9))": "", - " 352 ret vec_get -> Ok(U256(obj#203))": "cpu:61196788", + " 352 ret vec_get -> Ok(U256(obj#203))": "cpu:48063799", " 353 call bls12_381_g1_mul(Bytes(obj#181), U256(obj#203))": "", - " 354 ret bls12_381_g1_mul -> Ok(Bytes(obj#247))": "cpu:64486747, mem:142578, objs:-/124@804c4396", + " 354 ret bls12_381_g1_mul -> Ok(Bytes(obj#247))": "cpu:51354446, mem:144930, objs:-/124@e5cf2285", " 355 call bls12_381_g1_add(Bytes(obj#245), Bytes(obj#247))": "", - " 356 ret bls12_381_g1_add -> Ok(Bytes(obj#249))": "cpu:66057687, mem:142642, objs:-/125@24d96742", + " 356 ret bls12_381_g1_add -> Ok(Bytes(obj#249))": "cpu:51465197, mem:145106, objs:-/125@e28e8633", " 357 call obj_cmp(Bytes(obj#249), Bytes(obj#207))": "", - " 358 ret obj_cmp -> Ok(0)": "cpu:66057987", - " 359 end": "cpu:66057987, mem:142642, prngs:-/-, objs:-/125@24d96742, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 358 ret obj_cmp -> Ok(0)": "cpu:51465497", + " 359 end": "cpu:51465497, mem:145106, prngs:-/-, objs:-/125@e28e8633, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g1_mul.json b/soroban-env-host/observations/22/test__bls12_381__g1_mul.json index 077ed8879..804d5ad82 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g1_mul.json +++ b/soroban-env-host/observations/22/test__bls12_381__g1_mul.json @@ -1,28 +1,28 @@ { " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", - " 1 call obj_from_u256_pieces(0, 0, 0, 0)": "cpu:1762, mem:64, objs:-/1@2142c5f5", - " 2 ret obj_from_u256_pieces -> Ok(U256(obj#3))": "cpu:2263, mem:128, objs:-/2@a8ecc130", + " 1 call obj_from_u256_pieces(0, 0, 0, 0)": "cpu:2307, mem:176, objs:-/1@2142c5f5", + " 2 ret obj_from_u256_pieces -> Ok(U256(obj#3))": "cpu:2808, mem:240, objs:-/2@a8ecc130", " 3 call bls12_381_g1_mul(Bytes(obj#1), U256(obj#3))": "", - " 4 ret bls12_381_g1_mul -> Ok(Bytes(obj#5))": "cpu:3292222, mem:192, objs:-/3@ee8b49", - " 5 call obj_cmp(Bytes(obj#5), Bytes(obj#7))": "cpu:3293984, mem:256, objs:-/4@ccb573fe", - " 6 ret obj_cmp -> Ok(0)": "cpu:3294284", - " 7 call bls12_381_g1_mul(Bytes(obj#9), U256(1))": "cpu:3296046, mem:320, objs:-/5@2c88203b", - " 8 ret bls12_381_g1_mul -> Ok(Bytes(obj#11))": "cpu:6585883, mem:384, objs:-/6@b1c17ed5", + " 4 ret bls12_381_g1_mul -> Ok(Bytes(obj#5))": "cpu:3293455, mem:416, objs:-/3@ee8b49", + " 5 call obj_cmp(Bytes(obj#5), Bytes(obj#7))": "cpu:3295762, mem:592, objs:-/4@ccb573fe", + " 6 ret obj_cmp -> Ok(0)": "cpu:3296062", + " 7 call bls12_381_g1_mul(Bytes(obj#9), U256(1))": "cpu:3298369, mem:768, objs:-/5@cc92d941", + " 8 ret bls12_381_g1_mul -> Ok(Bytes(obj#11))": "cpu:6588894, mem:944, objs:-/6@89567945", " 9 call obj_cmp(Bytes(obj#11), Bytes(obj#9))": "", - " 10 ret obj_cmp -> Ok(0)": "cpu:6586183", - " 11 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "cpu:6587945, mem:448, objs:-/7@5f0fa973", - " 12 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:6588446, mem:512, objs:-/8@ef6d15a2", - " 13 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 14 ret obj_from_u256_pieces -> Ok(U256(obj#17))": "cpu:6588947, mem:576, objs:-/9@65c757ad", + " 10 ret obj_cmp -> Ok(0)": "cpu:6589194", + " 11 call obj_from_u256_pieces(6323299788322677209, 10750116738439201932, 18360906223394982587, 9325364323995100469)": "cpu:6591501, mem:1120, objs:-/7@2a485b17", + " 12 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:6592002, mem:1184, objs:-/8@79217ef9", + " 13 call obj_from_u256_pieces(16907382892538334328, 113782963536904741, 4993972513439703861, 2571702143467752736)": "", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#17))": "cpu:6592503, mem:1248, objs:-/9@36abc0b3", " 15 call bls12_381_g1_mul(Bytes(obj#13), U256(obj#15))": "", - " 16 ret bls12_381_g1_mul -> Ok(Bytes(obj#19))": "cpu:9878906, mem:640, objs:-/10@b54fc463", + " 16 ret bls12_381_g1_mul -> Ok(Bytes(obj#19))": "cpu:9883150, mem:1424, objs:-/10@b21c2d2d", " 17 call bls12_381_g1_mul(Bytes(obj#19), U256(obj#17))": "", - " 18 ret bls12_381_g1_mul -> Ok(Bytes(obj#21))": "cpu:13168865, mem:704, objs:-/11@41723b30", + " 18 ret bls12_381_g1_mul -> Ok(Bytes(obj#21))": "cpu:13173797, mem:1600, objs:-/11@a65beffd", " 19 call bls12_381_g1_mul(Bytes(obj#13), U256(obj#17))": "", - " 20 ret bls12_381_g1_mul -> Ok(Bytes(obj#23))": "cpu:16458824, mem:768, objs:-/12@7f57c0b", + " 20 ret bls12_381_g1_mul -> Ok(Bytes(obj#23))": "cpu:16464444, mem:1776, objs:-/12@142b906a", " 21 call bls12_381_g1_mul(Bytes(obj#23), U256(obj#15))": "", - " 22 ret bls12_381_g1_mul -> Ok(Bytes(obj#25))": "cpu:19748783, mem:832, objs:-/13@7e13d5d7", + " 22 ret bls12_381_g1_mul -> Ok(Bytes(obj#25))": "cpu:19755091, mem:1952, objs:-/13@2c457c1e", " 23 call obj_cmp(Bytes(obj#21), Bytes(obj#25))": "", - " 24 ret obj_cmp -> Ok(0)": "cpu:19749083", - " 25 end": "cpu:19749083, mem:832, prngs:-/-, objs:-/13@7e13d5d7, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 24 ret obj_cmp -> Ok(0)": "cpu:19755391", + " 25 end": "cpu:19755391, mem:1952, prngs:-/-, objs:-/13@2c457c1e, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g2_add.json b/soroban-env-host/observations/22/test__bls12_381__g2_add.json index b9a5003a3..e57288e69 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g2_add.json +++ b/soroban-env-host/observations/22/test__bls12_381__g2_add.json @@ -1,92 +1,92 @@ { " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", - " 1 call bytes_insert(Bytes(obj#3), U32(192), U32(0))": "cpu:6168, mem:128, objs:-/2@7a834a03", - " 2 ret bytes_insert -> Ok(Bytes(obj#5))": "cpu:7360, mem:401, objs:-/3@ea823cd2", + " 1 call bytes_insert(Bytes(obj#3), U32(192), U32(0))": "cpu:7306, mem:544, objs:-/2@677d2669", + " 2 ret bytes_insert -> Ok(Bytes(obj#5))": "cpu:8498, mem:817, objs:-/3@aa2f4df7", " 3 call bls12_381_g2_add(Bytes(obj#5), Bytes(obj#1))": "", - " 4 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:7543", - " 5 call bytes_del(Bytes(obj#7), U32(191))": "cpu:10627, mem:465, objs:-/4@13da096b", - " 6 ret bytes_del -> Ok(Bytes(obj#9))": "cpu:11861, mem:737, objs:-/5@a77bc7b5", + " 4 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:8681", + " 5 call bytes_del(Bytes(obj#7), U32(191))": "cpu:12334, mem:1089, objs:-/4@d40d4e81", + " 6 ret bytes_del -> Ok(Bytes(obj#9))": "cpu:13568, mem:1361, objs:-/5@a828132d", " 7 call bls12_381_g2_add(Bytes(obj#9), Bytes(obj#1))": "", - " 8 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:12044", - " 9 call bytes_get(Bytes(obj#11), U32(0))": "cpu:15128, mem:801, objs:-/6@7c9b95c3", - " 10 ret bytes_get -> Ok(U32(4))": "cpu:15250", - " 11 call bytes_put(Bytes(obj#11), U32(0), U32(132))": "", - " 12 ret bytes_put -> Ok(Bytes(obj#13))": "cpu:16442, mem:1073, objs:-/7@29e01e22", + " 8 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:13751", + " 9 call bytes_get(Bytes(obj#11), U32(0))": "cpu:17404, mem:1633, objs:-/6@5662b215", + " 10 ret bytes_get -> Ok(U32(19))": "cpu:17526", + " 11 call bytes_put(Bytes(obj#11), U32(0), U32(147))": "", + " 12 ret bytes_put -> Ok(Bytes(obj#13))": "cpu:18718, mem:1905, objs:-/7@9e161ca2", " 13 call bls12_381_g2_add(Bytes(obj#13), Bytes(obj#1))": "", - " 14 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:16625", - " 15 call bytes_get(Bytes(obj#15), U32(0))": "cpu:19709, mem:1137, objs:-/8@35a3ec44", - " 16 ret bytes_get -> Ok(U32(4))": "cpu:19831", - " 17 call bytes_put(Bytes(obj#15), U32(0), U32(68))": "", - " 18 ret bytes_put -> Ok(Bytes(obj#17))": "cpu:21023, mem:1409, objs:-/9@264a288a", + " 14 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:18901", + " 15 call bytes_get(Bytes(obj#15), U32(0))": "cpu:22554, mem:2177, objs:-/8@96a3978", + " 16 ret bytes_get -> Ok(U32(8))": "cpu:22676", + " 17 call bytes_put(Bytes(obj#15), U32(0), U32(72))": "", + " 18 ret bytes_put -> Ok(Bytes(obj#17))": "cpu:23868, mem:2449, objs:-/9@69b0d3c3", " 19 call bls12_381_g2_add(Bytes(obj#17), Bytes(obj#1))": "", - " 20 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:21206", - " 21 call bytes_get(Bytes(obj#19), U32(0))": "cpu:24290, mem:1473, objs:-/10@326c7a6e", - " 22 ret bytes_get -> Ok(U32(4))": "cpu:24412", - " 23 call bytes_put(Bytes(obj#19), U32(0), U32(36))": "", - " 24 ret bytes_put -> Ok(Bytes(obj#21))": "cpu:25604, mem:1745, objs:-/11@65530b6b", + " 20 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:24051", + " 21 call bytes_get(Bytes(obj#19), U32(0))": "cpu:27704, mem:2721, objs:-/10@11342981", + " 22 ret bytes_get -> Ok(U32(14))": "cpu:27826", + " 23 call bytes_put(Bytes(obj#19), U32(0), U32(46))": "", + " 24 ret bytes_put -> Ok(Bytes(obj#21))": "cpu:29018, mem:2993, objs:-/11@272aefa9", " 25 call bls12_381_g2_add(Bytes(obj#21), Bytes(obj#1))": "", - " 26 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:25787", - " 27 call bls12_381_g2_add(Bytes(obj#25), Bytes(obj#1))": "cpu:31955, mem:1873, objs:-/13@58ec5dc0", - " 28 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:1099510", - " 29 call bls12_381_g2_add(Bytes(obj#29), Bytes(obj#1))": "cpu:1105678, mem:2001, objs:-/15@77a6d140", - " 30 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:2173233", - " 31 call bytes_insert(Bytes(obj#33), U32(192), U32(0))": "cpu:2179401, mem:2129, objs:-/17@16506b89", - " 32 ret bytes_insert -> Ok(Bytes(obj#35))": "cpu:2180593, mem:2402, objs:-/18@41ebd242", - " 33 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#35))": "", - " 34 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:3248209", - " 35 call bytes_del(Bytes(obj#37), U32(191))": "cpu:3251293, mem:2466, objs:-/19@3a23070d", - " 36 ret bytes_del -> Ok(Bytes(obj#39))": "cpu:3252527, mem:2738, objs:-/20@c984b39b", - " 37 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#39))": "", - " 38 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:4320143", - " 39 call bytes_get(Bytes(obj#41), U32(0))": "cpu:4323227, mem:2802, objs:-/21@2dead73e", - " 40 ret bytes_get -> Ok(U32(4))": "cpu:4323349", - " 41 call bytes_put(Bytes(obj#41), U32(0), U32(132))": "", - " 42 ret bytes_put -> Ok(Bytes(obj#43))": "cpu:4324541, mem:3074, objs:-/22@a2251eea", - " 43 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#43))": "", - " 44 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:5392157", - " 45 call bytes_get(Bytes(obj#45), U32(0))": "cpu:5395241, mem:3138, objs:-/23@a6007beb", - " 46 ret bytes_get -> Ok(U32(4))": "cpu:5395363", - " 47 call bytes_put(Bytes(obj#45), U32(0), U32(68))": "", - " 48 ret bytes_put -> Ok(Bytes(obj#47))": "cpu:5396555, mem:3410, objs:-/24@c75f9a54", - " 49 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#47))": "", - " 50 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:6464171", - " 51 call bytes_get(Bytes(obj#49), U32(0))": "cpu:6467255, mem:3474, objs:-/25@145e2bba", - " 52 ret bytes_get -> Ok(U32(4))": "cpu:6467377", - " 53 call bytes_put(Bytes(obj#49), U32(0), U32(36))": "", - " 54 ret bytes_put -> Ok(Bytes(obj#51))": "cpu:6468569, mem:3746, objs:-/26@bbe552fc", - " 55 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#51))": "", - " 56 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:7536185", - " 57 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#55))": "cpu:7542353, mem:3874, objs:-/28@dc9af8d6", - " 58 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:9677341", - " 59 call bls12_381_g2_add(Bytes(obj#31), Bytes(obj#59))": "cpu:9683509, mem:4002, objs:-/30@aac50928", - " 60 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:11818497", - " 61 call bls12_381_g2_add(Bytes(obj#61), Bytes(obj#63))": "cpu:11824665, mem:4130, objs:-/32@e5f05cac", - " 62 ret bls12_381_g2_add -> Ok(Bytes(obj#65))": "cpu:14088747, mem:4194, objs:-/33@213340fe", - " 63 call obj_cmp(Bytes(obj#61), Bytes(obj#65))": "", - " 64 ret obj_cmp -> Ok(0)": "cpu:14089059", - " 65 call bls12_381_g2_add(Bytes(obj#69), Bytes(obj#67))": "cpu:14095227, mem:4322, objs:-/35@24fef9c7", - " 66 ret bls12_381_g2_add -> Ok(Bytes(obj#71))": "cpu:16359309, mem:4386, objs:-/36@74f33d01", - " 67 call obj_cmp(Bytes(obj#67), Bytes(obj#71))": "", - " 68 ret obj_cmp -> Ok(0)": "cpu:16359621", - " 69 call bls12_381_g2_add(Bytes(obj#73), Bytes(obj#75))": "cpu:16365789, mem:4514, objs:-/38@e23e07b5", - " 70 ret bls12_381_g2_add -> Ok(Bytes(obj#77))": "cpu:18629871, mem:4578, objs:-/39@d7a98b6a", - " 71 call bls12_381_g2_add(Bytes(obj#75), Bytes(obj#73))": "", - " 72 ret bls12_381_g2_add -> Ok(Bytes(obj#79))": "cpu:20893953, mem:4642, objs:-/40@5f1971a2", - " 73 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "", - " 74 ret obj_cmp -> Ok(0)": "cpu:20894265", - " 75 call bls12_381_g2_add(Bytes(obj#81), Bytes(obj#83))": "cpu:20903517, mem:4834, objs:-/43@3c78a27e", - " 76 ret bls12_381_g2_add -> Ok(Bytes(obj#87))": "cpu:23167599, mem:4898, objs:-/44@30e1ea1", - " 77 call bls12_381_g2_add(Bytes(obj#87), Bytes(obj#85))": "", - " 78 ret bls12_381_g2_add -> Ok(Bytes(obj#89))": "cpu:25431681, mem:4962, objs:-/45@9d8c0cf8", - " 79 call bls12_381_g2_add(Bytes(obj#83), Bytes(obj#85))": "", - " 80 ret bls12_381_g2_add -> Ok(Bytes(obj#91))": "cpu:27695763, mem:5026, objs:-/46@1c8474f0", - " 81 call bls12_381_g2_add(Bytes(obj#81), Bytes(obj#91))": "", - " 82 ret bls12_381_g2_add -> Ok(Bytes(obj#93))": "cpu:29959845, mem:5090, objs:-/47@3be4f98e", - " 83 call obj_cmp(Bytes(obj#89), Bytes(obj#93))": "", - " 84 ret obj_cmp -> Ok(0)": "cpu:29960157", - " 85 call bls12_381_g2_add(Bytes(obj#95), Bytes(obj#97))": "cpu:31033758, mem:5218, objs:-/49@a05cc0e8", - " 86 ret bls12_381_g2_add -> Ok(Bytes(obj#99))": "cpu:33297840, mem:5282, objs:-/50@ffa9bc11", - " 87 call obj_cmp(Bytes(obj#99), Bytes(obj#101))": "cpu:33300924, mem:5346, objs:-/51@9d61095a", - " 88 ret obj_cmp -> Ok(0)": "cpu:33301236", - " 89 end": "cpu:33301236, mem:5346, prngs:-/-, objs:-/51@9d61095a, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 26 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:29201", + " 27 call bls12_381_g2_add(Bytes(obj#25), Bytes(obj#1))": "cpu:36507, mem:3537, objs:-/13@bbc6c210", + " 28 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:46551", + " 29 call bls12_381_g2_add(Bytes(obj#29), Bytes(obj#1))": "cpu:53857, mem:4081, objs:-/15@20ea1ecb", + " 30 ret bls12_381_g2_add -> Ok(Bytes(obj#31))": "cpu:203486, mem:4353, objs:-/16@a8cbceb4", + " 31 call bytes_insert(Bytes(obj#35), U32(192), U32(0))": "cpu:210792, mem:4897, objs:-/18@61fd8415", + " 32 ret bytes_insert -> Ok(Bytes(obj#37))": "cpu:211984, mem:5170, objs:-/19@9f66f3fb", + " 33 call bls12_381_g2_add(Bytes(obj#33), Bytes(obj#37))": "", + " 34 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:222089", + " 35 call bytes_del(Bytes(obj#39), U32(191))": "cpu:225742, mem:5442, objs:-/20@b18f1339", + " 36 ret bytes_del -> Ok(Bytes(obj#41))": "cpu:226976, mem:5714, objs:-/21@cb06fd3d", + " 37 call bls12_381_g2_add(Bytes(obj#33), Bytes(obj#41))": "", + " 38 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:237081", + " 39 call bytes_get(Bytes(obj#43), U32(0))": "cpu:240734, mem:5986, objs:-/22@e4f17717", + " 40 ret bytes_get -> Ok(U32(25))": "cpu:240856", + " 41 call bytes_put(Bytes(obj#43), U32(0), U32(153))": "", + " 42 ret bytes_put -> Ok(Bytes(obj#45))": "cpu:242048, mem:6258, objs:-/23@628ff496", + " 43 call bls12_381_g2_add(Bytes(obj#33), Bytes(obj#45))": "", + " 44 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:252153", + " 45 call bytes_get(Bytes(obj#47), U32(0))": "cpu:255806, mem:6530, objs:-/24@aa5fdd9f", + " 46 ret bytes_get -> Ok(U32(11))": "cpu:255928", + " 47 call bytes_put(Bytes(obj#47), U32(0), U32(75))": "", + " 48 ret bytes_put -> Ok(Bytes(obj#49))": "cpu:257120, mem:6802, objs:-/25@32a4ed1", + " 49 call bls12_381_g2_add(Bytes(obj#33), Bytes(obj#49))": "", + " 50 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:267225", + " 51 call bytes_get(Bytes(obj#51), U32(0))": "cpu:270878, mem:7074, objs:-/26@22283cca", + " 52 ret bytes_get -> Ok(U32(20))": "cpu:271000", + " 53 call bytes_put(Bytes(obj#51), U32(0), U32(52))": "", + " 54 ret bytes_put -> Ok(Bytes(obj#53))": "cpu:272192, mem:7346, objs:-/27@dda0c3be", + " 55 call bls12_381_g2_add(Bytes(obj#33), Bytes(obj#53))": "", + " 56 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:282297", + " 57 call bls12_381_g2_add(Bytes(obj#33), Bytes(obj#57))": "cpu:289603, mem:7890, objs:-/29@573e8380", + " 58 ret bls12_381_g2_add -> Err(Error(Crypto, InvalidInput))": "cpu:309569", + " 59 call bls12_381_g2_add(Bytes(obj#33), Bytes(obj#61))": "cpu:316875, mem:8434, objs:-/31@5fd19068", + " 60 ret bls12_381_g2_add -> Ok(Bytes(obj#63))": "cpu:466504, mem:8706, objs:-/32@ec6b7b2c", + " 61 call bls12_381_g2_add(Bytes(obj#65), Bytes(obj#67))": "cpu:473810, mem:9250, objs:-/34@9b1eefe0", + " 62 ret bls12_381_g2_add -> Ok(Bytes(obj#69))": "cpu:623439, mem:9522, objs:-/35@f71181a1", + " 63 call obj_cmp(Bytes(obj#65), Bytes(obj#69))": "", + " 64 ret obj_cmp -> Ok(0)": "cpu:623751", + " 65 call bls12_381_g2_add(Bytes(obj#73), Bytes(obj#71))": "cpu:631057, mem:10066, objs:-/37@f8dc176b", + " 66 ret bls12_381_g2_add -> Ok(Bytes(obj#75))": "cpu:780686, mem:10338, objs:-/38@2fe7293", + " 67 call obj_cmp(Bytes(obj#71), Bytes(obj#75))": "", + " 68 ret obj_cmp -> Ok(0)": "cpu:780998", + " 69 call bls12_381_g2_add(Bytes(obj#77), Bytes(obj#79))": "cpu:788304, mem:10882, objs:-/40@c4ae35f6", + " 70 ret bls12_381_g2_add -> Ok(Bytes(obj#81))": "cpu:937933, mem:11154, objs:-/41@83a07334", + " 71 call bls12_381_g2_add(Bytes(obj#79), Bytes(obj#77))": "", + " 72 ret bls12_381_g2_add -> Ok(Bytes(obj#83))": "cpu:1087562, mem:11426, objs:-/42@ee36f22d", + " 73 call obj_cmp(Bytes(obj#81), Bytes(obj#83))": "", + " 74 ret obj_cmp -> Ok(0)": "cpu:1087874", + " 75 call bls12_381_g2_add(Bytes(obj#85), Bytes(obj#87))": "cpu:1098833, mem:12242, objs:-/45@6e00248", + " 76 ret bls12_381_g2_add -> Ok(Bytes(obj#91))": "cpu:1248462, mem:12514, objs:-/46@ef715707", + " 77 call bls12_381_g2_add(Bytes(obj#91), Bytes(obj#89))": "", + " 78 ret bls12_381_g2_add -> Ok(Bytes(obj#93))": "cpu:1398091, mem:12786, objs:-/47@90ff55c1", + " 79 call bls12_381_g2_add(Bytes(obj#87), Bytes(obj#89))": "", + " 80 ret bls12_381_g2_add -> Ok(Bytes(obj#95))": "cpu:1547720, mem:13058, objs:-/48@193bd8c1", + " 81 call bls12_381_g2_add(Bytes(obj#85), Bytes(obj#95))": "", + " 82 ret bls12_381_g2_add -> Ok(Bytes(obj#97))": "cpu:1697349, mem:13330, objs:-/49@8486e34a", + " 83 call obj_cmp(Bytes(obj#93), Bytes(obj#97))": "", + " 84 ret obj_cmp -> Ok(0)": "cpu:1697661", + " 85 call bls12_381_g2_add(Bytes(obj#99), Bytes(obj#101))": "cpu:2772711, mem:13874, objs:-/51@43bd7be8", + " 86 ret bls12_381_g2_add -> Ok(Bytes(obj#103))": "cpu:2922340, mem:14146, objs:-/52@29e9945a", + " 87 call obj_cmp(Bytes(obj#103), Bytes(obj#105))": "cpu:2925993, mem:14418, objs:-/53@c4f5e4c0", + " 88 ret obj_cmp -> Ok(0)": "cpu:2926305", + " 89 end": "cpu:2926305, mem:14418, prngs:-/-, objs:-/53@c4f5e4c0, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g2_msm.json b/soroban-env-host/observations/22/test__bls12_381__g2_msm.json index ac77d383f..65bb88699 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g2_msm.json +++ b/soroban-env-host/observations/22/test__bls12_381__g2_msm.json @@ -12,291 +12,291 @@ " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:4586, mem:672, objs:-/4@84c0214b", " 11 call vec_new_from_slice(2)": "", " 12 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:5673, mem:768, objs:-/5@e2867bea", - " 13 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:6174, mem:832, objs:-/6@244a4716", - " 15 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", - " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:6675, mem:896, objs:-/7@c7c96da7", - " 17 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", - " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:7176, mem:960, objs:-/8@a5e0a3fd", + " 13 call obj_from_u256_pieces(11753201120659576617, 12800183645227990272, 6449591311112480650, 11530214657355711865)": "", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:6174, mem:832, objs:-/6@d2c1550a", + " 15 call obj_from_u256_pieces(17867260108045272079, 6594056455511558201, 8394146189024495608, 16477234698079725300)": "", + " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:6675, mem:896, objs:-/7@b83c4f1d", + " 17 call obj_from_u256_pieces(5093470543443933884, 12596616304565341690, 2875592832172597214, 8474459150244119113)": "", + " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:7176, mem:960, objs:-/8@5b2279ba", " 19 call vec_new_from_slice(3)": "", - " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:8326, mem:1064, objs:-/9@2a1f5271", + " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:8326, mem:1064, objs:-/9@2c5030af", " 21 call bls12_381_g2_msm(Vec(obj#9), Vec(obj#17))": "", " 22 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:8570", - " 23 call vec_new_from_slice(3)": "cpu:20906, mem:1320, objs:-/13@e77c0ee9", - " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:22056, mem:1424, objs:-/14@9ff18891", - " 25 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:22557, mem:1488, objs:-/15@233f8d03", - " 27 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", - " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:23058, mem:1552, objs:-/16@706b91ae", - " 29 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", - " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:23559, mem:1616, objs:-/17@41f28884", + " 23 call vec_new_from_slice(3)": "cpu:23182, mem:2152, objs:-/13@c72ec5e5", + " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:24332, mem:2256, objs:-/14@138c972e", + " 25 call obj_from_u256_pieces(2670602178858449459, 7519702381861979968, 12131847362652268029, 15324157160071379208)": "", + " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:24833, mem:2320, objs:-/15@cca0974f", + " 27 call obj_from_u256_pieces(14448951281277473340, 10183372082303375121, 11609568207825743232, 10582668507445555283)": "", + " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:25334, mem:2384, objs:-/16@338703b5", + " 29 call obj_from_u256_pieces(8613971480719722045, 14687201964851969652, 13467859308725023972, 5056481814551667924)": "", + " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:25835, mem:2448, objs:-/17@e29c96a4", " 31 call vec_new_from_slice(3)": "", - " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:24709, mem:1720, objs:-/18@7a8c084", + " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:26985, mem:2552, objs:-/18@bd3fe61d", " 33 call bls12_381_g2_msm(Vec(obj#27), Vec(obj#35))": "", - " 34 call vec_len(Vec(obj#27))": "cpu:24953", - " 35 ret vec_len -> Ok(U32(3))": "cpu:25075", - " 36 call vec_len(Vec(obj#35))": "cpu:2160508, mem:2312", - " 37 ret vec_len -> Ok(U32(3))": "cpu:2160630", - " 38 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:2167302, mem:2424", - " 39 call vec_new_from_slice(3)": "cpu:2170386, mem:2488, objs:-/19@96bcbe6d", - " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:2171536, mem:2592, objs:-/20@2b984ac", - " 41 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:2172037, mem:2656, objs:-/21@fecd7791", - " 43 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", - " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:2172538, mem:2720, objs:-/22@fbcd29df", - " 45 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", - " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:2173039, mem:2784, objs:-/23@9bd2dcf2", + " 34 call vec_len(Vec(obj#27))": "cpu:27229", + " 35 ret vec_len -> Ok(U32(3))": "cpu:27351", + " 36 call vec_len(Vec(obj#35))": "cpu:2163406, mem:3144", + " 37 ret vec_len -> Ok(U32(3))": "cpu:2163528", + " 38 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:2170200, mem:3256", + " 39 call vec_new_from_slice(3)": "cpu:2173853, mem:3528, objs:-/19@fc4eae83", + " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:2175003, mem:3632, objs:-/20@fc5a7848", + " 41 call obj_from_u256_pieces(10885390432521285204, 10089357480003724487, 11017657889674374380, 349979284301977343)": "", + " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:2175504, mem:3696, objs:-/21@c11c1e9", + " 43 call obj_from_u256_pieces(15502034860521929120, 5197508503879521041, 10172360046471299633, 18026852881196000031)": "", + " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:2176005, mem:3760, objs:-/22@fbed0030", + " 45 call obj_from_u256_pieces(7434520258580032483, 1508470301556677986, 6272863840242768080, 12830499169355232182)": "", + " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:2176506, mem:3824, objs:-/23@7c759a0d", " 47 call vec_new_from_slice(3)": "", - " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:2174189, mem:2888, objs:-/24@a5686071", + " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:2177656, mem:3928, objs:-/24@892a5924", " 49 call bls12_381_g2_msm(Vec(obj#39), Vec(obj#47))": "", - " 50 call vec_len(Vec(obj#39))": "cpu:2174433", - " 51 ret vec_len -> Ok(U32(3))": "cpu:2174555", - " 52 call vec_len(Vec(obj#47))": "cpu:5377421, mem:3480", - " 53 ret vec_len -> Ok(U32(3))": "cpu:5377543", - " 54 ret bls12_381_g2_msm -> Ok(Bytes(obj#49))": "cpu:20781898, mem:231622, objs:-/25@98d566d6", - " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:20784982, mem:231686, objs:-/26@36ea69e7", - " 56 ret obj_cmp -> Ok(0)": "cpu:20785294", - " 57 call bytes_new_from_slice(192)": "cpu:20785955", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:20786964, mem:231958, objs:-/27@1438f5d7", - " 59 call bytes_new_from_slice(192)": "cpu:20787625", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:20788634, mem:232230, objs:-/28@23130a55", - " 61 call bytes_new_from_slice(192)": "cpu:20789295", - " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:20790304, mem:232502, objs:-/29@59c6b86b", + " 50 call vec_len(Vec(obj#39))": "cpu:2177900", + " 51 ret vec_len -> Ok(U32(3))": "cpu:2178022", + " 52 call vec_len(Vec(obj#47))": "cpu:5381821, mem:4520", + " 53 ret vec_len -> Ok(U32(3))": "cpu:5381943", + " 54 ret bls12_381_g2_msm -> Ok(Bytes(obj#49))": "cpu:20786867, mem:232870, objs:-/25@b3e2fb94", + " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:20790520, mem:233142, objs:-/26@36256f36", + " 56 ret obj_cmp -> Ok(0)": "cpu:20790832", + " 57 call bytes_new_from_slice(192)": "cpu:20791493", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:20792502, mem:233414, objs:-/27@8ed979ac", + " 59 call bytes_new_from_slice(192)": "cpu:20793163", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:20794172, mem:233686, objs:-/28@a3eb6aea", + " 61 call bytes_new_from_slice(192)": "cpu:20794833", + " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:20795842, mem:233958, objs:-/29@9bc29a7f", " 63 call vec_new_from_slice(3)": "", - " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:20791454, mem:232606, objs:-/30@e2b0ab5f", + " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:20796992, mem:234062, objs:-/30@379dffd4", " 65 call vec_new_from_slice(3)": "", - " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:20792421, mem:232710, objs:-/31@b828c2db", + " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:20797959, mem:234166, objs:-/31@f3d911e6", " 67 call bls12_381_g2_msm(Vec(obj#59), Vec(obj#61))": "", - " 68 call vec_len(Vec(obj#59))": "cpu:20792665", - " 69 ret vec_len -> Ok(U32(3))": "cpu:20792787", - " 70 call vec_len(Vec(obj#61))": "cpu:23995653, mem:233302", - " 71 ret vec_len -> Ok(U32(3))": "cpu:23995775", - " 72 ret bls12_381_g2_msm -> Ok(Bytes(obj#63))": "cpu:39399947, mem:461444, objs:-/32@5666e6e6", - " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:39403031, mem:461508, objs:-/33@278fef74", - " 74 ret obj_cmp -> Ok(0)": "cpu:39403343", - " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:39409511, mem:461636, objs:-/35@a12d75b5", - " 76 ret obj_cmp -> Ok(-1)": "cpu:39409823", - " 77 call vec_new_from_slice(2)": "cpu:40480340, mem:461700, objs:-/36@6f0e35f0", - " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:40481427, mem:461796, objs:-/37@71a8099", + " 68 call vec_len(Vec(obj#59))": "cpu:20798203", + " 69 ret vec_len -> Ok(U32(3))": "cpu:20798325", + " 70 call vec_len(Vec(obj#61))": "cpu:24002124, mem:234758", + " 71 ret vec_len -> Ok(U32(3))": "cpu:24002246", + " 72 ret bls12_381_g2_msm -> Ok(Bytes(obj#63))": "cpu:39406987, mem:463108, objs:-/32@99e86db8", + " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:39410640, mem:463380, objs:-/33@d5a55acc", + " 74 ret obj_cmp -> Ok(0)": "cpu:39410952", + " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:39418258, mem:463924, objs:-/35@52d12591", + " 76 ret obj_cmp -> Ok(-1)": "cpu:39418570", + " 77 call vec_new_from_slice(2)": "cpu:40489967, mem:464196, objs:-/36@f4b12971", + " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:40491054, mem:464292, objs:-/37@43b753fc", " 79 call vec_new_from_slice(2)": "", - " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:40482392, mem:461892, objs:-/38@ac162eb3", + " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:40492019, mem:464388, objs:-/38@d88a608d", " 81 call bls12_381_g2_msm(Vec(obj#73), Vec(obj#75))": "", - " 82 call vec_len(Vec(obj#73))": "cpu:40482636", - " 83 ret vec_len -> Ok(U32(2))": "cpu:40482758", - " 84 call vec_len(Vec(obj#75))": "cpu:42618167, mem:462292", - " 85 ret vec_len -> Ok(U32(2))": "cpu:42618289", - " 86 ret bls12_381_g2_msm -> Ok(Bytes(obj#77))": "cpu:55601187, mem:687631, objs:-/39@5464952e", - " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:55604271, mem:687695, objs:-/40@f0952b2", - " 88 ret obj_cmp -> Ok(0)": "cpu:55604583", - " 89 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "cpu:55616919, mem:687951, objs:-/44@b333c2af", - " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:55617420, mem:688015, objs:-/45@3ff9e222", - " 91 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 92 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:55617921, mem:688079, objs:-/46@2ff8d751", - " 93 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 94 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:55618422, mem:688143, objs:-/47@345f6187", - " 95 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 96 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:55618923, mem:688207, objs:-/48@57ca0b1f", + " 82 call vec_len(Vec(obj#73))": "cpu:40492263", + " 83 ret vec_len -> Ok(U32(2))": "cpu:40492385", + " 84 call vec_len(Vec(obj#75))": "cpu:42628416, mem:464788", + " 85 ret vec_len -> Ok(U32(2))": "cpu:42628538", + " 86 ret bls12_381_g2_msm -> Ok(Bytes(obj#77))": "cpu:55612005, mem:690335, objs:-/39@308f505c", + " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:55615658, mem:690607, objs:-/40@9dfbcd24", + " 88 ret obj_cmp -> Ok(0)": "cpu:55615970", + " 89 call obj_from_u256_pieces(576349249354864704, 6205532040440579369, 13730557568579417905, 2677733454007168321)": "cpu:55630582, mem:691695, objs:-/44@cd73d980", + " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:55631083, mem:691759, objs:-/45@d173b8e8", + " 91 call obj_from_u256_pieces(15107729625736847273, 3736362233123338213, 1310693883286457402, 15587527586950209119)": "", + " 92 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:55631584, mem:691823, objs:-/46@8a8ce1f3", + " 93 call obj_from_u256_pieces(7130333837602304766, 15809650852848135414, 16809337653702689547, 14300891233011973695)": "", + " 94 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:55632085, mem:691887, objs:-/47@eacff4b8", + " 95 call obj_from_u256_pieces(5531006726045309341, 889630097820975985, 16583573122393188327, 9061467097759417586)": "", + " 96 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:55632586, mem:691951, objs:-/48@42874a94", " 97 call vec_new_from_slice(4)": "", - " 98 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:55620136, mem:688319, objs:-/49@659ce14b", + " 98 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:55633799, mem:692063, objs:-/49@239aaa14", " 99 call vec_new_from_slice(4)": "", - " 100 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:55621349, mem:688431, objs:-/50@13fab837", + " 100 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:55635012, mem:692175, objs:-/50@60ff6572", " 101 call bls12_381_g2_msm(Vec(obj#97), Vec(obj#99))": "", - " 102 call vec_len(Vec(obj#97))": "cpu:55621593", - " 103 ret vec_len -> Ok(U32(4))": "cpu:55621715", - " 104 call vec_len(Vec(obj#99))": "cpu:59892038, mem:689215", - " 105 ret vec_len -> Ok(U32(4))": "cpu:59892160", - " 106 ret bls12_381_g2_msm -> Ok(Bytes(obj#101))": "cpu:77717850, mem:920160, objs:-/51@bcecd339", + " 102 call vec_len(Vec(obj#97))": "cpu:55635256", + " 103 ret vec_len -> Ok(U32(4))": "cpu:55635378", + " 104 call vec_len(Vec(obj#99))": "cpu:59906945, mem:692959", + " 105 ret vec_len -> Ok(U32(4))": "cpu:59907067", + " 106 ret bls12_381_g2_msm -> Ok(Bytes(obj#101))": "cpu:77733326, mem:924112, objs:-/51@6bf9c3f3", " 107 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 108 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:1213, mem:112, objs:-/52@b6aec1e2", + " 108 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:1213, mem:112, objs:-/52@c42f87dd", " 109 call vec_new_from_slice(4)": "", - " 110 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:2426, mem:224, objs:-/53@a14e2ca7", + " 110 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:2426, mem:224, objs:-/53@6a9d8396", " 111 call bls12_381_g2_msm(Vec(obj#103), Vec(obj#105))": "", " 112 call vec_len(Vec(obj#103))": "cpu:2670", " 113 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 114 call vec_len(Vec(obj#105))": "cpu:4273115, mem:1008", - " 115 ret vec_len -> Ok(U32(4))": "cpu:4273237", - " 116 ret bls12_381_g2_msm -> Ok(Bytes(obj#107))": "cpu:22098927, mem:231953, objs:-/54@77da79e9", + " 114 call vec_len(Vec(obj#105))": "cpu:4274359, mem:1008", + " 115 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 116 ret bls12_381_g2_msm -> Ok(Bytes(obj#107))": "cpu:22100740, mem:232161, objs:-/54@3472db57", " 117 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", - " 118 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 118 ret obj_cmp -> Ok(0)": "cpu:22101052", " 119 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 120 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:1213, mem:112, objs:-/55@76e853f9", + " 120 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:1213, mem:112, objs:-/55@472ba905", " 121 call vec_new_from_slice(4)": "", - " 122 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:2426, mem:224, objs:-/56@2aeeef8c", + " 122 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:2426, mem:224, objs:-/56@e84328b6", " 123 call bls12_381_g2_msm(Vec(obj#109), Vec(obj#111))": "", " 124 call vec_len(Vec(obj#109))": "cpu:2670", " 125 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 126 call vec_len(Vec(obj#111))": "cpu:4273115, mem:1008", - " 127 ret vec_len -> Ok(U32(4))": "cpu:4273237", - " 128 ret bls12_381_g2_msm -> Ok(Bytes(obj#113))": "cpu:22098927, mem:231953, objs:-/57@bdc6cf65", + " 126 call vec_len(Vec(obj#111))": "cpu:4274359, mem:1008", + " 127 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 128 ret bls12_381_g2_msm -> Ok(Bytes(obj#113))": "cpu:22100740, mem:232161, objs:-/57@5cd90966", " 129 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", - " 130 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 130 ret obj_cmp -> Ok(0)": "cpu:22101052", " 131 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 132 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:1213, mem:112, objs:-/58@c0ed5bdc", + " 132 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:1213, mem:112, objs:-/58@5477447f", " 133 call vec_new_from_slice(4)": "", - " 134 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:2426, mem:224, objs:-/59@db0d275e", + " 134 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:2426, mem:224, objs:-/59@42339f28", " 135 call bls12_381_g2_msm(Vec(obj#115), Vec(obj#117))": "", " 136 call vec_len(Vec(obj#115))": "cpu:2670", " 137 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 138 call vec_len(Vec(obj#117))": "cpu:4273115, mem:1008", - " 139 ret vec_len -> Ok(U32(4))": "cpu:4273237", - " 140 ret bls12_381_g2_msm -> Ok(Bytes(obj#119))": "cpu:22098927, mem:231953, objs:-/60@29fa32a5", + " 138 call vec_len(Vec(obj#117))": "cpu:4274359, mem:1008", + " 139 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 140 ret bls12_381_g2_msm -> Ok(Bytes(obj#119))": "cpu:22100740, mem:232161, objs:-/60@142a3f6", " 141 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", - " 142 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 142 ret obj_cmp -> Ok(0)": "cpu:22101052", " 143 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 144 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:1213, mem:112, objs:-/61@6ae7e674", + " 144 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:1213, mem:112, objs:-/61@f554fdda", " 145 call vec_new_from_slice(4)": "", - " 146 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:2426, mem:224, objs:-/62@85e80ae7", + " 146 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:2426, mem:224, objs:-/62@392d78a5", " 147 call bls12_381_g2_msm(Vec(obj#121), Vec(obj#123))": "", " 148 call vec_len(Vec(obj#121))": "cpu:2670", " 149 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 150 call vec_len(Vec(obj#123))": "cpu:4273115, mem:1008", - " 151 ret vec_len -> Ok(U32(4))": "cpu:4273237", - " 152 ret bls12_381_g2_msm -> Ok(Bytes(obj#125))": "cpu:22098927, mem:231953, objs:-/63@6f103dea", + " 150 call vec_len(Vec(obj#123))": "cpu:4274359, mem:1008", + " 151 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 152 ret bls12_381_g2_msm -> Ok(Bytes(obj#125))": "cpu:22100740, mem:232161, objs:-/63@a37c7b18", " 153 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", - " 154 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 154 ret obj_cmp -> Ok(0)": "cpu:22101052", " 155 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 156 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:1213, mem:112, objs:-/64@498d3232", + " 156 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:1213, mem:112, objs:-/64@d830e19", " 157 call vec_new_from_slice(4)": "", - " 158 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:2426, mem:224, objs:-/65@e613eae5", + " 158 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:2426, mem:224, objs:-/65@de9f2d72", " 159 call bls12_381_g2_msm(Vec(obj#127), Vec(obj#129))": "", " 160 call vec_len(Vec(obj#127))": "cpu:2670", " 161 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 162 call vec_len(Vec(obj#129))": "cpu:4273115, mem:1008", - " 163 ret vec_len -> Ok(U32(4))": "cpu:4273237", - " 164 ret bls12_381_g2_msm -> Ok(Bytes(obj#131))": "cpu:22098927, mem:231953, objs:-/66@1e8e4f19", + " 162 call vec_len(Vec(obj#129))": "cpu:4274359, mem:1008", + " 163 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 164 ret bls12_381_g2_msm -> Ok(Bytes(obj#131))": "cpu:22100740, mem:232161, objs:-/66@12bd397c", " 165 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", - " 166 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 166 ret obj_cmp -> Ok(0)": "cpu:22101052", " 167 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 168 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:1213, mem:112, objs:-/67@f1965d8", + " 168 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:1213, mem:112, objs:-/67@9fc98ec8", " 169 call vec_new_from_slice(4)": "", - " 170 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:2426, mem:224, objs:-/68@97a83188", + " 170 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:2426, mem:224, objs:-/68@2e15d9f1", " 171 call bls12_381_g2_msm(Vec(obj#133), Vec(obj#135))": "", " 172 call vec_len(Vec(obj#133))": "cpu:2670", " 173 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 174 call vec_len(Vec(obj#135))": "cpu:4273115, mem:1008", - " 175 ret vec_len -> Ok(U32(4))": "cpu:4273237", - " 176 ret bls12_381_g2_msm -> Ok(Bytes(obj#137))": "cpu:22098927, mem:231953, objs:-/69@6c02ddf1", + " 174 call vec_len(Vec(obj#135))": "cpu:4274359, mem:1008", + " 175 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 176 ret bls12_381_g2_msm -> Ok(Bytes(obj#137))": "cpu:22100740, mem:232161, objs:-/69@516fe495", " 177 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", - " 178 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 178 ret obj_cmp -> Ok(0)": "cpu:22101052", " 179 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 180 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:1213, mem:112, objs:-/70@1c9c1a13", + " 180 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:1213, mem:112, objs:-/70@745e9418", " 181 call vec_new_from_slice(4)": "", - " 182 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:2426, mem:224, objs:-/71@509f50a4", + " 182 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:2426, mem:224, objs:-/71@db69de4c", " 183 call bls12_381_g2_msm(Vec(obj#139), Vec(obj#141))": "", " 184 call vec_len(Vec(obj#139))": "cpu:2670", " 185 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 186 call vec_len(Vec(obj#141))": "cpu:4273115, mem:1008", - " 187 ret vec_len -> Ok(U32(4))": "cpu:4273237", - " 188 ret bls12_381_g2_msm -> Ok(Bytes(obj#143))": "cpu:22098927, mem:231953, objs:-/72@f2dff8b4", + " 186 call vec_len(Vec(obj#141))": "cpu:4274359, mem:1008", + " 187 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 188 ret bls12_381_g2_msm -> Ok(Bytes(obj#143))": "cpu:22100740, mem:232161, objs:-/72@8a46f90c", " 189 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", - " 190 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 190 ret obj_cmp -> Ok(0)": "cpu:22101052", " 191 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 192 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:1213, mem:112, objs:-/73@19908765", + " 192 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:1213, mem:112, objs:-/73@1e08429e", " 193 call vec_new_from_slice(4)": "", - " 194 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:2426, mem:224, objs:-/74@760de20c", + " 194 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:2426, mem:224, objs:-/74@b5ef3ee0", " 195 call bls12_381_g2_msm(Vec(obj#145), Vec(obj#147))": "", " 196 call vec_len(Vec(obj#145))": "cpu:2670", " 197 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 198 call vec_len(Vec(obj#147))": "cpu:4273115, mem:1008", - " 199 ret vec_len -> Ok(U32(4))": "cpu:4273237", - " 200 ret bls12_381_g2_msm -> Ok(Bytes(obj#149))": "cpu:22098927, mem:231953, objs:-/75@9de64c04", + " 198 call vec_len(Vec(obj#147))": "cpu:4274359, mem:1008", + " 199 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 200 ret bls12_381_g2_msm -> Ok(Bytes(obj#149))": "cpu:22100740, mem:232161, objs:-/75@5ece035c", " 201 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", - " 202 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 202 ret obj_cmp -> Ok(0)": "cpu:22101052", " 203 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 204 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:1213, mem:112, objs:-/76@da22b65", + " 204 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:1213, mem:112, objs:-/76@f42c812e", " 205 call vec_new_from_slice(4)": "", - " 206 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:2426, mem:224, objs:-/77@ab6b94c3", + " 206 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:2426, mem:224, objs:-/77@a0486908", " 207 call bls12_381_g2_msm(Vec(obj#151), Vec(obj#153))": "", " 208 call vec_len(Vec(obj#151))": "cpu:2670", " 209 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 210 call vec_len(Vec(obj#153))": "cpu:4273115, mem:1008", - " 211 ret vec_len -> Ok(U32(4))": "cpu:4273237", - " 212 ret bls12_381_g2_msm -> Ok(Bytes(obj#155))": "cpu:22098927, mem:231953, objs:-/78@47dd0e65", + " 210 call vec_len(Vec(obj#153))": "cpu:4274359, mem:1008", + " 211 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 212 ret bls12_381_g2_msm -> Ok(Bytes(obj#155))": "cpu:22100740, mem:232161, objs:-/78@de21d2fc", " 213 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", - " 214 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 214 ret obj_cmp -> Ok(0)": "cpu:22101052", " 215 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 216 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:1213, mem:112, objs:-/79@e4df0ff9", + " 216 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:1213, mem:112, objs:-/79@4620805c", " 217 call vec_new_from_slice(4)": "", - " 218 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:2426, mem:224, objs:-/80@c73bef", + " 218 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:2426, mem:224, objs:-/80@89a4898d", " 219 call bls12_381_g2_msm(Vec(obj#157), Vec(obj#159))": "", " 220 call vec_len(Vec(obj#157))": "cpu:2670", " 221 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 222 call vec_len(Vec(obj#159))": "cpu:4273115, mem:1008", - " 223 ret vec_len -> Ok(U32(4))": "cpu:4273237", - " 224 ret bls12_381_g2_msm -> Ok(Bytes(obj#161))": "cpu:22098927, mem:231953, objs:-/81@bba974f2", + " 222 call vec_len(Vec(obj#159))": "cpu:4274359, mem:1008", + " 223 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 224 ret bls12_381_g2_msm -> Ok(Bytes(obj#161))": "cpu:22100740, mem:232161, objs:-/81@151aaaa4", " 225 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", - " 226 ret obj_cmp -> Ok(0)": "cpu:22099239", + " 226 ret obj_cmp -> Ok(0)": "cpu:22101052", " 227 call bytes_new_from_slice(192)": "cpu:661, mem:0", - " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:1670, mem:272, objs:-/82@4bcad85", + " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:1670, mem:272, objs:-/82@526b5995", " 229 call bytes_new_from_slice(192)": "cpu:2331", - " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:3340, mem:544, objs:-/83@35b74a2a", + " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:3340, mem:544, objs:-/83@6efe8bf2", " 231 call bytes_new_from_slice(192)": "cpu:4001", - " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:5010, mem:816, objs:-/84@a16487d", + " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:5010, mem:816, objs:-/84@d65370d1", " 233 call bytes_new_from_slice(192)": "cpu:5671", - " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:6680, mem:1088, objs:-/85@9d3ff134", + " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:6680, mem:1088, objs:-/85@768353f3", " 235 call bytes_new_from_slice(192)": "cpu:7341", - " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:8350, mem:1360, objs:-/86@5542feca", + " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:8350, mem:1360, objs:-/86@d38309a4", " 237 call vec_new_from_slice(5)": "", - " 238 ret vec_new_from_slice -> Ok(Vec(obj#173))": "cpu:9626, mem:1480, objs:-/87@4fea12ef", - " 239 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 240 ret obj_from_u256_pieces -> Ok(U256(obj#175))": "cpu:10127, mem:1544, objs:-/88@cb7d7391", - " 241 call obj_from_u256_pieces(711237725447063640, 5467003107475789722, 1533801215655274349, 6627595478703576210)": "", - " 242 ret obj_from_u256_pieces -> Ok(U256(obj#177))": "cpu:10628, mem:1608, objs:-/89@d25ee254", - " 243 call obj_from_u256_pieces(15441350886799857089, 7217175410154589625, 4862592111802288914, 8757735953973767133)": "", - " 244 ret obj_from_u256_pieces -> Ok(U256(obj#179))": "cpu:11129, mem:1672, objs:-/90@1b5a277b", - " 245 call obj_from_u256_pieces(12052668375261465624, 1115056820630111376, 18258964384967382160, 2376171010711085994)": "", - " 246 ret obj_from_u256_pieces -> Ok(U256(obj#181))": "cpu:11630, mem:1736, objs:-/91@6ff61e82", - " 247 call obj_from_u256_pieces(8424913463146644043, 9405616456888726852, 9448465455624499961, 13755081130528028509)": "", - " 248 ret obj_from_u256_pieces -> Ok(U256(obj#183))": "cpu:12131, mem:1800, objs:-/92@aad43293", + " 238 ret vec_new_from_slice -> Ok(Vec(obj#173))": "cpu:9626, mem:1480, objs:-/87@3939bbac", + " 239 call obj_from_u256_pieces(17073613341124213686, 9800153404225276109, 6607116724722439497, 842746758976683084)": "", + " 240 ret obj_from_u256_pieces -> Ok(U256(obj#175))": "cpu:10127, mem:1544, objs:-/88@a1c554a1", + " 241 call obj_from_u256_pieces(16040841695964229797, 5061605267848115623, 14000740750614834722, 13904863006945675968)": "", + " 242 ret obj_from_u256_pieces -> Ok(U256(obj#177))": "cpu:10628, mem:1608, objs:-/89@5dbca5f2", + " 243 call obj_from_u256_pieces(5830218664442262694, 4114147737062195718, 16434537214804972826, 1396935906550304884)": "", + " 244 ret obj_from_u256_pieces -> Ok(U256(obj#179))": "cpu:11129, mem:1672, objs:-/90@329f03eb", + " 245 call obj_from_u256_pieces(8756542147870587062, 2334579494105318157, 3880849428716171604, 577514052903835922)": "", + " 246 ret obj_from_u256_pieces -> Ok(U256(obj#181))": "cpu:11630, mem:1736, objs:-/91@8451f38d", + " 247 call obj_from_u256_pieces(5259919734814292314, 1486637374753912723, 9060486243487422013, 18066450239200677051)": "", + " 248 ret obj_from_u256_pieces -> Ok(U256(obj#183))": "cpu:12131, mem:1800, objs:-/92@c5a670c", " 249 call vec_new_from_slice(5)": "", - " 250 ret vec_new_from_slice -> Ok(Vec(obj#185))": "cpu:13407, mem:1920, objs:-/93@56092c1", + " 250 ret vec_new_from_slice -> Ok(Vec(obj#185))": "cpu:13407, mem:1920, objs:-/93@80ddd82c", " 251 call bls12_381_g2_msm(Vec(obj#173), Vec(obj#185))": "", " 252 call vec_len(Vec(obj#173))": "cpu:13651", " 253 ret vec_len -> Ok(U32(5))": "cpu:13773", - " 254 call vec_len(Vec(obj#185))": "cpu:5351553, mem:2896", - " 255 ret vec_len -> Ok(U32(5))": "cpu:5351675", - " 256 ret bls12_381_g2_msm -> Ok(Bytes(obj#187))": "cpu:25598700, mem:236644, objs:-/94@b7889154", - " 257 call vec_get(Vec(obj#173), U32(0))": "cpu:25601784, mem:236708, objs:-/95@ba997865", - " 258 ret vec_get -> Ok(Bytes(obj#163))": "cpu:25602010", + " 254 call vec_len(Vec(obj#185))": "cpu:5353108, mem:2896", + " 255 ret vec_len -> Ok(U32(5))": "cpu:5353230", + " 256 ret bls12_381_g2_msm -> Ok(Bytes(obj#187))": "cpu:25600824, mem:236852, objs:-/94@37bd5b7d", + " 257 call vec_get(Vec(obj#173), U32(0))": "cpu:25604477, mem:237124, objs:-/95@47f3520c", + " 258 ret vec_get -> Ok(Bytes(obj#163))": "cpu:25604703", " 259 call vec_get(Vec(obj#185), U32(0))": "", - " 260 ret vec_get -> Ok(U256(obj#175))": "cpu:25602236", + " 260 ret vec_get -> Ok(U256(obj#175))": "cpu:25604929", " 261 call bls12_381_g2_mul(Bytes(obj#163), U256(obj#175))": "", - " 262 ret bls12_381_g2_mul -> Ok(Bytes(obj#191))": "cpu:34648952, mem:236772, objs:-/96@7c1583a3", + " 262 ret bls12_381_g2_mul -> Ok(Bytes(obj#191))": "cpu:34652525, mem:237396, objs:-/96@8cc676a4", " 263 call bls12_381_g2_add(Bytes(obj#189), Bytes(obj#191))": "", - " 264 ret bls12_381_g2_add -> Ok(Bytes(obj#193))": "cpu:36913034, mem:236836, objs:-/97@7bec3533", + " 264 ret bls12_381_g2_add -> Ok(Bytes(obj#193))": "cpu:34802154, mem:237668, objs:-/97@fd5accef", " 265 call vec_get(Vec(obj#173), U32(1))": "", - " 266 ret vec_get -> Ok(Bytes(obj#165))": "cpu:36913260", + " 266 ret vec_get -> Ok(Bytes(obj#165))": "cpu:34802380", " 267 call vec_get(Vec(obj#185), U32(1))": "", - " 268 ret vec_get -> Ok(U256(obj#177))": "cpu:36913486", + " 268 ret vec_get -> Ok(U256(obj#177))": "cpu:34802606", " 269 call bls12_381_g2_mul(Bytes(obj#165), U256(obj#177))": "", - " 270 ret bls12_381_g2_mul -> Ok(Bytes(obj#195))": "cpu:45960202, mem:236900, objs:-/98@d7e91106", + " 270 ret bls12_381_g2_mul -> Ok(Bytes(obj#195))": "cpu:43850202, mem:237940, objs:-/98@287ee088", " 271 call bls12_381_g2_add(Bytes(obj#193), Bytes(obj#195))": "", - " 272 ret bls12_381_g2_add -> Ok(Bytes(obj#197))": "cpu:48224284, mem:236964, objs:-/99@df3809bb", + " 272 ret bls12_381_g2_add -> Ok(Bytes(obj#197))": "cpu:43999831, mem:238212, objs:-/99@85bfd7f9", " 273 call vec_get(Vec(obj#173), U32(2))": "", - " 274 ret vec_get -> Ok(Bytes(obj#167))": "cpu:48224510", + " 274 ret vec_get -> Ok(Bytes(obj#167))": "cpu:44000057", " 275 call vec_get(Vec(obj#185), U32(2))": "", - " 276 ret vec_get -> Ok(U256(obj#179))": "cpu:48224736", + " 276 ret vec_get -> Ok(U256(obj#179))": "cpu:44000283", " 277 call bls12_381_g2_mul(Bytes(obj#167), U256(obj#179))": "", - " 278 ret bls12_381_g2_mul -> Ok(Bytes(obj#199))": "cpu:57271452, mem:237028, objs:-/100@29999b60", + " 278 ret bls12_381_g2_mul -> Ok(Bytes(obj#199))": "cpu:53047879, mem:238484, objs:-/100@83eb557e", " 279 call bls12_381_g2_add(Bytes(obj#197), Bytes(obj#199))": "", - " 280 ret bls12_381_g2_add -> Ok(Bytes(obj#201))": "cpu:59535534, mem:237092, objs:-/101@9b91bea1", + " 280 ret bls12_381_g2_add -> Ok(Bytes(obj#201))": "cpu:53197508, mem:238756, objs:-/101@356eda48", " 281 call vec_get(Vec(obj#173), U32(3))": "", - " 282 ret vec_get -> Ok(Bytes(obj#169))": "cpu:59535760", + " 282 ret vec_get -> Ok(Bytes(obj#169))": "cpu:53197734", " 283 call vec_get(Vec(obj#185), U32(3))": "", - " 284 ret vec_get -> Ok(U256(obj#181))": "cpu:59535986", + " 284 ret vec_get -> Ok(U256(obj#181))": "cpu:53197960", " 285 call bls12_381_g2_mul(Bytes(obj#169), U256(obj#181))": "", - " 286 ret bls12_381_g2_mul -> Ok(Bytes(obj#203))": "cpu:68582702, mem:237156, objs:-/102@184ce1c9", + " 286 ret bls12_381_g2_mul -> Ok(Bytes(obj#203))": "cpu:62245556, mem:239028, objs:-/102@633754c7", " 287 call bls12_381_g2_add(Bytes(obj#201), Bytes(obj#203))": "", - " 288 ret bls12_381_g2_add -> Ok(Bytes(obj#205))": "cpu:70846784, mem:237220, objs:-/103@ff3adda7", + " 288 ret bls12_381_g2_add -> Ok(Bytes(obj#205))": "cpu:62395185, mem:239300, objs:-/103@d51e3c43", " 289 call vec_get(Vec(obj#173), U32(4))": "", - " 290 ret vec_get -> Ok(Bytes(obj#171))": "cpu:70847010", + " 290 ret vec_get -> Ok(Bytes(obj#171))": "cpu:62395411", " 291 call vec_get(Vec(obj#185), U32(4))": "", - " 292 ret vec_get -> Ok(U256(obj#183))": "cpu:70847236", + " 292 ret vec_get -> Ok(U256(obj#183))": "cpu:62395637", " 293 call bls12_381_g2_mul(Bytes(obj#171), U256(obj#183))": "", - " 294 ret bls12_381_g2_mul -> Ok(Bytes(obj#207))": "cpu:79893952, mem:237284, objs:-/104@7fe9d90d", + " 294 ret bls12_381_g2_mul -> Ok(Bytes(obj#207))": "cpu:71443233, mem:239572, objs:-/104@e5da1eed", " 295 call bls12_381_g2_add(Bytes(obj#205), Bytes(obj#207))": "", - " 296 ret bls12_381_g2_add -> Ok(Bytes(obj#209))": "cpu:82158034, mem:237348, objs:-/105@f24d423a", + " 296 ret bls12_381_g2_add -> Ok(Bytes(obj#209))": "cpu:71592862, mem:239844, objs:-/105@395f149e", " 297 call obj_cmp(Bytes(obj#209), Bytes(obj#187))": "", - " 298 ret obj_cmp -> Ok(0)": "cpu:82158346", - " 299 end": "cpu:82158346, mem:237348, prngs:-/-, objs:-/105@f24d423a, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 298 ret obj_cmp -> Ok(0)": "cpu:71593174", + " 299 end": "cpu:71593174, mem:239844, prngs:-/-, objs:-/105@395f149e, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g2_mul.json b/soroban-env-host/observations/22/test__bls12_381__g2_mul.json index f2724517f..709857061 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g2_mul.json +++ b/soroban-env-host/observations/22/test__bls12_381__g2_mul.json @@ -1,28 +1,28 @@ { " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", - " 1 call obj_from_u256_pieces(0, 0, 0, 0)": "cpu:3084, mem:64, objs:-/1@f4e2a936", - " 2 ret obj_from_u256_pieces -> Ok(U256(obj#3))": "cpu:3585, mem:128, objs:-/2@74092ac8", + " 1 call obj_from_u256_pieces(0, 0, 0, 0)": "cpu:3653, mem:272, objs:-/1@f4e2a936", + " 2 ret obj_from_u256_pieces -> Ok(U256(obj#3))": "cpu:4154, mem:336, objs:-/2@74092ac8", " 3 call bls12_381_g2_mul(Bytes(obj#1), U256(obj#3))": "", - " 4 ret bls12_381_g2_mul -> Ok(Bytes(obj#5))": "cpu:9050301, mem:192, objs:-/3@cb12abce", - " 5 call obj_cmp(Bytes(obj#5), Bytes(obj#7))": "cpu:9053385, mem:256, objs:-/4@eac588f7", - " 6 ret obj_cmp -> Ok(0)": "cpu:9053697", - " 7 call bls12_381_g2_mul(Bytes(obj#9), U256(1))": "cpu:9056781, mem:320, objs:-/5@85556c2", - " 8 ret bls12_381_g2_mul -> Ok(Bytes(obj#11))": "cpu:18103375, mem:384, objs:-/6@3abc3097", + " 4 ret bls12_381_g2_mul -> Ok(Bytes(obj#5))": "cpu:9051750, mem:608, objs:-/3@cb12abce", + " 5 call obj_cmp(Bytes(obj#5), Bytes(obj#7))": "cpu:9055403, mem:880, objs:-/4@eac588f7", + " 6 ret obj_cmp -> Ok(0)": "cpu:9055715", + " 7 call bls12_381_g2_mul(Bytes(obj#9), U256(1))": "cpu:9059368, mem:1152, objs:-/5@179c643c", + " 8 ret bls12_381_g2_mul -> Ok(Bytes(obj#11))": "cpu:18106842, mem:1424, objs:-/6@600e3e5f", " 9 call obj_cmp(Bytes(obj#11), Bytes(obj#9))": "", - " 10 ret obj_cmp -> Ok(0)": "cpu:18103687", - " 11 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "cpu:18106771, mem:448, objs:-/7@70121ca7", - " 12 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:18107272, mem:512, objs:-/8@9a42b345", - " 13 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 14 ret obj_from_u256_pieces -> Ok(U256(obj#17))": "cpu:18107773, mem:576, objs:-/9@91298b99", + " 10 ret obj_cmp -> Ok(0)": "cpu:18107154", + " 11 call obj_from_u256_pieces(1382979248101647873, 6440934971723338514, 11359438960946870190, 8732565108313877893)": "cpu:18110807, mem:1696, objs:-/7@a0418ad2", + " 12 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:18111308, mem:1760, objs:-/8@158badf", + " 13 call obj_from_u256_pieces(17461574590958800305, 8018887662353493686, 7541867957794240230, 5239794445475264807)": "", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#17))": "cpu:18111809, mem:1824, objs:-/9@d59c1d05", " 15 call bls12_381_g2_mul(Bytes(obj#13), U256(obj#15))": "", - " 16 ret bls12_381_g2_mul -> Ok(Bytes(obj#19))": "cpu:27154489, mem:640, objs:-/10@fa30d55a", + " 16 ret bls12_381_g2_mul -> Ok(Bytes(obj#19))": "cpu:27159405, mem:2096, objs:-/10@f37fed3a", " 17 call bls12_381_g2_mul(Bytes(obj#19), U256(obj#17))": "", - " 18 ret bls12_381_g2_mul -> Ok(Bytes(obj#21))": "cpu:36201205, mem:704, objs:-/11@54c70d83", + " 18 ret bls12_381_g2_mul -> Ok(Bytes(obj#21))": "cpu:36207001, mem:2368, objs:-/11@4c677c04", " 19 call bls12_381_g2_mul(Bytes(obj#13), U256(obj#17))": "", - " 20 ret bls12_381_g2_mul -> Ok(Bytes(obj#23))": "cpu:45247921, mem:768, objs:-/12@52da9e0b", + " 20 ret bls12_381_g2_mul -> Ok(Bytes(obj#23))": "cpu:45254597, mem:2640, objs:-/12@6476867", " 21 call bls12_381_g2_mul(Bytes(obj#23), U256(obj#15))": "", - " 22 ret bls12_381_g2_mul -> Ok(Bytes(obj#25))": "cpu:54294637, mem:832, objs:-/13@4ff2ad90", + " 22 ret bls12_381_g2_mul -> Ok(Bytes(obj#25))": "cpu:54302193, mem:2912, objs:-/13@63236f75", " 23 call obj_cmp(Bytes(obj#21), Bytes(obj#25))": "", - " 24 ret obj_cmp -> Ok(0)": "cpu:54294949", - " 25 end": "cpu:54294949, mem:832, prngs:-/-, objs:-/13@4ff2ad90, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 24 ret obj_cmp -> Ok(0)": "cpu:54302505", + " 25 end": "cpu:54302505, mem:2912, prngs:-/-, objs:-/13@63236f75, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json b/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json index 3978f8812..a79ebc546 100644 --- a/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json +++ b/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json @@ -17,42 +17,42 @@ " 15 call bytes_new_from_slice(0)": "", " 16 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:6334, mem:810, objs:-/6@56ac3668", " 17 call bls12_381_hash_to_g1(Bytes(obj#11), Bytes(obj#9))": "", - " 18 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#13))": "cpu:3219592, mem:10298, objs:-/7@9efbbcc1", + " 18 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#13))": "cpu:3220137, mem:10410, objs:-/7@9efbbcc1", " 19 call bytes_new_from_slice(96)": "", - " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:3220577, mem:10474, objs:-/8@51896357", + " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:3221122, mem:10586, objs:-/8@51896357", " 21 call obj_cmp(Bytes(obj#13), Bytes(obj#15))": "", - " 22 ret obj_cmp -> Ok(0)": "cpu:3220877", + " 22 ret obj_cmp -> Ok(0)": "cpu:3221422", " 23 call bytes_new_from_slice(3)": "", - " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:3221838, mem:10557, objs:-/9@5ec59f82", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:3222383, mem:10669, objs:-/9@5ec59f82", " 25 call bls12_381_hash_to_g1(Bytes(obj#17), Bytes(obj#9))": "", - " 26 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#19))": "cpu:6435253, mem:20045, objs:-/10@e79bbbfb", + " 26 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#19))": "cpu:6436343, mem:20269, objs:-/10@e79bbbfb", " 27 call bytes_new_from_slice(96)": "", - " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:6436238, mem:20221, objs:-/11@68e099a7", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:6437328, mem:20445, objs:-/11@68e099a7", " 29 call obj_cmp(Bytes(obj#19), Bytes(obj#21))": "", - " 30 ret obj_cmp -> Ok(0)": "cpu:6436538", + " 30 ret obj_cmp -> Ok(0)": "cpu:6437628", " 31 call bytes_new_from_slice(16)": "", - " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:6437503, mem:20317, objs:-/12@42e4358e", + " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:6438593, mem:20541, objs:-/12@42e4358e", " 33 call bls12_381_hash_to_g1(Bytes(obj#23), Bytes(obj#9))": "", - " 34 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#25))": "cpu:9651600, mem:29805, objs:-/13@a5112be9", + " 34 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#25))": "cpu:9653235, mem:30141, objs:-/13@a5112be9", " 35 call bytes_new_from_slice(96)": "", - " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:9652585, mem:29981, objs:-/14@c90f15b6", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:9654220, mem:30317, objs:-/14@c90f15b6", " 37 call obj_cmp(Bytes(obj#25), Bytes(obj#27))": "", - " 38 ret obj_cmp -> Ok(0)": "cpu:9652885", + " 38 ret obj_cmp -> Ok(0)": "cpu:9654520", " 39 call bytes_new_from_slice(133)": "", - " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:9653878, mem:30194, objs:-/15@78b64378", + " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:9655513, mem:30530, objs:-/15@78b64378", " 41 call bls12_381_hash_to_g1(Bytes(obj#29), Bytes(obj#9))": "", - " 42 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#31))": "cpu:12874111, mem:39682, objs:-/16@eb416cc7", + " 42 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#31))": "cpu:12876291, mem:40130, objs:-/16@eb416cc7", " 43 call bytes_new_from_slice(96)": "", - " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:12875096, mem:39858, objs:-/17@14001e17", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:12877276, mem:40306, objs:-/17@14001e17", " 45 call obj_cmp(Bytes(obj#31), Bytes(obj#33))": "", - " 46 ret obj_cmp -> Ok(0)": "cpu:12875396", + " 46 ret obj_cmp -> Ok(0)": "cpu:12877576", " 47 call bytes_new_from_slice(517)": "", - " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:12876485, mem:40455, objs:-/18@3077ed4e", + " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:12878665, mem:40903, objs:-/18@3077ed4e", " 49 call bls12_381_hash_to_g1(Bytes(obj#35), Bytes(obj#9))": "", - " 50 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#37))": "cpu:16116857, mem:49943, objs:-/19@70daa102", + " 50 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#37))": "cpu:16119582, mem:50503, objs:-/19@70daa102", " 51 call bytes_new_from_slice(96)": "", - " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:16117842, mem:50119, objs:-/20@19d2fca4", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:16120567, mem:50679, objs:-/20@19d2fca4", " 53 call obj_cmp(Bytes(obj#37), Bytes(obj#39))": "", - " 54 ret obj_cmp -> Ok(0)": "cpu:16118142", - " 55 end": "cpu:16118142, mem:50119, prngs:-/-, objs:-/20@19d2fca4, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 54 ret obj_cmp -> Ok(0)": "cpu:16120867", + " 55 end": "cpu:16120867, mem:50679, prngs:-/-, objs:-/20@19d2fca4, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json b/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json index 32e82745f..46064e779 100644 --- a/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json +++ b/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json @@ -17,42 +17,42 @@ " 15 call bytes_new_from_slice(0)": "", " 16 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:6334, mem:810, objs:-/6@2e40259c", " 17 call bls12_381_hash_to_g2(Bytes(obj#11), Bytes(obj#9))": "", - " 18 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#13))": "cpu:7060287, mem:7690, objs:-/7@2d317ca4", + " 18 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#13))": "cpu:7060856, mem:7898, objs:-/7@2d317ca4", " 19 call bytes_new_from_slice(192)": "", - " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:7061296, mem:7962, objs:-/8@f21b2fa0", + " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:7061865, mem:8170, objs:-/8@f21b2fa0", " 21 call obj_cmp(Bytes(obj#13), Bytes(obj#15))": "", - " 22 ret obj_cmp -> Ok(0)": "cpu:7061608", + " 22 ret obj_cmp -> Ok(0)": "cpu:7062177", " 23 call bytes_new_from_slice(3)": "", - " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:7062569, mem:8045, objs:-/9@aba7a202", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:7063138, mem:8253, objs:-/9@aba7a202", " 25 call bls12_381_hash_to_g2(Bytes(obj#17), Bytes(obj#9))": "", - " 26 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#19))": "cpu:14116681, mem:14925, objs:-/10@ba39dec3", + " 26 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#19))": "cpu:14117819, mem:15341, objs:-/10@ba39dec3", " 27 call bytes_new_from_slice(192)": "", - " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:14117690, mem:15197, objs:-/11@dd6c306d", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:14118828, mem:15613, objs:-/11@dd6c306d", " 29 call obj_cmp(Bytes(obj#19), Bytes(obj#21))": "", - " 30 ret obj_cmp -> Ok(0)": "cpu:14118002", + " 30 ret obj_cmp -> Ok(0)": "cpu:14119140", " 31 call bytes_new_from_slice(16)": "", - " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:14118967, mem:15293, objs:-/12@aab36c6f", + " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:14120105, mem:15709, objs:-/12@aab36c6f", " 33 call bls12_381_hash_to_g2(Bytes(obj#23), Bytes(obj#9))": "", - " 34 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#25))": "cpu:21173769, mem:22173, objs:-/13@860c1403", + " 34 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#25))": "cpu:21175476, mem:22797, objs:-/13@860c1403", " 35 call bytes_new_from_slice(192)": "", - " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:21174778, mem:22445, objs:-/14@ca75fa0f", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:21176485, mem:23069, objs:-/14@ca75fa0f", " 37 call obj_cmp(Bytes(obj#25), Bytes(obj#27))": "", - " 38 ret obj_cmp -> Ok(0)": "cpu:21175090", + " 38 ret obj_cmp -> Ok(0)": "cpu:21176797", " 39 call bytes_new_from_slice(133)": "", - " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:21176083, mem:22658, objs:-/15@55b1f41", + " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:21177790, mem:23282, objs:-/15@55b1f41", " 41 call bls12_381_hash_to_g2(Bytes(obj#29), Bytes(obj#9))": "", - " 42 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#31))": "cpu:28237098, mem:29538, objs:-/16@67cc16f5", + " 42 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#31))": "cpu:28239374, mem:30370, objs:-/16@67cc16f5", " 43 call bytes_new_from_slice(192)": "", - " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:28238107, mem:29810, objs:-/17@91beebd2", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:28240383, mem:30642, objs:-/17@91beebd2", " 45 call obj_cmp(Bytes(obj#31), Bytes(obj#33))": "", - " 46 ret obj_cmp -> Ok(0)": "cpu:28238419", + " 46 ret obj_cmp -> Ok(0)": "cpu:28240695", " 47 call bytes_new_from_slice(517)": "", - " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:28239508, mem:30407, objs:-/18@77fa1166", + " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:28241784, mem:31239, objs:-/18@77fa1166", " 49 call bls12_381_hash_to_g2(Bytes(obj#35), Bytes(obj#9))": "", - " 50 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#37))": "cpu:35320914, mem:37287, objs:-/19@42a8b15f", + " 50 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#37))": "cpu:35323759, mem:38327, objs:-/19@42a8b15f", " 51 call bytes_new_from_slice(192)": "", - " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:35321923, mem:37559, objs:-/20@dd93bdf4", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:35324768, mem:38599, objs:-/20@dd93bdf4", " 53 call obj_cmp(Bytes(obj#37), Bytes(obj#39))": "", - " 54 ret obj_cmp -> Ok(0)": "cpu:35322235", - " 55 end": "cpu:35322235, mem:37559, prngs:-/-, objs:-/20@dd93bdf4, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 54 ret obj_cmp -> Ok(0)": "cpu:35325080", + " 55 end": "cpu:35325080, mem:38599, prngs:-/-, objs:-/20@dd93bdf4, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json b/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json index eda3ef8b1..e8225f15a 100644 --- a/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json +++ b/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json @@ -5,88 +5,88 @@ " 3 call bls12_381_map_fp2_to_g2(Bytes(obj#1))": "", " 4 ret bls12_381_map_fp2_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:1766", " 5 call bytes_new_from_slice(97)": "cpu:2427", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:3412, mem:352, objs:-/2@5b14765e", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:3412, mem:352, objs:-/2@b8cae411", " 7 call bls12_381_map_fp2_to_g2(Bytes(obj#3))": "", " 8 ret bls12_381_map_fp2_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:3534", " 9 call bytes_new_from_slice(192)": "cpu:0, mem:0", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:1009, mem:272, objs:-/3@89f3534e", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:1009, mem:272, objs:-/3@84cbabcf", " 11 call bytes_new_from_slice(96)": "", - " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:1994, mem:448, objs:-/4@54d07739", + " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:1994, mem:448, objs:-/4@de01dc4a", " 13 call bls12_381_map_fp2_to_g2(Bytes(obj#7))": "", - " 14 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#9))": "cpu:2427433, mem:3856, objs:-/5@ec80b213", + " 14 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#9))": "cpu:2428056, mem:4064, objs:-/5@c92c817b", " 15 call obj_cmp(Bytes(obj#9), Bytes(obj#5))": "", - " 16 ret obj_cmp -> Ok(0)": "cpu:2427745", + " 16 ret obj_cmp -> Ok(0)": "cpu:2428368", " 17 call bytes_new_from_slice(192)": "", - " 18 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:2428754, mem:4128, objs:-/6@9fa0943f", + " 18 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:2429377, mem:4336, objs:-/6@aab5467f", " 19 call bytes_new_from_slice(96)": "", - " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#13))": "cpu:2429739, mem:4304, objs:-/7@5122c783", + " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#13))": "cpu:2430362, mem:4512, objs:-/7@45b33a3f", " 21 call bls12_381_map_fp2_to_g2(Bytes(obj#13))": "", - " 22 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#15))": "cpu:4855178, mem:7712, objs:-/8@be4fb7d8", + " 22 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#15))": "cpu:4856424, mem:8128, objs:-/8@dc781659", " 23 call obj_cmp(Bytes(obj#15), Bytes(obj#11))": "", - " 24 ret obj_cmp -> Ok(0)": "cpu:4855490", + " 24 ret obj_cmp -> Ok(0)": "cpu:4856736", " 25 call bytes_new_from_slice(192)": "", - " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:4856499, mem:7984, objs:-/9@da7a8792", + " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:4857745, mem:8400, objs:-/9@4596be6d", " 27 call bytes_new_from_slice(96)": "", - " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:4857484, mem:8160, objs:-/10@fa8ee1be", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:4858730, mem:8576, objs:-/10@465cd103", " 29 call bls12_381_map_fp2_to_g2(Bytes(obj#19))": "", - " 30 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#21))": "cpu:7282923, mem:11568, objs:-/11@3b3afaa5", + " 30 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#21))": "cpu:7284792, mem:12192, objs:-/11@3f31c853", " 31 call obj_cmp(Bytes(obj#21), Bytes(obj#17))": "", - " 32 ret obj_cmp -> Ok(0)": "cpu:7283235", + " 32 ret obj_cmp -> Ok(0)": "cpu:7285104", " 33 call bytes_new_from_slice(192)": "", - " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:7284244, mem:11840, objs:-/12@7f160662", + " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:7286113, mem:12464, objs:-/12@9e7dcbde", " 35 call bytes_new_from_slice(96)": "", - " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#25))": "cpu:7285229, mem:12016, objs:-/13@7f21fbc6", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#25))": "cpu:7287098, mem:12640, objs:-/13@e33cf4c0", " 37 call bls12_381_map_fp2_to_g2(Bytes(obj#25))": "", - " 38 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#27))": "cpu:9710668, mem:15424, objs:-/14@6569b3bc", + " 38 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#27))": "cpu:9713160, mem:16256, objs:-/14@4d072f7e", " 39 call obj_cmp(Bytes(obj#27), Bytes(obj#23))": "", - " 40 ret obj_cmp -> Ok(0)": "cpu:9710980", + " 40 ret obj_cmp -> Ok(0)": "cpu:9713472", " 41 call bytes_new_from_slice(192)": "", - " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:9711989, mem:15696, objs:-/15@596a85b2", + " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:9714481, mem:16528, objs:-/15@b619650", " 43 call bytes_new_from_slice(96)": "", - " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:9712974, mem:15872, objs:-/16@c30eeff6", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:9715466, mem:16704, objs:-/16@3251749c", " 45 call bls12_381_map_fp2_to_g2(Bytes(obj#31))": "", - " 46 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#33))": "cpu:12138413, mem:19280, objs:-/17@e0aee5d9", + " 46 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#33))": "cpu:12141528, mem:20320, objs:-/17@4d90808a", " 47 call obj_cmp(Bytes(obj#33), Bytes(obj#29))": "", - " 48 ret obj_cmp -> Ok(0)": "cpu:12138725", + " 48 ret obj_cmp -> Ok(0)": "cpu:12141840", " 49 call bytes_new_from_slice(192)": "", - " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:12139734, mem:19552, objs:-/18@fd20ec9e", + " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:12142849, mem:20592, objs:-/18@a14b9884", " 51 call bytes_new_from_slice(96)": "", - " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:12140719, mem:19728, objs:-/19@e1f85ad", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:12143834, mem:20768, objs:-/19@2081cb8", " 53 call bls12_381_map_fp2_to_g2(Bytes(obj#37))": "", - " 54 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#39))": "cpu:14566158, mem:23136, objs:-/20@defdfad7", + " 54 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#39))": "cpu:14569896, mem:24384, objs:-/20@ded0041a", " 55 call obj_cmp(Bytes(obj#39), Bytes(obj#35))": "", - " 56 ret obj_cmp -> Ok(0)": "cpu:14566470", + " 56 ret obj_cmp -> Ok(0)": "cpu:14570208", " 57 call bytes_new_from_slice(192)": "", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:14567479, mem:23408, objs:-/21@faf6362d", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:14571217, mem:24656, objs:-/21@efcbe3c4", " 59 call bytes_new_from_slice(96)": "", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#43))": "cpu:14568464, mem:23584, objs:-/22@d9e0eeeb", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#43))": "cpu:14572202, mem:24832, objs:-/22@a0f062d2", " 61 call bls12_381_map_fp2_to_g2(Bytes(obj#43))": "", - " 62 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#45))": "cpu:16993903, mem:26992, objs:-/23@bdfa6563", + " 62 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#45))": "cpu:16998264, mem:28448, objs:-/23@b60831ac", " 63 call obj_cmp(Bytes(obj#45), Bytes(obj#41))": "", - " 64 ret obj_cmp -> Ok(0)": "cpu:16994215", + " 64 ret obj_cmp -> Ok(0)": "cpu:16998576", " 65 call bytes_new_from_slice(192)": "", - " 66 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:16995224, mem:27264, objs:-/24@1a02f553", + " 66 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:16999585, mem:28720, objs:-/24@1a0db4f9", " 67 call bytes_new_from_slice(96)": "", - " 68 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:16996209, mem:27440, objs:-/25@4af763de", + " 68 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:17000570, mem:28896, objs:-/25@23f3cdc6", " 69 call bls12_381_map_fp2_to_g2(Bytes(obj#49))": "", - " 70 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#51))": "cpu:19421648, mem:30848, objs:-/26@527595c9", + " 70 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#51))": "cpu:19426632, mem:32512, objs:-/26@1efe0c89", " 71 call obj_cmp(Bytes(obj#51), Bytes(obj#47))": "", - " 72 ret obj_cmp -> Ok(0)": "cpu:19421960", + " 72 ret obj_cmp -> Ok(0)": "cpu:19426944", " 73 call bytes_new_from_slice(192)": "", - " 74 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:19422969, mem:31120, objs:-/27@181c5857", + " 74 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:19427953, mem:32784, objs:-/27@29589445", " 75 call bytes_new_from_slice(96)": "", - " 76 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:19423954, mem:31296, objs:-/28@36ffb03b", + " 76 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:19428938, mem:32960, objs:-/28@3f0c9a15", " 77 call bls12_381_map_fp2_to_g2(Bytes(obj#55))": "", - " 78 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#57))": "cpu:21849393, mem:34704, objs:-/29@b1f19f69", + " 78 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#57))": "cpu:21855000, mem:36576, objs:-/29@51b6b995", " 79 call obj_cmp(Bytes(obj#57), Bytes(obj#53))": "", - " 80 ret obj_cmp -> Ok(0)": "cpu:21849705", + " 80 ret obj_cmp -> Ok(0)": "cpu:21855312", " 81 call bytes_new_from_slice(192)": "", - " 82 ret bytes_new_from_slice -> Ok(Bytes(obj#59))": "cpu:21850714, mem:34976, objs:-/30@87a81974", + " 82 ret bytes_new_from_slice -> Ok(Bytes(obj#59))": "cpu:21856321, mem:36848, objs:-/30@9e658476", " 83 call bytes_new_from_slice(96)": "", - " 84 ret bytes_new_from_slice -> Ok(Bytes(obj#61))": "cpu:21851699, mem:35152, objs:-/31@9ed5a36b", + " 84 ret bytes_new_from_slice -> Ok(Bytes(obj#61))": "cpu:21857306, mem:37024, objs:-/31@5b51107", " 85 call bls12_381_map_fp2_to_g2(Bytes(obj#61))": "", - " 86 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#63))": "cpu:24277138, mem:38560, objs:-/32@ef4e1b26", + " 86 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#63))": "cpu:24283368, mem:40640, objs:-/32@8da36b92", " 87 call obj_cmp(Bytes(obj#63), Bytes(obj#59))": "", - " 88 ret obj_cmp -> Ok(0)": "cpu:24277450", - " 89 end": "cpu:24277450, mem:38560, prngs:-/-, objs:-/32@ef4e1b26, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 88 ret obj_cmp -> Ok(0)": "cpu:24283680", + " 89 end": "cpu:24283680, mem:40640, prngs:-/-, objs:-/32@8da36b92, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json b/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json index 76175a3b3..6c4e39cd5 100644 --- a/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json +++ b/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json @@ -5,88 +5,88 @@ " 3 call bls12_381_map_fp_to_g1(Bytes(obj#1))": "", " 4 ret bls12_381_map_fp_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:1754", " 5 call bytes_new_from_slice(49)": "cpu:2415", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:3388, mem:256, objs:-/2@c4f554b9", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:3388, mem:256, objs:-/2@7385e39e", " 7 call bls12_381_map_fp_to_g1(Bytes(obj#3))": "", " 8 ret bls12_381_map_fp_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:3510", " 9 call bytes_new_from_slice(96)": "cpu:0, mem:0", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:985, mem:176, objs:-/3@10860de1", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:985, mem:176, objs:-/3@cdeaaaab", " 11 call bytes_new_from_slice(48)": "", - " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:1958, mem:304, objs:-/4@bcfde511", + " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:1958, mem:304, objs:-/4@2e0f3b17", " 13 call bls12_381_map_fp_to_g1(Bytes(obj#7))": "", - " 14 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#9))": "cpu:1546490, mem:5920, objs:-/5@f8828dbe", + " 14 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#9))": "cpu:1547035, mem:6032, objs:-/5@29aed6cc", " 15 call obj_cmp(Bytes(obj#9), Bytes(obj#5))": "", - " 16 ret obj_cmp -> Ok(0)": "cpu:1546790", + " 16 ret obj_cmp -> Ok(0)": "cpu:1547335", " 17 call bytes_new_from_slice(96)": "", - " 18 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:1547775, mem:6096, objs:-/6@672b1778", + " 18 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:1548320, mem:6208, objs:-/6@821b5c9e", " 19 call bytes_new_from_slice(48)": "", - " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#13))": "cpu:1548748, mem:6224, objs:-/7@286e4eb2", + " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#13))": "cpu:1549293, mem:6336, objs:-/7@71870e60", " 21 call bls12_381_map_fp_to_g1(Bytes(obj#13))": "", - " 22 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#15))": "cpu:3093280, mem:11840, objs:-/8@b788e44f", + " 22 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#15))": "cpu:3094370, mem:12064, objs:-/8@fd3d495a", " 23 call obj_cmp(Bytes(obj#15), Bytes(obj#11))": "", - " 24 ret obj_cmp -> Ok(0)": "cpu:3093580", + " 24 ret obj_cmp -> Ok(0)": "cpu:3094670", " 25 call bytes_new_from_slice(96)": "", - " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:3094565, mem:12016, objs:-/9@2a9d7275", + " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:3095655, mem:12240, objs:-/9@e01f72c2", " 27 call bytes_new_from_slice(48)": "", - " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:3095538, mem:12144, objs:-/10@92eba3a1", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:3096628, mem:12368, objs:-/10@c37ded65", " 29 call bls12_381_map_fp_to_g1(Bytes(obj#19))": "", - " 30 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#21))": "cpu:4640070, mem:17760, objs:-/11@5da95038", + " 30 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#21))": "cpu:4641705, mem:18096, objs:-/11@74ec3770", " 31 call obj_cmp(Bytes(obj#21), Bytes(obj#17))": "", - " 32 ret obj_cmp -> Ok(0)": "cpu:4640370", + " 32 ret obj_cmp -> Ok(0)": "cpu:4642005", " 33 call bytes_new_from_slice(96)": "", - " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:4641355, mem:17936, objs:-/12@e6c8b351", + " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:4642990, mem:18272, objs:-/12@bc8549c8", " 35 call bytes_new_from_slice(48)": "", - " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#25))": "cpu:4642328, mem:18064, objs:-/13@f9d8a538", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#25))": "cpu:4643963, mem:18400, objs:-/13@79cc3259", " 37 call bls12_381_map_fp_to_g1(Bytes(obj#25))": "", - " 38 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#27))": "cpu:6186860, mem:23680, objs:-/14@921ad21e", + " 38 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#27))": "cpu:6189040, mem:24128, objs:-/14@97e7f723", " 39 call obj_cmp(Bytes(obj#27), Bytes(obj#23))": "", - " 40 ret obj_cmp -> Ok(0)": "cpu:6187160", + " 40 ret obj_cmp -> Ok(0)": "cpu:6189340", " 41 call bytes_new_from_slice(96)": "", - " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:6188145, mem:23856, objs:-/15@6f682fe5", + " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:6190325, mem:24304, objs:-/15@3746f16a", " 43 call bytes_new_from_slice(48)": "", - " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:6189118, mem:23984, objs:-/16@11b77db3", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:6191298, mem:24432, objs:-/16@114ed45b", " 45 call bls12_381_map_fp_to_g1(Bytes(obj#31))": "", - " 46 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#33))": "cpu:7733650, mem:29600, objs:-/17@79a67632", + " 46 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#33))": "cpu:7736375, mem:30160, objs:-/17@448a6b86", " 47 call obj_cmp(Bytes(obj#33), Bytes(obj#29))": "", - " 48 ret obj_cmp -> Ok(0)": "cpu:7733950", + " 48 ret obj_cmp -> Ok(0)": "cpu:7736675", " 49 call bytes_new_from_slice(96)": "", - " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:7734935, mem:29776, objs:-/18@a31ae8b9", + " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:7737660, mem:30336, objs:-/18@1b5f524f", " 51 call bytes_new_from_slice(48)": "", - " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:7735908, mem:29904, objs:-/19@290ffd84", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:7738633, mem:30464, objs:-/19@fe79161", " 53 call bls12_381_map_fp_to_g1(Bytes(obj#37))": "", - " 54 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#39))": "cpu:9280440, mem:35520, objs:-/20@6d31c3af", + " 54 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#39))": "cpu:9283710, mem:36192, objs:-/20@af30d655", " 55 call obj_cmp(Bytes(obj#39), Bytes(obj#35))": "", - " 56 ret obj_cmp -> Ok(0)": "cpu:9280740", + " 56 ret obj_cmp -> Ok(0)": "cpu:9284010", " 57 call bytes_new_from_slice(96)": "", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:9281725, mem:35696, objs:-/21@7dff8238", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:9284995, mem:36368, objs:-/21@8f40a475", " 59 call bytes_new_from_slice(48)": "", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#43))": "cpu:9282698, mem:35824, objs:-/22@2dc8aba", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#43))": "cpu:9285968, mem:36496, objs:-/22@37d82db9", " 61 call bls12_381_map_fp_to_g1(Bytes(obj#43))": "", - " 62 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#45))": "cpu:10827230, mem:41440, objs:-/23@48b5c974", + " 62 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#45))": "cpu:10831045, mem:42224, objs:-/23@de5cb3dc", " 63 call obj_cmp(Bytes(obj#45), Bytes(obj#41))": "", - " 64 ret obj_cmp -> Ok(0)": "cpu:10827530", + " 64 ret obj_cmp -> Ok(0)": "cpu:10831345", " 65 call bytes_new_from_slice(96)": "", - " 66 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:10828515, mem:41616, objs:-/24@aae68782", + " 66 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:10832330, mem:42400, objs:-/24@613b7c76", " 67 call bytes_new_from_slice(48)": "", - " 68 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:10829488, mem:41744, objs:-/25@9a75571a", + " 68 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:10833303, mem:42528, objs:-/25@fac3e5c0", " 69 call bls12_381_map_fp_to_g1(Bytes(obj#49))": "", - " 70 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#51))": "cpu:12374020, mem:47360, objs:-/26@83f69cb3", + " 70 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#51))": "cpu:12378380, mem:48256, objs:-/26@e7334e35", " 71 call obj_cmp(Bytes(obj#51), Bytes(obj#47))": "", - " 72 ret obj_cmp -> Ok(0)": "cpu:12374320", + " 72 ret obj_cmp -> Ok(0)": "cpu:12378680", " 73 call bytes_new_from_slice(96)": "", - " 74 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:12375305, mem:47536, objs:-/27@c18e8bb1", + " 74 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:12379665, mem:48432, objs:-/27@a70654db", " 75 call bytes_new_from_slice(48)": "", - " 76 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:12376278, mem:47664, objs:-/28@87c5c114", + " 76 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:12380638, mem:48560, objs:-/28@4f2c81bb", " 77 call bls12_381_map_fp_to_g1(Bytes(obj#55))": "", - " 78 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#57))": "cpu:13920810, mem:53280, objs:-/29@ac1c35d3", + " 78 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#57))": "cpu:13925715, mem:54288, objs:-/29@6049ec79", " 79 call obj_cmp(Bytes(obj#57), Bytes(obj#53))": "", - " 80 ret obj_cmp -> Ok(0)": "cpu:13921110", + " 80 ret obj_cmp -> Ok(0)": "cpu:13926015", " 81 call bytes_new_from_slice(96)": "", - " 82 ret bytes_new_from_slice -> Ok(Bytes(obj#59))": "cpu:13922095, mem:53456, objs:-/30@1c05a47c", + " 82 ret bytes_new_from_slice -> Ok(Bytes(obj#59))": "cpu:13927000, mem:54464, objs:-/30@6a6fdc1d", " 83 call bytes_new_from_slice(48)": "", - " 84 ret bytes_new_from_slice -> Ok(Bytes(obj#61))": "cpu:13923068, mem:53584, objs:-/31@b24d975f", + " 84 ret bytes_new_from_slice -> Ok(Bytes(obj#61))": "cpu:13927973, mem:54592, objs:-/31@c8870a0b", " 85 call bls12_381_map_fp_to_g1(Bytes(obj#61))": "", - " 86 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#63))": "cpu:15467600, mem:59200, objs:-/32@ba0e4c53", + " 86 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#63))": "cpu:15473050, mem:60320, objs:-/32@15761a", " 87 call obj_cmp(Bytes(obj#63), Bytes(obj#59))": "", - " 88 ret obj_cmp -> Ok(0)": "cpu:15467900", - " 89 end": "cpu:15467900, mem:59200, prngs:-/-, objs:-/32@ba0e4c53, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 88 ret obj_cmp -> Ok(0)": "cpu:15473350", + " 89 end": "cpu:15473350, mem:60320, prngs:-/-, objs:-/32@15761a, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__pairing.json b/soroban-env-host/observations/22/test__bls12_381__pairing.json index 842b4e79e..969bcd043 100644 --- a/soroban-env-host/observations/22/test__bls12_381__pairing.json +++ b/soroban-env-host/observations/22/test__bls12_381__pairing.json @@ -9,114 +9,114 @@ " 7 call vec_new_from_slice(3)": "", " 8 ret vec_new_from_slice -> Ok(Vec(obj#7))": "cpu:6088, mem:632, objs:-/4@8244fa30", " 9 call bytes_new_from_slice(192)": "cpu:6749", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:7758, mem:904, objs:-/5@c02aba07", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:7758, mem:904, objs:-/5@7db97cd4", " 11 call bytes_new_from_slice(192)": "cpu:8419", - " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:9428, mem:1176, objs:-/6@487ed264", + " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:9428, mem:1176, objs:-/6@2f986967", " 13 call vec_new_from_slice(2)": "", - " 14 ret vec_new_from_slice -> Ok(Vec(obj#13))": "cpu:10515, mem:1272, objs:-/7@bb54cc01", + " 14 ret vec_new_from_slice -> Ok(Vec(obj#13))": "cpu:10515, mem:1272, objs:-/7@e86d844b", " 15 call bls12_381_multi_pairing_check(Vec(obj#7), Vec(obj#13))": "", " 16 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:10759", " 17 call vec_new_from_slice(0)": "", - " 18 ret vec_new_from_slice -> Ok(Vec(obj#15))": "cpu:11720, mem:1352, objs:-/8@82674552", + " 18 ret vec_new_from_slice -> Ok(Vec(obj#15))": "cpu:11720, mem:1352, objs:-/8@aefe5995", " 19 call vec_new_from_slice(0)": "", - " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:12681, mem:1432, objs:-/9@1345611a", + " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:12681, mem:1432, objs:-/9@e19454cb", " 21 call bls12_381_multi_pairing_check(Vec(obj#15), Vec(obj#17))": "", " 22 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:12925", " 23 call bytes_new_from_slice(96)": "cpu:13586", - " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:14571, mem:1608, objs:-/10@7a106154", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:14571, mem:1608, objs:-/10@d5c411e9", " 25 call bytes_new_from_slice(96)": "cpu:15232", - " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:16217, mem:1784, objs:-/11@ec2e3333", + " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:16217, mem:1784, objs:-/11@9371ef1d", " 27 call bytes_new_from_slice(96)": "cpu:16878", - " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:17863, mem:1960, objs:-/12@7fed0b7e", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:17863, mem:1960, objs:-/12@3462be9a", " 29 call vec_new_from_slice(3)": "", - " 30 ret vec_new_from_slice -> Ok(Vec(obj#25))": "cpu:19013, mem:2064, objs:-/13@6dc728c2", - " 31 call vec_put(Vec(obj#25), U32(1), Bytes(obj#27))": "cpu:20775, mem:2128, objs:-/14@8be8f7f7", - " 32 ret vec_put -> Ok(Vec(obj#29))": "cpu:22029, mem:2232, objs:-/15@a6d874ef", - " 33 call bytes_new_from_slice(192)": "cpu:22690", - " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:23699, mem:2504, objs:-/16@fe14a4a8", - " 35 call bytes_new_from_slice(192)": "cpu:24360", - " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:25369, mem:2776, objs:-/17@c4d75455", + " 30 ret vec_new_from_slice -> Ok(Vec(obj#25))": "cpu:19013, mem:2064, objs:-/13@21b206a8", + " 31 call vec_put(Vec(obj#25), U32(1), Bytes(obj#27))": "cpu:21320, mem:2240, objs:-/14@211e7ae", + " 32 ret vec_put -> Ok(Vec(obj#29))": "cpu:22574, mem:2344, objs:-/15@d6218c40", + " 33 call bytes_new_from_slice(192)": "cpu:23235", + " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:24244, mem:2616, objs:-/16@1fbd75b9", + " 35 call bytes_new_from_slice(192)": "cpu:24905", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:25914, mem:2888, objs:-/17@eb01b50b", " 37 call vec_new_from_slice(2)": "", - " 38 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:26456, mem:2872, objs:-/18@aaad64d", + " 38 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:27001, mem:2984, objs:-/18@88878336", " 39 call bls12_381_multi_pairing_check(Vec(obj#29), Vec(obj#35))": "", - " 40 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:26700", - " 41 call bytes_new_from_slice(96)": "cpu:27361", - " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:28346, mem:3048, objs:-/19@ab89a61f", - " 43 call bytes_new_from_slice(96)": "cpu:29007", - " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:29992, mem:3224, objs:-/20@d542535f", - " 45 call bytes_new_from_slice(96)": "cpu:30653", - " 46 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:31638, mem:3400, objs:-/21@ded92be8", + " 40 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:27245", + " 41 call bytes_new_from_slice(96)": "cpu:27906", + " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:28891, mem:3160, objs:-/19@bef467b3", + " 43 call bytes_new_from_slice(96)": "cpu:29552", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:30537, mem:3336, objs:-/20@7711af03", + " 45 call bytes_new_from_slice(96)": "cpu:31198", + " 46 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:32183, mem:3512, objs:-/21@bd0eaa67", " 47 call vec_new_from_slice(3)": "", - " 48 ret vec_new_from_slice -> Ok(Vec(obj#43))": "cpu:32788, mem:3504, objs:-/22@c6483fc1", - " 49 call bytes_new_from_slice(192)": "cpu:33449", - " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#45))": "cpu:34458, mem:3776, objs:-/23@76b0e9c1", - " 51 call bytes_new_from_slice(192)": "cpu:35119", - " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:36128, mem:4048, objs:-/24@346c7b4", - " 53 call bytes_new_from_slice(192)": "cpu:36789", - " 54 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:37798, mem:4320, objs:-/25@dd11c915", + " 48 ret vec_new_from_slice -> Ok(Vec(obj#43))": "cpu:33333, mem:3616, objs:-/22@4745d9cc", + " 49 call bytes_new_from_slice(192)": "cpu:33994", + " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#45))": "cpu:35003, mem:3888, objs:-/23@2ac90b2", + " 51 call bytes_new_from_slice(192)": "cpu:35664", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:36673, mem:4160, objs:-/24@d104dc23", + " 53 call bytes_new_from_slice(192)": "cpu:37334", + " 54 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:38343, mem:4432, objs:-/25@11f7750c", " 55 call vec_new_from_slice(3)": "", - " 56 ret vec_new_from_slice -> Ok(Vec(obj#51))": "cpu:38948, mem:4424, objs:-/26@d697e073", - " 57 call vec_put(Vec(obj#51), U32(1), Bytes(obj#53))": "cpu:42032, mem:4488, objs:-/27@20144015", - " 58 ret vec_put -> Ok(Vec(obj#55))": "cpu:43286, mem:4592, objs:-/28@4b569925", + " 56 ret vec_new_from_slice -> Ok(Vec(obj#51))": "cpu:39493, mem:4536, objs:-/26@ada08c01", + " 57 call vec_put(Vec(obj#51), U32(1), Bytes(obj#53))": "cpu:43146, mem:4808, objs:-/27@f2ac27ac", + " 58 ret vec_put -> Ok(Vec(obj#55))": "cpu:44400, mem:4912, objs:-/28@6d6b0a1", " 59 call bls12_381_multi_pairing_check(Vec(obj#43), Vec(obj#55))": "", - " 60 call vec_len(Vec(obj#43))": "cpu:43530", - " 61 ret vec_len -> Ok(U32(3))": "cpu:43652", - " 62 call vec_len(Vec(obj#55))": "cpu:2247179, mem:4896", - " 63 ret vec_len -> Ok(U32(3))": "cpu:2247301", - " 64 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:4382734, mem:5488", - " 65 call bls12_381_g2_add(Bytes(obj#61), Bytes(obj#63))": "cpu:744024, mem:256, objs:-/32@a1920e67", - " 66 ret bls12_381_g2_add -> Ok(Bytes(obj#65))": "cpu:3008106, mem:320, objs:-/33@58cb448c", + " 60 call vec_len(Vec(obj#43))": "cpu:44644", + " 61 ret vec_len -> Ok(U32(3))": "cpu:44766", + " 62 call vec_len(Vec(obj#55))": "cpu:2248722, mem:5216", + " 63 ret vec_len -> Ok(U32(3))": "cpu:2248844", + " 64 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:3327077, mem:5808", + " 65 call bls12_381_g2_add(Bytes(obj#61), Bytes(obj#63))": "cpu:746395, mem:896, objs:-/32@be1f7a8e", + " 66 ret bls12_381_g2_add -> Ok(Bytes(obj#65))": "cpu:896024, mem:1168, objs:-/33@9d890a7b", " 67 call vec_new_from_slice(3)": "", - " 68 ret vec_new_from_slice -> Ok(Vec(obj#67))": "cpu:3009256, mem:424, objs:-/34@ace96f6f", + " 68 ret vec_new_from_slice -> Ok(Vec(obj#67))": "cpu:897174, mem:1272, objs:-/34@7f96f85d", " 69 call vec_new_from_slice(3)": "", - " 70 ret vec_new_from_slice -> Ok(Vec(obj#69))": "cpu:3010406, mem:528, objs:-/35@dd920813", + " 70 ret vec_new_from_slice -> Ok(Vec(obj#69))": "cpu:898324, mem:1376, objs:-/35@66669ec2", " 71 call bls12_381_multi_pairing_check(Vec(obj#67), Vec(obj#69))": "", - " 72 call vec_len(Vec(obj#67))": "cpu:3010650", - " 73 ret vec_len -> Ok(U32(3))": "cpu:3010772", - " 74 call vec_len(Vec(obj#69))": "cpu:5214299, mem:832", - " 75 ret vec_len -> Ok(U32(3))": "cpu:5214421", - " 76 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:33809029, mem:222545", - " 77 call bls12_381_g1_add(Bytes(obj#71), Bytes(obj#73))": "cpu:1077125, mem:256, objs:-/39@bec06383", - " 78 ret bls12_381_g1_add -> Ok(Bytes(obj#79))": "cpu:2648065, mem:320, objs:-/40@fbe4add2", + " 72 call vec_len(Vec(obj#67))": "cpu:898568", + " 73 ret vec_len -> Ok(U32(3))": "cpu:898690", + " 74 call vec_len(Vec(obj#69))": "cpu:3102646, mem:1680", + " 75 ret vec_len -> Ok(U32(3))": "cpu:3102768", + " 76 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:31698309, mem:223393", + " 77 call bls12_381_g1_add(Bytes(obj#71), Bytes(obj#73))": "cpu:1079664, mem:896, objs:-/39@755a50d2", + " 78 ret bls12_381_g1_add -> Ok(Bytes(obj#79))": "cpu:1190415, mem:1072, objs:-/40@ef7b3d9a", " 79 call vec_new_from_slice(3)": "", - " 80 ret vec_new_from_slice -> Ok(Vec(obj#81))": "cpu:2649215, mem:424, objs:-/41@645f0020", + " 80 ret vec_new_from_slice -> Ok(Vec(obj#81))": "cpu:1191565, mem:1176, objs:-/41@8c07b073", " 81 call vec_new_from_slice(3)": "", - " 82 ret vec_new_from_slice -> Ok(Vec(obj#83))": "cpu:2650365, mem:528, objs:-/42@98f94a6c", + " 82 ret vec_new_from_slice -> Ok(Vec(obj#83))": "cpu:1192715, mem:1280, objs:-/42@371e0485", " 83 call bls12_381_multi_pairing_check(Vec(obj#81), Vec(obj#83))": "", - " 84 call vec_len(Vec(obj#81))": "cpu:2650609", - " 85 ret vec_len -> Ok(U32(3))": "cpu:2650731", - " 86 call vec_len(Vec(obj#83))": "cpu:4854258, mem:832", - " 87 ret vec_len -> Ok(U32(3))": "cpu:4854380", - " 88 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:33448988, mem:222545", - " 89 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "cpu:0, mem:0", - " 90 ret obj_from_u256_pieces -> Ok(U256(obj#85))": "cpu:501, mem:64, objs:-/43@c26a5cf9", - " 91 call obj_from_u256_pieces(13085550501946799494, 17378197631620549853, 3196768798014081687, 3289270659235474020)": "", - " 92 ret obj_from_u256_pieces -> Ok(U256(obj#87))": "cpu:1002, mem:128, objs:-/44@f0931059", - " 93 call bls12_381_g1_mul(Bytes(obj#89), U256(obj#85))": "cpu:1812459, mem:384, objs:-/48@44a7f896", - " 94 ret bls12_381_g1_mul -> Ok(Bytes(obj#97))": "cpu:5102418, mem:448, objs:-/49@ad83c5a", + " 84 call vec_len(Vec(obj#81))": "cpu:1192959", + " 85 ret vec_len -> Ok(U32(3))": "cpu:1193081", + " 86 call vec_len(Vec(obj#83))": "cpu:3397037, mem:1584", + " 87 ret vec_len -> Ok(U32(3))": "cpu:3397159", + " 88 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:31992700, mem:223297", + " 89 call obj_from_u256_pieces(6129283836900174032, 16343279146958341100, 9908221645225222661, 8687387636374822629)": "cpu:0, mem:0", + " 90 ret obj_from_u256_pieces -> Ok(U256(obj#85))": "cpu:501, mem:64, objs:-/43@51ce4e80", + " 91 call obj_from_u256_pieces(8164028848054823783, 11448276494886701632, 11152981594053410458, 373243503504028211)": "", + " 92 ret obj_from_u256_pieces -> Ok(U256(obj#87))": "cpu:1002, mem:128, objs:-/44@1d526a4f", + " 93 call bls12_381_g1_mul(Bytes(obj#89), U256(obj#85))": "cpu:1815141, mem:1024, objs:-/48@1b0394df", + " 94 ret bls12_381_g1_mul -> Ok(Bytes(obj#97))": "cpu:5105788, mem:1200, objs:-/49@1c776a4c", " 95 call bls12_381_g1_mul(Bytes(obj#89), U256(obj#87))": "", - " 96 ret bls12_381_g1_mul -> Ok(Bytes(obj#99))": "cpu:8392377, mem:512, objs:-/50@d3c89f20", + " 96 ret bls12_381_g1_mul -> Ok(Bytes(obj#99))": "cpu:8396435, mem:1376, objs:-/50@3329b7ae", " 97 call bls12_381_g2_mul(Bytes(obj#93), U256(obj#85))": "", - " 98 ret bls12_381_g2_mul -> Ok(Bytes(obj#101))": "cpu:17439093, mem:576, objs:-/51@c0c63180", + " 98 ret bls12_381_g2_mul -> Ok(Bytes(obj#101))": "cpu:17444031, mem:1648, objs:-/51@68dc4508", " 99 call bls12_381_g2_mul(Bytes(obj#93), U256(obj#87))": "", - " 100 ret bls12_381_g2_mul -> Ok(Bytes(obj#103))": "cpu:26485809, mem:640, objs:-/52@9c3953d8", + " 100 ret bls12_381_g2_mul -> Ok(Bytes(obj#103))": "cpu:26491627, mem:1920, objs:-/52@9cf48a9c", " 101 call bls12_381_fr_mul(U256(obj#85), U256(obj#87))": "", - " 102 call obj_from_u256_pieces(4750815174022751756, 7309822028475974751, 2180935167318637354, 9686866465341438454)": "cpu:26491528, mem:888", - " 103 ret obj_from_u256_pieces -> Ok(U256(obj#105))": "cpu:26492029, mem:952, objs:-/53@ebd41d27", - " 104 ret bls12_381_fr_mul -> Ok(U256(obj#105))": "cpu:26492090", + " 102 call obj_from_u256_pieces(2142470011221189497, 10010429218490043362, 1572835870010363575, 4223291951915259218)": "cpu:26497346, mem:2168", + " 103 ret obj_from_u256_pieces -> Ok(U256(obj#105))": "cpu:26497847, mem:2232, objs:-/53@6b319212", + " 104 ret bls12_381_fr_mul -> Ok(U256(obj#105))": "cpu:26497908", " 105 call bls12_381_g1_mul(Bytes(obj#89), U256(obj#105))": "", - " 106 ret bls12_381_g1_mul -> Ok(Bytes(obj#107))": "cpu:29782049, mem:1016, objs:-/54@4a395f43", + " 106 ret bls12_381_g1_mul -> Ok(Bytes(obj#107))": "cpu:29788555, mem:2408, objs:-/54@3a87a2a8", " 107 call bls12_381_g2_mul(Bytes(obj#93), U256(obj#105))": "", - " 108 ret bls12_381_g2_mul -> Ok(Bytes(obj#109))": "cpu:38828765, mem:1080, objs:-/55@5c05cb46", + " 108 ret bls12_381_g2_mul -> Ok(Bytes(obj#109))": "cpu:38836151, mem:2680, objs:-/55@4537f126", " 109 call vec_new_from_slice(4)": "", - " 110 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:38829978, mem:1192, objs:-/56@4f9fb2c5", + " 110 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:38837364, mem:2792, objs:-/56@e347f8a8", " 111 call vec_new_from_slice(4)": "", - " 112 ret vec_new_from_slice -> Ok(Vec(obj#113))": "cpu:38831191, mem:1304, objs:-/57@3ebb42e5", + " 112 ret vec_new_from_slice -> Ok(Vec(obj#113))": "cpu:38838577, mem:2904, objs:-/57@cba81af", " 113 call bls12_381_multi_pairing_check(Vec(obj#111), Vec(obj#113))": "", - " 114 call vec_len(Vec(obj#111))": "cpu:38831435", - " 115 ret vec_len -> Ok(U32(4))": "cpu:38831557", - " 116 call vec_len(Vec(obj#113))": "cpu:41769428, mem:1704", - " 117 ret vec_len -> Ok(U32(4))": "cpu:41769550", - " 118 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:76375841, mem:296581", - " 119 end": "cpu:76375841, mem:296581, prngs:-/-, objs:-/57@3ebb42e5, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 114 call vec_len(Vec(obj#111))": "cpu:38838821", + " 115 ret vec_len -> Ok(U32(4))": "cpu:38838943", + " 116 call vec_len(Vec(obj#113))": "cpu:41777386, mem:3304", + " 117 ret vec_len -> Ok(U32(4))": "cpu:41777508", + " 118 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:76385043, mem:298181", + " 119 end": "cpu:76385043, mem:298181, prngs:-/-, objs:-/57@cba81af, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__dispatch_with_wrong_arg_type_bls12_381_fr_pow.json b/soroban-env-host/observations/22/test__dispatch__dispatch_with_wrong_arg_type_bls12_381_fr_pow.json index 614d940ca..081a869dd 100644 --- a/soroban-env-host/observations/22/test__dispatch__dispatch_with_wrong_arg_type_bls12_381_fr_pow.json +++ b/soroban-env-host/observations/22/test__dispatch__dispatch_with_wrong_arg_type_bls12_381_fr_pow.json @@ -1,189 +1,189 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@fb095c3d", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@ee2a8e42", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@d27f7217, store:-/1@f1e76490, foot:1@3fd2141b", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@c2e63cd", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@bd748587", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@7702446, store:-/1@44b28863, foot:1@e0562551", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@8a59423e", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@678ee693", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@bdfea37c, auth:1@c37da55/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@9446281f, auth:1@7c4deece/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@c37da55/1@5af4a012", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@23e9d1f2", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@5edc50dd, foot:2@a2add42c", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@5d17ae18", - " 14 push VM:a5b4867e:sym#13()": "cpu:587479, mem:734545, objs:-/8@89d46040, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ba99734c, auth:2@7e0661c/1@6bf36f94", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@7c4deece/1@df277b72", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@61b4d110", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@c2fce516, foot:2@41772cdd", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@57c1e830", + " 14 push VM:2b3f5537:sym#13()": "cpu:587479, mem:734545, objs:-/8@2400186a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c8503790, auth:2@d20a0cd1/1@b3979d65", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:a5b4867e:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@3f71cfad, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:591938, mem:734720, objs:-/10@f11ccb19", - " 22 push VM:a5b4867e:test(U256(123), Address(obj#123))": "cpu:756728, mem:897027, objs:-/11@2ded98ed, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a3dc7aff, auth:1@b1b428e/-", - " 23 call bls12_381_fr_pow(U256(123), bad:77)": "cpu:759841, mem:897114, objs:1@f40b9f61/11@2ded98ed, vm:-/-, stk:1@88e190e1", - " 24 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:760163, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:760785, mem:897130, objs:-/11@2ded98ed, vm:-/-, stk:-, auth:-/-", - " 26 call call(Address(obj#17), Symbol(test), Vec(obj#23))": "cpu:761225, mem:897194, objs:-/12@65ae004e", - " 27 push VM:a5b4867e:test(U256(123), False)": "cpu:926015, mem:1059501, objs:-/13@c880178f, vm:65536@b1cd98b9/2@2f94d90d, stk:1@9d1b0663, auth:1@73b1caf7/-", + " 19 pop VM:2b3f5537:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@3e3fd592, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:591938, mem:734720, objs:-/10@4400abd9", + " 22 push VM:2b3f5537:test(U256(123), Address(obj#123))": "cpu:756728, mem:897027, objs:-/11@7661d2, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1a0b9e40, auth:1@b1b428e/-", + " 23 call bls12_381_fr_pow(U256(123), bad:77)": "cpu:759841, mem:897114, objs:1@f40b9f61/11@7661d2, vm:-/-, stk:1@dfe6b788", + " 24 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:760163, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:760785, mem:897130, objs:-/11@7661d2, vm:-/-, stk:-, auth:-/-", + " 26 call call(Address(obj#17), Symbol(test), Vec(obj#23))": "cpu:761225, mem:897194, objs:-/12@a0b8adea", + " 27 push VM:2b3f5537:test(U256(123), False)": "cpu:926015, mem:1059501, objs:-/13@4791a26a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@5dbe5c59, auth:1@73b1caf7/-", " 28 call bls12_381_fr_pow(U256(123), bad:0)": "cpu:928693, mem:1059564, vm:-/-", - " 29 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:929015, vm:65536@b1cd98b9/2@2f94d90d", + " 29 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:929015, vm:65536@b1cd98b9/2@2f94d90d", " 30 ret call -> Err(Error(Value, InvalidInput))": "cpu:929637, mem:1059580, vm:-/-, stk:-, auth:-/-", - " 31 call call(Address(obj#17), Symbol(test), Vec(obj#27))": "cpu:930077, mem:1059644, objs:-/14@1ba45e4", - " 32 push VM:a5b4867e:test(U256(123), Bytes(obj#123))": "cpu:1094867, mem:1221951, objs:-/15@92ef810e, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4484f6f1, auth:1@3c3a4a50/-", - " 33 call bls12_381_fr_pow(U256(123), bad:72)": "cpu:1097980, mem:1222038, objs:1@1c4ba01b/15@92ef810e, vm:-/-, stk:1@121010ac", - " 34 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1098302, vm:65536@b1cd98b9/2@2f94d90d", - " 35 ret call -> Err(Error(Value, InvalidInput))": "cpu:1098924, mem:1222054, objs:-/15@92ef810e, vm:-/-, stk:-, auth:-/-", - " 36 call call(Address(obj#17), Symbol(test), Vec(obj#31))": "cpu:1099364, mem:1222118, objs:-/16@741b4666", - " 37 push VM:a5b4867e:test(U256(123), Duration(obj#123))": "cpu:1264154, mem:1384425, objs:-/17@8adf10e4, vm:65536@b1cd98b9/2@2f94d90d, stk:1@f4519e3a, auth:1@f34bc5d3/-", - " 38 call bls12_381_fr_pow(U256(123), bad:67)": "cpu:1267267, mem:1384512, objs:1@a2f54a81/17@8adf10e4, vm:-/-, stk:1@73ff384b", - " 39 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1267589, vm:65536@b1cd98b9/2@2f94d90d", - " 40 ret call -> Err(Error(Value, InvalidInput))": "cpu:1268211, mem:1384528, objs:-/17@8adf10e4, vm:-/-, stk:-, auth:-/-", - " 41 call call(Address(obj#17), Symbol(test), Vec(obj#35))": "cpu:1268651, mem:1384592, objs:-/18@deaac440", - " 42 push VM:a5b4867e:test(U256(123), Duration(123))": "cpu:1433441, mem:1546899, objs:-/19@7145bda7, vm:65536@b1cd98b9/2@2f94d90d, stk:1@cd5d9a20, auth:1@a916afbc/-", + " 31 call call(Address(obj#17), Symbol(test), Vec(obj#27))": "cpu:930077, mem:1059644, objs:-/14@250ecba4", + " 32 push VM:2b3f5537:test(U256(123), Bytes(obj#123))": "cpu:1094867, mem:1221951, objs:-/15@883288e0, vm:65536@b1cd98b9/2@2f94d90d, stk:1@f274f388, auth:1@3c3a4a50/-", + " 33 call bls12_381_fr_pow(U256(123), bad:72)": "cpu:1097980, mem:1222038, objs:1@1c4ba01b/15@883288e0, vm:-/-, stk:1@31650e05", + " 34 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:1098302, vm:65536@b1cd98b9/2@2f94d90d", + " 35 ret call -> Err(Error(Value, InvalidInput))": "cpu:1098924, mem:1222054, objs:-/15@883288e0, vm:-/-, stk:-, auth:-/-", + " 36 call call(Address(obj#17), Symbol(test), Vec(obj#31))": "cpu:1099364, mem:1222118, objs:-/16@8cdb93fd", + " 37 push VM:2b3f5537:test(U256(123), Duration(obj#123))": "cpu:1264154, mem:1384425, objs:-/17@cdd3bb89, vm:65536@b1cd98b9/2@2f94d90d, stk:1@9de7a9b1, auth:1@f34bc5d3/-", + " 38 call bls12_381_fr_pow(U256(123), bad:67)": "cpu:1267267, mem:1384512, objs:1@a2f54a81/17@cdd3bb89, vm:-/-, stk:1@9fd77637", + " 39 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:1267589, vm:65536@b1cd98b9/2@2f94d90d", + " 40 ret call -> Err(Error(Value, InvalidInput))": "cpu:1268211, mem:1384528, objs:-/17@cdd3bb89, vm:-/-, stk:-, auth:-/-", + " 41 call call(Address(obj#17), Symbol(test), Vec(obj#35))": "cpu:1268651, mem:1384592, objs:-/18@cd7698b", + " 42 push VM:2b3f5537:test(U256(123), Duration(123))": "cpu:1433441, mem:1546899, objs:-/19@c2f6d067, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c11c667c, auth:1@a916afbc/-", " 43 call bls12_381_fr_pow(U256(123), bad:31497)": "cpu:1436119, mem:1546962, vm:-/-", - " 44 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1436441, vm:65536@b1cd98b9/2@2f94d90d", + " 44 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:1436441, vm:65536@b1cd98b9/2@2f94d90d", " 45 ret call -> Err(Error(Value, InvalidInput))": "cpu:1437063, mem:1546978, vm:-/-, stk:-, auth:-/-", - " 46 call call(Address(obj#17), Symbol(test), Vec(obj#39))": "cpu:1437503, mem:1547042, objs:-/20@7ad3d0c6", - " 47 push VM:a5b4867e:test(U256(123), Duration(123))": "cpu:1602293, mem:1709349, objs:-/21@ebf976ab, vm:65536@b1cd98b9/2@2f94d90d, stk:1@cd5d9a20, auth:1@5fa62d7a/-", + " 46 call call(Address(obj#17), Symbol(test), Vec(obj#39))": "cpu:1437503, mem:1547042, objs:-/20@89006a7b", + " 47 push VM:2b3f5537:test(U256(123), Duration(123))": "cpu:1602293, mem:1709349, objs:-/21@c2069291, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c11c667c, auth:1@5fa62d7a/-", " 48 call bls12_381_fr_pow(U256(123), bad:31497)": "cpu:1604971, mem:1709412, vm:-/-", - " 49 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1605293, vm:65536@b1cd98b9/2@2f94d90d", + " 49 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:1605293, vm:65536@b1cd98b9/2@2f94d90d", " 50 ret call -> Err(Error(Value, InvalidInput))": "cpu:1605915, mem:1709428, vm:-/-, stk:-, auth:-/-", - " 51 call call(Address(obj#17), Symbol(test), Vec(obj#43))": "cpu:1606355, mem:1709492, objs:-/22@91ed713a", - " 52 push VM:a5b4867e:test(U256(123), Error(Context, ExceededLimit))": "cpu:1771145, mem:1871799, objs:-/23@cfdd9f21, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4a07b0a0, auth:1@50cfe0e0/-", + " 51 call call(Address(obj#17), Symbol(test), Vec(obj#43))": "cpu:1606355, mem:1709492, objs:-/22@e7871f55", + " 52 push VM:2b3f5537:test(U256(123), Error(Context, ExceededLimit))": "cpu:1771145, mem:1871799, objs:-/23@4bf4324a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@d7edf7a4, auth:1@50cfe0e0/-", " 53 call bls12_381_fr_pow(U256(123), bad:21474836995)": "cpu:1773823, mem:1871862, vm:-/-", - " 54 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1774145, vm:65536@b1cd98b9/2@2f94d90d", + " 54 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:1774145, vm:65536@b1cd98b9/2@2f94d90d", " 55 ret call -> Err(Error(Value, InvalidInput))": "cpu:1774767, mem:1871878, vm:-/-, stk:-, auth:-/-", - " 56 call call(Address(obj#17), Symbol(test), Vec(obj#47))": "cpu:1775207, mem:1871942, objs:-/24@f396aa15", - " 57 push VM:a5b4867e:test(U256(123), I128(obj#123))": "cpu:1939997, mem:2034249, objs:-/25@14c5c303, vm:65536@b1cd98b9/2@2f94d90d, stk:1@26169962, auth:1@30dfa4bc/-", - " 58 call bls12_381_fr_pow(U256(123), bad:69)": "cpu:1943110, mem:2034336, objs:1@5bb429fc/25@14c5c303, vm:-/-, stk:1@51626d3d", - " 59 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:1943432, vm:65536@b1cd98b9/2@2f94d90d", - " 60 ret call -> Err(Error(Value, InvalidInput))": "cpu:1944054, mem:2034352, objs:-/25@14c5c303, vm:-/-, stk:-, auth:-/-", - " 61 call call(Address(obj#17), Symbol(test), Vec(obj#51))": "cpu:1944494, mem:2034416, objs:-/26@8714080f", - " 62 push VM:a5b4867e:test(U256(123), I128(-123))": "cpu:2109284, mem:2196723, objs:-/27@ac556388, vm:65536@b1cd98b9/2@2f94d90d, stk:1@776b95f8, auth:1@a73502b2/-", + " 56 call call(Address(obj#17), Symbol(test), Vec(obj#47))": "cpu:1775207, mem:1871942, objs:-/24@6801d1c3", + " 57 push VM:2b3f5537:test(U256(123), I128(obj#123))": "cpu:1939997, mem:2034249, objs:-/25@99f9e52a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a22063f8, auth:1@30dfa4bc/-", + " 58 call bls12_381_fr_pow(U256(123), bad:69)": "cpu:1943110, mem:2034336, objs:1@5bb429fc/25@99f9e52a, vm:-/-, stk:1@6a08d9eb", + " 59 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:1943432, vm:65536@b1cd98b9/2@2f94d90d", + " 60 ret call -> Err(Error(Value, InvalidInput))": "cpu:1944054, mem:2034352, objs:-/25@99f9e52a, vm:-/-, stk:-, auth:-/-", + " 61 call call(Address(obj#17), Symbol(test), Vec(obj#51))": "cpu:1944494, mem:2034416, objs:-/26@520697eb", + " 62 push VM:2b3f5537:test(U256(123), I128(-123))": "cpu:2109284, mem:2196723, objs:-/27@711b10f, vm:65536@b1cd98b9/2@2f94d90d, stk:1@49db046f, auth:1@a73502b2/-", " 63 call bls12_381_fr_pow(U256(123), bad:-31477)": "cpu:2111962, mem:2196786, vm:-/-", - " 64 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2112284, vm:65536@b1cd98b9/2@2f94d90d", + " 64 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:2112284, vm:65536@b1cd98b9/2@2f94d90d", " 65 ret call -> Err(Error(Value, InvalidInput))": "cpu:2112906, mem:2196802, vm:-/-, stk:-, auth:-/-", - " 66 call call(Address(obj#17), Symbol(test), Vec(obj#55))": "cpu:2113346, mem:2196866, objs:-/28@f1af3638", - " 67 push VM:a5b4867e:test(U256(123), I128(-123))": "cpu:2278136, mem:2359173, objs:-/29@bcc2ea6e, vm:65536@b1cd98b9/2@2f94d90d, stk:1@776b95f8, auth:1@bff751bb/-", + " 66 call call(Address(obj#17), Symbol(test), Vec(obj#55))": "cpu:2113346, mem:2196866, objs:-/28@33a546b9", + " 67 push VM:2b3f5537:test(U256(123), I128(-123))": "cpu:2278136, mem:2359173, objs:-/29@756e4359, vm:65536@b1cd98b9/2@2f94d90d, stk:1@49db046f, auth:1@bff751bb/-", " 68 call bls12_381_fr_pow(U256(123), bad:-31477)": "cpu:2280814, mem:2359236, vm:-/-", - " 69 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2281136, vm:65536@b1cd98b9/2@2f94d90d", + " 69 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:2281136, vm:65536@b1cd98b9/2@2f94d90d", " 70 ret call -> Err(Error(Value, InvalidInput))": "cpu:2281758, mem:2359252, vm:-/-, stk:-, auth:-/-", - " 71 call call(Address(obj#17), Symbol(test), Vec(obj#59))": "cpu:2282198, mem:2359316, objs:-/30@e83a4bc8", - " 72 push VM:a5b4867e:test(U256(123), I256(obj#123))": "cpu:2446988, mem:2521623, objs:-/31@6fb56c91, vm:65536@b1cd98b9/2@2f94d90d, stk:1@da11e11b, auth:1@74ca8f1b/-", - " 73 call bls12_381_fr_pow(U256(123), bad:71)": "cpu:2450101, mem:2521710, objs:1@36f43d1e/31@6fb56c91, vm:-/-, stk:1@bdcc9593", - " 74 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2450423, vm:65536@b1cd98b9/2@2f94d90d", - " 75 ret call -> Err(Error(Value, InvalidInput))": "cpu:2451045, mem:2521726, objs:-/31@6fb56c91, vm:-/-, stk:-, auth:-/-", - " 76 call call(Address(obj#17), Symbol(test), Vec(obj#63))": "cpu:2451485, mem:2521790, objs:-/32@1daba901", - " 77 push VM:a5b4867e:test(U256(123), I256(-123))": "cpu:2616275, mem:2684097, objs:-/33@25c8348, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1fc2812e, auth:1@c74f2468/-", + " 71 call call(Address(obj#17), Symbol(test), Vec(obj#59))": "cpu:2282198, mem:2359316, objs:-/30@d49ec5dc", + " 72 push VM:2b3f5537:test(U256(123), I256(obj#123))": "cpu:2446988, mem:2521623, objs:-/31@d7c2ce5d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b6c61a89, auth:1@74ca8f1b/-", + " 73 call bls12_381_fr_pow(U256(123), bad:71)": "cpu:2450101, mem:2521710, objs:1@36f43d1e/31@d7c2ce5d, vm:-/-, stk:1@6e1c4765", + " 74 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:2450423, vm:65536@b1cd98b9/2@2f94d90d", + " 75 ret call -> Err(Error(Value, InvalidInput))": "cpu:2451045, mem:2521726, objs:-/31@d7c2ce5d, vm:-/-, stk:-, auth:-/-", + " 76 call call(Address(obj#17), Symbol(test), Vec(obj#63))": "cpu:2451485, mem:2521790, objs:-/32@59d78f9a", + " 77 push VM:2b3f5537:test(U256(123), I256(-123))": "cpu:2616275, mem:2684097, objs:-/33@f7a7bd20, vm:65536@b1cd98b9/2@2f94d90d, stk:1@22e68f45, auth:1@c74f2468/-", " 78 call bls12_381_fr_pow(U256(123), bad:-31475)": "cpu:2618953, mem:2684160, vm:-/-", - " 79 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2619275, vm:65536@b1cd98b9/2@2f94d90d", + " 79 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:2619275, vm:65536@b1cd98b9/2@2f94d90d", " 80 ret call -> Err(Error(Value, InvalidInput))": "cpu:2619897, mem:2684176, vm:-/-, stk:-, auth:-/-", - " 81 call call(Address(obj#17), Symbol(test), Vec(obj#67))": "cpu:2620337, mem:2684240, objs:-/34@b22324b", - " 82 push VM:a5b4867e:test(U256(123), I256(-123))": "cpu:2785127, mem:2846547, objs:-/35@976700fd, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1fc2812e, auth:1@f20baebf/-", + " 81 call call(Address(obj#17), Symbol(test), Vec(obj#67))": "cpu:2620337, mem:2684240, objs:-/34@41d07a6a", + " 82 push VM:2b3f5537:test(U256(123), I256(-123))": "cpu:2785127, mem:2846547, objs:-/35@be476162, vm:65536@b1cd98b9/2@2f94d90d, stk:1@22e68f45, auth:1@f20baebf/-", " 83 call bls12_381_fr_pow(U256(123), bad:-31475)": "cpu:2787805, mem:2846610, vm:-/-", - " 84 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2788127, vm:65536@b1cd98b9/2@2f94d90d", + " 84 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:2788127, vm:65536@b1cd98b9/2@2f94d90d", " 85 ret call -> Err(Error(Value, InvalidInput))": "cpu:2788749, mem:2846626, vm:-/-, stk:-, auth:-/-", - " 86 call call(Address(obj#17), Symbol(test), Vec(obj#71))": "cpu:2789189, mem:2846690, objs:-/36@f8613f75", - " 87 push VM:a5b4867e:test(U256(123), I32(-123))": "cpu:2953979, mem:3008997, objs:-/37@65b641c4, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b36a0d6c, auth:1@1cd815b8/-", + " 86 call call(Address(obj#17), Symbol(test), Vec(obj#71))": "cpu:2789189, mem:2846690, objs:-/36@c6bed2ae", + " 87 push VM:2b3f5537:test(U256(123), I32(-123))": "cpu:2953979, mem:3008997, objs:-/37@57dd2ebf, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4a917a6c, auth:1@1cd815b8/-", " 88 call bls12_381_fr_pow(U256(123), bad:-528280977403)": "cpu:2956657, mem:3009060, vm:-/-", - " 89 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:2956979, vm:65536@b1cd98b9/2@2f94d90d", + " 89 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:2956979, vm:65536@b1cd98b9/2@2f94d90d", " 90 ret call -> Err(Error(Value, InvalidInput))": "cpu:2957601, mem:3009076, vm:-/-, stk:-, auth:-/-", - " 91 call call(Address(obj#17), Symbol(test), Vec(obj#75))": "cpu:2958041, mem:3009140, objs:-/38@7cef7ff8", - " 92 push VM:a5b4867e:test(U256(123), I64(obj#123))": "cpu:3122831, mem:3171447, objs:-/39@579fa5f5, vm:65536@b1cd98b9/2@2f94d90d, stk:1@24a8a8e, auth:1@cf8ac60a/-", - " 93 call bls12_381_fr_pow(U256(123), bad:65)": "cpu:3125944, mem:3171534, objs:1@bc2f994b/39@579fa5f5, vm:-/-, stk:1@61f2dd31", - " 94 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3126266, vm:65536@b1cd98b9/2@2f94d90d", - " 95 ret call -> Err(Error(Value, InvalidInput))": "cpu:3126888, mem:3171550, objs:-/39@579fa5f5, vm:-/-, stk:-, auth:-/-", - " 96 call call(Address(obj#17), Symbol(test), Vec(obj#79))": "cpu:3127328, mem:3171614, objs:-/40@9f09fd17", - " 97 push VM:a5b4867e:test(U256(123), I64(-123))": "cpu:3292118, mem:3333921, objs:-/41@47072d35, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1520a6fa, auth:1@17f50ed3/-", + " 91 call call(Address(obj#17), Symbol(test), Vec(obj#75))": "cpu:2958041, mem:3009140, objs:-/38@232a4bf2", + " 92 push VM:2b3f5537:test(U256(123), I64(obj#123))": "cpu:3122831, mem:3171447, objs:-/39@f5d59d64, vm:65536@b1cd98b9/2@2f94d90d, stk:1@20216330, auth:1@cf8ac60a/-", + " 93 call bls12_381_fr_pow(U256(123), bad:65)": "cpu:3125944, mem:3171534, objs:1@bc2f994b/39@f5d59d64, vm:-/-, stk:1@102b9221", + " 94 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:3126266, vm:65536@b1cd98b9/2@2f94d90d", + " 95 ret call -> Err(Error(Value, InvalidInput))": "cpu:3126888, mem:3171550, objs:-/39@f5d59d64, vm:-/-, stk:-, auth:-/-", + " 96 call call(Address(obj#17), Symbol(test), Vec(obj#79))": "cpu:3127328, mem:3171614, objs:-/40@8a49bbb9", + " 97 push VM:2b3f5537:test(U256(123), I64(-123))": "cpu:3292118, mem:3333921, objs:-/41@4e04f6f7, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ea29419b, auth:1@17f50ed3/-", " 98 call bls12_381_fr_pow(U256(123), bad:-31481)": "cpu:3294796, mem:3333984, vm:-/-", - " 99 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3295118, vm:65536@b1cd98b9/2@2f94d90d", + " 99 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:3295118, vm:65536@b1cd98b9/2@2f94d90d", " 100 ret call -> Err(Error(Value, InvalidInput))": "cpu:3295740, mem:3334000, vm:-/-, stk:-, auth:-/-", - " 101 call call(Address(obj#17), Symbol(test), Vec(obj#83))": "cpu:3296180, mem:3334064, objs:-/42@b35d8736", - " 102 push VM:a5b4867e:test(U256(123), Map(obj#123))": "cpu:3460970, mem:3496371, objs:-/43@aba1ec0d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@712e0c7, auth:1@9cadbca8/-", - " 103 call bls12_381_fr_pow(U256(123), bad:76)": "cpu:3464083, mem:3496458, objs:1@a940116a/43@aba1ec0d, vm:-/-, stk:1@6b49da62", - " 104 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3464405, vm:65536@b1cd98b9/2@2f94d90d", - " 105 ret call -> Err(Error(Value, InvalidInput))": "cpu:3465027, mem:3496474, objs:-/43@aba1ec0d, vm:-/-, stk:-, auth:-/-", - " 106 call call(Address(obj#17), Symbol(test), Vec(obj#87))": "cpu:3465467, mem:3496538, objs:-/44@fbeeb1fe", - " 107 push VM:a5b4867e:test(U256(123), String(obj#123))": "cpu:3630257, mem:3658845, objs:-/45@98c4ecf, vm:65536@b1cd98b9/2@2f94d90d, stk:1@2e1c5d65, auth:1@bc972186/-", - " 108 call bls12_381_fr_pow(U256(123), bad:73)": "cpu:3633370, mem:3658932, objs:1@a1dcd3f9/45@98c4ecf, vm:-/-, stk:1@2cbc7858", - " 109 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3633692, vm:65536@b1cd98b9/2@2f94d90d", - " 110 ret call -> Err(Error(Value, InvalidInput))": "cpu:3634314, mem:3658948, objs:-/45@98c4ecf, vm:-/-, stk:-, auth:-/-", - " 111 call call(Address(obj#17), Symbol(test), Vec(obj#91))": "cpu:3634754, mem:3659012, objs:-/46@938025b0", - " 112 push VM:a5b4867e:test(U256(123), Symbol(abc))": "cpu:3799544, mem:3821319, objs:-/47@481652e8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@570d7824, auth:1@430af039/-", + " 101 call call(Address(obj#17), Symbol(test), Vec(obj#83))": "cpu:3296180, mem:3334064, objs:-/42@ee967d38", + " 102 push VM:2b3f5537:test(U256(123), Map(obj#123))": "cpu:3460970, mem:3496371, objs:-/43@48b070a8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@471f75c, auth:1@9cadbca8/-", + " 103 call bls12_381_fr_pow(U256(123), bad:76)": "cpu:3464083, mem:3496458, objs:1@a940116a/43@48b070a8, vm:-/-, stk:1@949c7975", + " 104 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:3464405, vm:65536@b1cd98b9/2@2f94d90d", + " 105 ret call -> Err(Error(Value, InvalidInput))": "cpu:3465027, mem:3496474, objs:-/43@48b070a8, vm:-/-, stk:-, auth:-/-", + " 106 call call(Address(obj#17), Symbol(test), Vec(obj#87))": "cpu:3465467, mem:3496538, objs:-/44@b849daf6", + " 107 push VM:2b3f5537:test(U256(123), String(obj#123))": "cpu:3630257, mem:3658845, objs:-/45@348aa235, vm:65536@b1cd98b9/2@2f94d90d, stk:1@e27164f6, auth:1@bc972186/-", + " 108 call bls12_381_fr_pow(U256(123), bad:73)": "cpu:3633370, mem:3658932, objs:1@a1dcd3f9/45@348aa235, vm:-/-, stk:1@3fcb7902", + " 109 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:3633692, vm:65536@b1cd98b9/2@2f94d90d", + " 110 ret call -> Err(Error(Value, InvalidInput))": "cpu:3634314, mem:3658948, objs:-/45@348aa235, vm:-/-, stk:-, auth:-/-", + " 111 call call(Address(obj#17), Symbol(test), Vec(obj#91))": "cpu:3634754, mem:3659012, objs:-/46@bed06ad4", + " 112 push VM:2b3f5537:test(U256(123), Symbol(abc))": "cpu:3799544, mem:3821319, objs:-/47@27195197, vm:65536@b1cd98b9/2@2f94d90d, stk:1@e531bddc, auth:1@430af039/-", " 113 call bls12_381_fr_pow(U256(123), bad:40495118)": "cpu:3802222, mem:3821382, vm:-/-", - " 114 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3802544, vm:65536@b1cd98b9/2@2f94d90d", + " 114 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:3802544, vm:65536@b1cd98b9/2@2f94d90d", " 115 ret call -> Err(Error(Value, InvalidInput))": "cpu:3803166, mem:3821398, vm:-/-, stk:-, auth:-/-", - " 116 call call(Address(obj#17), Symbol(test), Vec(obj#95))": "cpu:3803606, mem:3821462, objs:-/48@afa55aba", - " 117 push VM:a5b4867e:test(U256(123), Symbol(obj#123))": "cpu:3968396, mem:3983769, objs:-/49@36127b2d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@6471f37, auth:1@1824f0f4/-", - " 118 call bls12_381_fr_pow(U256(123), bad:74)": "cpu:3971509, mem:3983856, objs:1@d6584255/49@36127b2d, vm:-/-, stk:1@1a6baee5", - " 119 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:3971831, vm:65536@b1cd98b9/2@2f94d90d", - " 120 ret call -> Err(Error(Value, InvalidInput))": "cpu:3972453, mem:3983872, objs:-/49@36127b2d, vm:-/-, stk:-, auth:-/-", - " 121 call call(Address(obj#17), Symbol(test), Vec(obj#99))": "cpu:3972893, mem:3983936, objs:-/50@a514c02c", - " 122 push VM:a5b4867e:test(U256(123), Symbol(abc))": "cpu:4137683, mem:4146243, objs:-/51@7160a4b8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@570d7824, auth:1@47dc6783/-", + " 116 call call(Address(obj#17), Symbol(test), Vec(obj#95))": "cpu:3803606, mem:3821462, objs:-/48@337e4fe2", + " 117 push VM:2b3f5537:test(U256(123), Symbol(obj#123))": "cpu:3968396, mem:3983769, objs:-/49@f6ce0231, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ba78416b, auth:1@1824f0f4/-", + " 118 call bls12_381_fr_pow(U256(123), bad:74)": "cpu:3971509, mem:3983856, objs:1@d6584255/49@f6ce0231, vm:-/-, stk:1@3864bd0d", + " 119 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:3971831, vm:65536@b1cd98b9/2@2f94d90d", + " 120 ret call -> Err(Error(Value, InvalidInput))": "cpu:3972453, mem:3983872, objs:-/49@f6ce0231, vm:-/-, stk:-, auth:-/-", + " 121 call call(Address(obj#17), Symbol(test), Vec(obj#99))": "cpu:3972893, mem:3983936, objs:-/50@7200113f", + " 122 push VM:2b3f5537:test(U256(123), Symbol(abc))": "cpu:4137683, mem:4146243, objs:-/51@1ba7f57, vm:65536@b1cd98b9/2@2f94d90d, stk:1@e531bddc, auth:1@47dc6783/-", " 123 call bls12_381_fr_pow(U256(123), bad:40495118)": "cpu:4140361, mem:4146306, vm:-/-", - " 124 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4140683, vm:65536@b1cd98b9/2@2f94d90d", + " 124 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:4140683, vm:65536@b1cd98b9/2@2f94d90d", " 125 ret call -> Err(Error(Value, InvalidInput))": "cpu:4141305, mem:4146322, vm:-/-, stk:-, auth:-/-", - " 126 call call(Address(obj#17), Symbol(test), Vec(obj#103))": "cpu:4141745, mem:4146386, objs:-/52@3a73e176", - " 127 push VM:a5b4867e:test(U256(123), Timepoint(obj#123))": "cpu:4306535, mem:4308693, objs:-/53@9082beea, vm:65536@b1cd98b9/2@2f94d90d, stk:1@49fd24f5, auth:1@5559c1ca/-", - " 128 call bls12_381_fr_pow(U256(123), bad:66)": "cpu:4309648, mem:4308780, objs:1@710f8d02/53@9082beea, vm:-/-, stk:1@b709543", - " 129 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4309970, vm:65536@b1cd98b9/2@2f94d90d", - " 130 ret call -> Err(Error(Value, InvalidInput))": "cpu:4310592, mem:4308796, objs:-/53@9082beea, vm:-/-, stk:-, auth:-/-", - " 131 call call(Address(obj#17), Symbol(test), Vec(obj#107))": "cpu:4311032, mem:4308860, objs:-/54@f134d9ee", - " 132 push VM:a5b4867e:test(U256(123), Timepoint(123))": "cpu:4475822, mem:4471167, objs:-/55@11ce7ad6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@84a5969e, auth:1@d0636f0/-", + " 126 call call(Address(obj#17), Symbol(test), Vec(obj#103))": "cpu:4141745, mem:4146386, objs:-/52@59fd2b41", + " 127 push VM:2b3f5537:test(U256(123), Timepoint(obj#123))": "cpu:4306535, mem:4308693, objs:-/53@5311e197, vm:65536@b1cd98b9/2@2f94d90d, stk:1@fdaa7236, auth:1@5559c1ca/-", + " 128 call bls12_381_fr_pow(U256(123), bad:66)": "cpu:4309648, mem:4308780, objs:1@710f8d02/53@5311e197, vm:-/-, stk:1@2efa2512", + " 129 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:4309970, vm:65536@b1cd98b9/2@2f94d90d", + " 130 ret call -> Err(Error(Value, InvalidInput))": "cpu:4310592, mem:4308796, objs:-/53@5311e197, vm:-/-, stk:-, auth:-/-", + " 131 call call(Address(obj#17), Symbol(test), Vec(obj#107))": "cpu:4311032, mem:4308860, objs:-/54@ef0c1bd5", + " 132 push VM:2b3f5537:test(U256(123), Timepoint(123))": "cpu:4475822, mem:4471167, objs:-/55@fb738caa, vm:65536@b1cd98b9/2@2f94d90d, stk:1@e84e9fdd, auth:1@d0636f0/-", " 133 call bls12_381_fr_pow(U256(123), bad:31496)": "cpu:4478500, mem:4471230, vm:-/-", - " 134 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4478822, vm:65536@b1cd98b9/2@2f94d90d", + " 134 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:4478822, vm:65536@b1cd98b9/2@2f94d90d", " 135 ret call -> Err(Error(Value, InvalidInput))": "cpu:4479444, mem:4471246, vm:-/-, stk:-, auth:-/-", - " 136 call call(Address(obj#17), Symbol(test), Vec(obj#111))": "cpu:4479884, mem:4471310, objs:-/56@14d4d807", - " 137 push VM:a5b4867e:test(U256(123), Timepoint(123))": "cpu:4644674, mem:4633617, objs:-/57@ecc28d6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@84a5969e, auth:1@c8a5df3/-", + " 136 call call(Address(obj#17), Symbol(test), Vec(obj#111))": "cpu:4479884, mem:4471310, objs:-/56@d701bbc1", + " 137 push VM:2b3f5537:test(U256(123), Timepoint(123))": "cpu:4644674, mem:4633617, objs:-/57@36ea7849, vm:65536@b1cd98b9/2@2f94d90d, stk:1@e84e9fdd, auth:1@c8a5df3/-", " 138 call bls12_381_fr_pow(U256(123), bad:31496)": "cpu:4647352, mem:4633680, vm:-/-", - " 139 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4647674, vm:65536@b1cd98b9/2@2f94d90d", + " 139 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:4647674, vm:65536@b1cd98b9/2@2f94d90d", " 140 ret call -> Err(Error(Value, InvalidInput))": "cpu:4648296, mem:4633696, vm:-/-, stk:-, auth:-/-", - " 141 call call(Address(obj#17), Symbol(test), Vec(obj#115))": "cpu:4648736, mem:4633760, objs:-/58@8cc8c3b5", - " 142 push VM:a5b4867e:test(U256(123), U128(obj#123))": "cpu:4813526, mem:4796067, objs:-/59@a1906fb1, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b89c8d19, auth:1@4f3765d6/-", - " 143 call bls12_381_fr_pow(U256(123), bad:68)": "cpu:4816639, mem:4796154, objs:1@32400498/59@a1906fb1, vm:-/-, stk:1@70f54d2b", - " 144 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4816961, vm:65536@b1cd98b9/2@2f94d90d", - " 145 ret call -> Err(Error(Value, InvalidInput))": "cpu:4817583, mem:4796170, objs:-/59@a1906fb1, vm:-/-, stk:-, auth:-/-", - " 146 call call(Address(obj#17), Symbol(test), Vec(obj#119))": "cpu:4818023, mem:4796234, objs:-/60@222f4855", - " 147 push VM:a5b4867e:test(U256(123), U128(123))": "cpu:4982813, mem:4958541, objs:-/61@41f77d22, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1e3b5f8a, auth:1@1ed43931/-", + " 141 call call(Address(obj#17), Symbol(test), Vec(obj#115))": "cpu:4648736, mem:4633760, objs:-/58@ef16c667", + " 142 push VM:2b3f5537:test(U256(123), U128(obj#123))": "cpu:4813526, mem:4796067, objs:-/59@37b69653, vm:65536@b1cd98b9/2@2f94d90d, stk:1@2a4acbc7, auth:1@4f3765d6/-", + " 143 call bls12_381_fr_pow(U256(123), bad:68)": "cpu:4816639, mem:4796154, objs:1@32400498/59@37b69653, vm:-/-, stk:1@3984fbaa", + " 144 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:4816961, vm:65536@b1cd98b9/2@2f94d90d", + " 145 ret call -> Err(Error(Value, InvalidInput))": "cpu:4817583, mem:4796170, objs:-/59@37b69653, vm:-/-, stk:-, auth:-/-", + " 146 call call(Address(obj#17), Symbol(test), Vec(obj#119))": "cpu:4818023, mem:4796234, objs:-/60@5afd1883", + " 147 push VM:2b3f5537:test(U256(123), U128(123))": "cpu:4982813, mem:4958541, objs:-/61@69f3a359, vm:65536@b1cd98b9/2@2f94d90d, stk:1@bbbf2874, auth:1@1ed43931/-", " 148 call bls12_381_fr_pow(U256(123), bad:31498)": "cpu:4985491, mem:4958604, vm:-/-", - " 149 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:4985813, vm:65536@b1cd98b9/2@2f94d90d", + " 149 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:4985813, vm:65536@b1cd98b9/2@2f94d90d", " 150 ret call -> Err(Error(Value, InvalidInput))": "cpu:4986435, mem:4958620, vm:-/-, stk:-, auth:-/-", - " 151 call call(Address(obj#17), Symbol(test), Vec(obj#123))": "cpu:4986875, mem:4958684, objs:-/62@22bd31c", - " 152 push VM:a5b4867e:test(U256(123), U128(123))": "cpu:5151665, mem:5120991, objs:-/63@18d14c72, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1e3b5f8a, auth:1@4289d549/-", + " 151 call call(Address(obj#17), Symbol(test), Vec(obj#123))": "cpu:4986875, mem:4958684, objs:-/62@9da94a32", + " 152 push VM:2b3f5537:test(U256(123), U128(123))": "cpu:5151665, mem:5120991, objs:-/63@5613a95b, vm:65536@b1cd98b9/2@2f94d90d, stk:1@bbbf2874, auth:1@4289d549/-", " 153 call bls12_381_fr_pow(U256(123), bad:31498)": "cpu:5154343, mem:5121054, vm:-/-", - " 154 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5154665, vm:65536@b1cd98b9/2@2f94d90d", + " 154 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:5154665, vm:65536@b1cd98b9/2@2f94d90d", " 155 ret call -> Err(Error(Value, InvalidInput))": "cpu:5155287, mem:5121070, vm:-/-, stk:-, auth:-/-", - " 156 call call(Address(obj#17), Symbol(test), Vec(obj#127))": "cpu:5155727, mem:5121134, objs:-/64@b9a50d26", - " 157 push VM:a5b4867e:test(U256(123), U256(obj#123))": "cpu:5320517, mem:5283441, objs:-/65@cca50f76, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c72b6210, auth:1@b1b6c254/-", - " 158 call bls12_381_fr_pow(U256(123), bad:70)": "cpu:5323630, mem:5283528, objs:1@7546caa9/65@cca50f76, vm:-/-, stk:1@f3d8b9a6", - " 159 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5323952, vm:65536@b1cd98b9/2@2f94d90d", - " 160 ret call -> Err(Error(Value, InvalidInput))": "cpu:5324574, mem:5283544, objs:-/65@cca50f76, vm:-/-, stk:-, auth:-/-", - " 161 call call(Address(obj#17), Symbol(test), Vec(obj#131))": "cpu:5325014, mem:5283608, objs:-/66@fd4b8356", - " 162 push VM:a5b4867e:test(U256(123), U256(123))": "cpu:5489804, mem:5445915, objs:-/67@d0bc126a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ef5d6a43, auth:1@7b356395/-", + " 156 call call(Address(obj#17), Symbol(test), Vec(obj#127))": "cpu:5155727, mem:5121134, objs:-/64@fb92f288", + " 157 push VM:2b3f5537:test(U256(123), U256(obj#123))": "cpu:5320517, mem:5283441, objs:-/65@53050d38, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c11e4e96, auth:1@b1b6c254/-", + " 158 call bls12_381_fr_pow(U256(123), bad:70)": "cpu:5323630, mem:5283528, objs:1@7546caa9/65@53050d38, vm:-/-, stk:1@19276129", + " 159 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:5323952, vm:65536@b1cd98b9/2@2f94d90d", + " 160 ret call -> Err(Error(Value, InvalidInput))": "cpu:5324574, mem:5283544, objs:-/65@53050d38, vm:-/-, stk:-, auth:-/-", + " 161 call call(Address(obj#17), Symbol(test), Vec(obj#131))": "cpu:5325014, mem:5283608, objs:-/66@58173391", + " 162 push VM:2b3f5537:test(U256(123), U256(123))": "cpu:5489804, mem:5445915, objs:-/67@adf71efa, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c20bce88, auth:1@7b356395/-", " 163 call bls12_381_fr_pow(U256(123), bad:31500)": "cpu:5492482, mem:5445978, vm:-/-", - " 164 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5492804, vm:65536@b1cd98b9/2@2f94d90d", + " 164 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:5492804, vm:65536@b1cd98b9/2@2f94d90d", " 165 ret call -> Err(Error(Value, InvalidInput))": "cpu:5493426, mem:5445994, vm:-/-, stk:-, auth:-/-", - " 166 call call(Address(obj#17), Symbol(test), Vec(obj#135))": "cpu:5493866, mem:5446058, objs:-/68@328ec80f", - " 167 push VM:a5b4867e:test(U256(123), U256(123))": "cpu:5658656, mem:5608365, objs:-/69@2f915a1f, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ef5d6a43, auth:1@a0a66d73/-", + " 166 call call(Address(obj#17), Symbol(test), Vec(obj#135))": "cpu:5493866, mem:5446058, objs:-/68@7de1ddef", + " 167 push VM:2b3f5537:test(U256(123), U256(123))": "cpu:5658656, mem:5608365, objs:-/69@4c535481, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c20bce88, auth:1@a0a66d73/-", " 168 call bls12_381_fr_pow(U256(123), bad:31500)": "cpu:5661334, mem:5608428, vm:-/-", - " 169 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5661656, vm:65536@b1cd98b9/2@2f94d90d", + " 169 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:5661656, vm:65536@b1cd98b9/2@2f94d90d", " 170 ret call -> Err(Error(Value, InvalidInput))": "cpu:5662278, mem:5608444, vm:-/-, stk:-, auth:-/-", - " 171 call call(Address(obj#17), Symbol(test), Vec(obj#139))": "cpu:5662718, mem:5608508, objs:-/70@8c38e98c", - " 172 push VM:a5b4867e:test(U256(123), U32(123))": "cpu:5827508, mem:5770815, objs:-/71@4c23c09a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@55e76d50, auth:1@4ffc0bd9/-", + " 171 call call(Address(obj#17), Symbol(test), Vec(obj#139))": "cpu:5662718, mem:5608508, objs:-/70@b4daaa89", + " 172 push VM:2b3f5537:test(U256(123), U32(123))": "cpu:5827508, mem:5770815, objs:-/71@923921e4, vm:65536@b1cd98b9/2@2f94d90d, stk:1@11a4d572, auth:1@4ffc0bd9/-", " 173 call bls12_381_fr_pow(U256(123), bad:528280977412)": "cpu:5830186, mem:5770878, vm:-/-", - " 174 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5830508, vm:65536@b1cd98b9/2@2f94d90d", + " 174 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:5830508, vm:65536@b1cd98b9/2@2f94d90d", " 175 ret call -> Err(Error(Value, InvalidInput))": "cpu:5831130, mem:5770894, vm:-/-, stk:-, auth:-/-", - " 176 call call(Address(obj#17), Symbol(test), Vec(obj#143))": "cpu:5831570, mem:5770958, objs:-/72@ffa26da7", - " 177 push VM:a5b4867e:test(U256(123), Vec(obj#123))": "cpu:5996360, mem:5933265, objs:-/73@bdc154e2, vm:65536@b1cd98b9/2@2f94d90d, stk:1@24b07b7, auth:1@3426acce/-", - " 178 call bls12_381_fr_pow(U256(123), bad:75)": "cpu:5999473, mem:5933352, objs:1@2f6908f/73@bdc154e2, vm:-/-, stk:1@8ace47ba", - " 179 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:5999795, vm:65536@b1cd98b9/2@2f94d90d", - " 180 ret call -> Err(Error(Value, InvalidInput))": "cpu:6000417, mem:5933368, objs:-/73@bdc154e2, vm:-/-, stk:-, auth:-/-", - " 181 call call(Address(obj#17), Symbol(test), Vec(obj#147))": "cpu:6000857, mem:5933432, objs:-/74@6061ee11", - " 182 push VM:a5b4867e:test(U256(123), Void)": "cpu:6165647, mem:6095739, objs:-/75@19bfbfdb, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a631b1f2, auth:1@be16596e/-", + " 176 call call(Address(obj#17), Symbol(test), Vec(obj#143))": "cpu:5831570, mem:5770958, objs:-/72@ed493e2b", + " 177 push VM:2b3f5537:test(U256(123), Vec(obj#123))": "cpu:5996360, mem:5933265, objs:-/73@7b5ee398, vm:65536@b1cd98b9/2@2f94d90d, stk:1@e7192f77, auth:1@3426acce/-", + " 178 call bls12_381_fr_pow(U256(123), bad:75)": "cpu:5999473, mem:5933352, objs:1@2f6908f/73@7b5ee398, vm:-/-, stk:1@647fd49b", + " 179 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:5999795, vm:65536@b1cd98b9/2@2f94d90d", + " 180 ret call -> Err(Error(Value, InvalidInput))": "cpu:6000417, mem:5933368, objs:-/73@7b5ee398, vm:-/-, stk:-, auth:-/-", + " 181 call call(Address(obj#17), Symbol(test), Vec(obj#147))": "cpu:6000857, mem:5933432, objs:-/74@6b281dc8", + " 182 push VM:2b3f5537:test(U256(123), Void)": "cpu:6165647, mem:6095739, objs:-/75@a85e5140, vm:65536@b1cd98b9/2@2f94d90d, stk:1@7fd66ee6, auth:1@be16596e/-", " 183 call bls12_381_fr_pow(U256(123), bad:2)": "cpu:6168325, mem:6095802, vm:-/-", - " 184 pop VM:a5b4867e:test -> Err(Error(Value, InvalidInput))": "cpu:6168647, vm:65536@b1cd98b9/2@2f94d90d", + " 184 pop VM:2b3f5537:test -> Err(Error(Value, InvalidInput))": "cpu:6168647, vm:65536@b1cd98b9/2@2f94d90d", " 185 ret call -> Err(Error(Value, InvalidInput))": "cpu:6169269, mem:6095818, vm:-/-, stk:-, auth:-/-", - " 186 end": "cpu:6169269, mem:6095818, prngs:-/9b4a753, objs:-/75@19bfbfdb, vm:-/-, evt:-, store:-/2@5edc50dd, foot:2@a2add42c, stk:-, auth:-/-" + " 186 end": "cpu:6169269, mem:6095818, prngs:-/9b4a753, objs:-/75@a85e5140, vm:-/-, evt:-, store:-/2@c2fce516, foot:2@41772cdd, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_check_g1_is_in_subgroup_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_check_g1_is_in_subgroup_arg_0.json new file mode 100644 index 000000000..7597b03c9 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_check_g1_is_in_subgroup_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(119)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1036, mem:199, objs:-/1@c9f770fe", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:238338, mem:407206, objs:-/2@bf0b985, store:-/1@838925c0, foot:1@768940e3", + " 5 call bytes_new_from_slice(32)": "cpu:238778, mem:407270, objs:-/3@675c9cba", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:239747, mem:407382, objs:-/4@ad707131", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:242358, mem:407622, objs:-/5@f8f1bd6e, auth:1@2412f106/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:242650", + " 10 call get_ledger_network_id()": "cpu:242700, auth:1@2412f106/1@a72ea64a", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:243730, mem:407734, objs:-/6@b5967da4", + " 12 call symbol_new_from_slice(13)": "cpu:420583, mem:572038, store:-/2@2382484e, foot:2@ed17da78", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:421591, mem:572131, objs:-/7@2fa8e06f", + " 14 push VM:74178e74:sym#13()": "cpu:584594, mem:734257, objs:-/8@b9e5d36d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c3298655, auth:2@a192784a/1@3070549e", + " 15 call symbol_len(Symbol(obj#13))": "cpu:587264, mem:734288", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:587386", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:587490", + " 19 pop VM:74178e74:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:588613, mem:734368, objs:-/9@f8d3daa5, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:589053, mem:734432, objs:-/10@f5cdca2d", + " 22 push VM:74178e74:test(Bytes(obj#123))": "cpu:753837, mem:896718, objs:-/11@b932628a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@de4255ce, auth:1@b1b428e/-", + " 23 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#123))": "cpu:756946, mem:896789, objs:1@1c4ba01b/11@b932628a, vm:-/-, stk:1@e6e04471", + " 24 pop VM:74178e74:test -> Err(Error(Value, InvalidInput))": "cpu:757329, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:757951, mem:896805, objs:-/11@b932628a, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:757951, mem:896805, prngs:-/9b4a753, objs:-/11@b932628a, vm:-/-, evt:-, store:-/2@2382484e, foot:2@ed17da78, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_check_g2_is_in_subgroup_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_check_g2_is_in_subgroup_arg_0.json new file mode 100644 index 000000000..92e174363 --- /dev/null +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_check_g2_is_in_subgroup_arg_0.json @@ -0,0 +1,29 @@ +{ + " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call bytes_new_from_slice(119)": "cpu:47", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1036, mem:199, objs:-/1@d546ce6a", + " 3 call upload_wasm(Bytes(obj#1))": "", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:238338, mem:407206, objs:-/2@3cb426b8, store:-/1@d4d1a697, foot:1@49975f0c", + " 5 call bytes_new_from_slice(32)": "cpu:238778, mem:407270, objs:-/3@c92ad0f3", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:239747, mem:407382, objs:-/4@1677f9a0", + " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:242358, mem:407622, objs:-/5@e71e7d65, auth:1@d47c12f4/-", + " 9 ret obj_cmp -> Ok(0)": "cpu:242650", + " 10 call get_ledger_network_id()": "cpu:242700, auth:1@d47c12f4/1@a56cfc68", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:243730, mem:407734, objs:-/6@bd5fc117", + " 12 call symbol_new_from_slice(13)": "cpu:420583, mem:572038, store:-/2@34b5472, foot:2@eabf0af1", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:421591, mem:572131, objs:-/7@9fde93ce", + " 14 push VM:e40d19d0:sym#13()": "cpu:584594, mem:734257, objs:-/8@7fb4019d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@81d4373c, auth:2@d137dd4d/1@e2f2ee2e", + " 15 call symbol_len(Symbol(obj#13))": "cpu:587264, mem:734288", + " 16 ret symbol_len -> Ok(U32(13))": "cpu:587386", + " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", + " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:587490", + " 19 pop VM:e40d19d0:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:588613, mem:734368, objs:-/9@b5be1093, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:589053, mem:734432, objs:-/10@3259d82c", + " 22 push VM:e40d19d0:test(Bytes(obj#123))": "cpu:753837, mem:896718, objs:-/11@e7e2a007, vm:65536@b1cd98b9/2@2f94d90d, stk:1@35cce9a8, auth:1@b1b428e/-", + " 23 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#123))": "cpu:756946, mem:896789, objs:1@1c4ba01b/11@e7e2a007, vm:-/-, stk:1@d71170c8", + " 24 pop VM:e40d19d0:test -> Err(Error(Value, InvalidInput))": "cpu:757329, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:757951, mem:896805, objs:-/11@e7e2a007, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:757951, mem:896805, prngs:-/9b4a753, objs:-/11@e7e2a007, vm:-/-, evt:-, store:-/2@34b5472, foot:2@eabf0af1, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_0.json index 8ed72a02c..fdf28fa99 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@f8ea83e5", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@5d68d0ec", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@159b39d6, store:-/1@1ded1ce6, foot:1@c916eada", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@3a5c646a", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@49db9618", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@112afdc, store:-/1@67d4280, foot:1@56c7efdd", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@b9248f03", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@b026096d", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@1808dd98, auth:1@a2420675/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@4e4d6241, auth:1@38bf146a/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@a2420675/1@910aaf9c", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@89533a95", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@7f05f840, foot:2@3ccb09f9", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@ca7621fa", - " 14 push VM:debbc76c:sym#13()": "cpu:587479, mem:734545, objs:-/8@67bfa425, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4861adc1, auth:2@99bcb1b8/1@bef0db14", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@38bf146a/1@43383b03", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@1de0a5d5", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@a597cdd5, foot:2@d720294f", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@b66d50c5", + " 14 push VM:3e9df894:sym#13()": "cpu:587479, mem:734545, objs:-/8@c841d678, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b3c58ecc, auth:2@3c0501b4/1@d7a73daf", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:debbc76c:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@1cb76b09, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@7cf18f6", - " 22 push VM:debbc76c:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@2e2f2d2c, vm:65536@b1cd98b9/2@2f94d90d, stk:1@915dc46b, auth:1@2eefa960/-", - " 23 call bls12_381_g1_add(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@2e2f2d2c, vm:-/-, stk:1@4c6cabb1", - " 24 pop VM:debbc76c:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@2e2f2d2c, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@2e2f2d2c, vm:-/-, evt:-, store:-/2@7f05f840, foot:2@3ccb09f9, stk:-, auth:-/-" + " 19 pop VM:3e9df894:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@297bd2cf, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@31a2ee4f", + " 22 push VM:3e9df894:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@921f8b7d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@f7634505, auth:1@2eefa960/-", + " 23 call bls12_381_g1_add(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@921f8b7d, vm:-/-, stk:1@7585e993", + " 24 pop VM:3e9df894:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@921f8b7d, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@921f8b7d, vm:-/-, evt:-, store:-/2@a597cdd5, foot:2@d720294f, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_1.json index e7e8f9013..3cdf40853 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_1.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_add_arg_1.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@f8ea83e5", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@5d68d0ec", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@159b39d6, store:-/1@1ded1ce6, foot:1@c916eada", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@3a5c646a", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@49db9618", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@112afdc, store:-/1@67d4280, foot:1@56c7efdd", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@b9248f03", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@b026096d", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@1808dd98, auth:1@a2420675/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@4e4d6241, auth:1@38bf146a/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@a2420675/1@910aaf9c", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@89533a95", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@7f05f840, foot:2@3ccb09f9", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@ca7621fa", - " 14 push VM:debbc76c:sym#13()": "cpu:587479, mem:734545, objs:-/8@67bfa425, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4861adc1, auth:2@99bcb1b8/1@bef0db14", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@38bf146a/1@43383b03", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@1de0a5d5", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@a597cdd5, foot:2@d720294f", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@b66d50c5", + " 14 push VM:3e9df894:sym#13()": "cpu:587479, mem:734545, objs:-/8@c841d678, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b3c58ecc, auth:2@3c0501b4/1@d7a73daf", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:debbc76c:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@1cb76b09, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@c5cb635e", - " 22 push VM:debbc76c:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@fe4ba10, vm:65536@b1cd98b9/2@2f94d90d, stk:1@dc127d06, auth:1@2eefa960/-", - " 23 call bls12_381_g1_add(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@fe4ba10, vm:-/-, stk:1@d343ca6e", - " 24 pop VM:debbc76c:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@fe4ba10, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@fe4ba10, vm:-/-, evt:-, store:-/2@7f05f840, foot:2@3ccb09f9, stk:-, auth:-/-" + " 19 pop VM:3e9df894:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@297bd2cf, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@85e72125", + " 22 push VM:3e9df894:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@639077a6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@9f17acf0, auth:1@2eefa960/-", + " 23 call bls12_381_g1_add(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@639077a6, vm:-/-, stk:1@1809fc43", + " 24 pop VM:3e9df894:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@639077a6, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@639077a6, vm:-/-, evt:-, store:-/2@a597cdd5, foot:2@d720294f, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_0.json index f1df786d1..4d3c746ff 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@9b8a909c", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@8207fc2e", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@efeb3f54, store:-/1@bb858fb7, foot:1@ece417a3", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2749e8d4", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@80f7841", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@b527cf6f, store:-/1@d6941a6c, foot:1@db252443", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@e7eb580e", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@1c4eeb54", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@716a7b39, auth:1@2b0e5b7c/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@c2214f05, auth:1@4e5a1000/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@2b0e5b7c/1@3837d243", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@db65c405", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@f83a6a57, foot:2@36710152", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@74b3709d", - " 14 push VM:9260878f:sym#13()": "cpu:587479, mem:734545, objs:-/8@8001ceb9, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ef4afa91, auth:2@17fa48bc/1@34e27ae0", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@4e5a1000/1@c6fa402d", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@96b16f1b", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@b6749551, foot:2@ce4fd972", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@82c7fef5", + " 14 push VM:d6c11929:sym#13()": "cpu:587479, mem:734545, objs:-/8@692603f6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c8793e8b, auth:2@c4b1589c/1@388ad566", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:9260878f:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f82a37ee, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@614be462", - " 22 push VM:9260878f:test(Vec(obj#123), Vec(obj#19))": "cpu:757168, mem:897091, objs:-/12@d44771a2, vm:65536@b1cd98b9/2@2f94d90d, stk:1@35f80a05, auth:1@2eefa960/-", - " 23 call bls12_381_g1_msm(Vec(obj#123), Vec(obj#19))": "cpu:760716, mem:897202, objs:2@7a88623e/12@d44771a2, vm:-/-, stk:1@617d5af3", - " 24 pop VM:9260878f:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@d44771a2, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@d44771a2, vm:-/-, evt:-, store:-/2@f83a6a57, foot:2@36710152, stk:-, auth:-/-" + " 19 pop VM:d6c11929:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@c0e8d59f, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@4de767d9", + " 22 push VM:d6c11929:test(Vec(obj#123), Vec(obj#19))": "cpu:757168, mem:897091, objs:-/12@8047496, vm:65536@b1cd98b9/2@2f94d90d, stk:1@f06fc4fa, auth:1@2eefa960/-", + " 23 call bls12_381_g1_msm(Vec(obj#123), Vec(obj#19))": "cpu:760716, mem:897202, objs:2@7a88623e/12@8047496, vm:-/-, stk:1@74bfb527", + " 24 pop VM:d6c11929:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@8047496, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@8047496, vm:-/-, evt:-, store:-/2@b6749551, foot:2@ce4fd972, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_1.json index 9bdc3f204..6feb71092 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_1.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_msm_arg_1.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@9b8a909c", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@8207fc2e", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@efeb3f54, store:-/1@bb858fb7, foot:1@ece417a3", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2749e8d4", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@80f7841", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@b527cf6f, store:-/1@d6941a6c, foot:1@db252443", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@e7eb580e", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@1c4eeb54", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@716a7b39, auth:1@2b0e5b7c/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@c2214f05, auth:1@4e5a1000/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@2b0e5b7c/1@3837d243", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@db65c405", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@f83a6a57, foot:2@36710152", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@74b3709d", - " 14 push VM:9260878f:sym#13()": "cpu:587479, mem:734545, objs:-/8@8001ceb9, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ef4afa91, auth:2@17fa48bc/1@34e27ae0", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@4e5a1000/1@c6fa402d", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@96b16f1b", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@b6749551, foot:2@ce4fd972", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@82c7fef5", + " 14 push VM:d6c11929:sym#13()": "cpu:587479, mem:734545, objs:-/8@692603f6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c8793e8b, auth:2@c4b1589c/1@388ad566", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:9260878f:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f82a37ee, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@d9660342", - " 22 push VM:9260878f:test(Vec(obj#19), Vec(obj#123))": "cpu:757168, mem:897091, objs:-/12@718ee31a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ddf65df1, auth:1@2eefa960/-", - " 23 call bls12_381_g1_msm(Vec(obj#19), Vec(obj#123))": "cpu:760716, mem:897202, objs:2@9973ea16/12@718ee31a, vm:-/-, stk:1@d7cd73f1", - " 24 pop VM:9260878f:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@718ee31a, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@718ee31a, vm:-/-, evt:-, store:-/2@f83a6a57, foot:2@36710152, stk:-, auth:-/-" + " 19 pop VM:d6c11929:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@c0e8d59f, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@796751a", + " 22 push VM:d6c11929:test(Vec(obj#19), Vec(obj#123))": "cpu:757168, mem:897091, objs:-/12@64dae596, vm:65536@b1cd98b9/2@2f94d90d, stk:1@2d70e88b, auth:1@2eefa960/-", + " 23 call bls12_381_g1_msm(Vec(obj#19), Vec(obj#123))": "cpu:760716, mem:897202, objs:2@9973ea16/12@64dae596, vm:-/-, stk:1@e3b9ce4", + " 24 pop VM:d6c11929:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@64dae596, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@64dae596, vm:-/-, evt:-, store:-/2@b6749551, foot:2@ce4fd972, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_mul_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_mul_arg_0.json index 6d6b83567..82f63331c 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_mul_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g1_mul_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@5d68d0ec", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@9b8a909c", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@112afdc, store:-/1@67d4280, foot:1@56c7efdd", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@b9248f03", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@b026096d", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@efeb3f54, store:-/1@bb858fb7, foot:1@ece417a3", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2749e8d4", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@80f7841", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@4e4d6241, auth:1@38bf146a/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@716a7b39, auth:1@2b0e5b7c/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@38bf146a/1@43383b03", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@1de0a5d5", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@a597cdd5, foot:2@d720294f", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@b66d50c5", - " 14 push VM:3e9df894:sym#13()": "cpu:587479, mem:734545, objs:-/8@c841d678, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b3c58ecc, auth:2@3c0501b4/1@d7a73daf", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@2b0e5b7c/1@3837d243", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@db65c405", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@f83a6a57, foot:2@36710152", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@74b3709d", + " 14 push VM:9260878f:sym#13()": "cpu:587479, mem:734545, objs:-/8@8001ceb9, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ef4afa91, auth:2@17fa48bc/1@34e27ae0", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:3e9df894:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@297bd2cf, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:591938, mem:734720, objs:-/10@62919bd9", - " 22 push VM:3e9df894:test(Bytes(obj#123), U256(123))": "cpu:756728, mem:897027, objs:-/11@2a577eed, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b239a32e, auth:1@b1b428e/-", - " 23 call bls12_381_g1_mul(Bytes(obj#123), U256(123))": "cpu:759841, mem:897114, objs:1@1c4ba01b/11@2a577eed, vm:-/-, stk:1@fbb0b6c1", - " 24 pop VM:3e9df894:test -> Err(Error(Value, InvalidInput))": "cpu:760224, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:760846, mem:897130, objs:-/11@2a577eed, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:760846, mem:897130, prngs:-/9b4a753, objs:-/11@2a577eed, vm:-/-, evt:-, store:-/2@a597cdd5, foot:2@d720294f, stk:-, auth:-/-" + " 19 pop VM:9260878f:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f82a37ee, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:591938, mem:734720, objs:-/10@5b1f2a50", + " 22 push VM:9260878f:test(Bytes(obj#123), U256(123))": "cpu:756728, mem:897027, objs:-/11@f1eaa65a, vm:65536@b1cd98b9/2@2f94d90d, stk:1@be7b2e10, auth:1@b1b428e/-", + " 23 call bls12_381_g1_mul(Bytes(obj#123), U256(123))": "cpu:759841, mem:897114, objs:1@1c4ba01b/11@f1eaa65a, vm:-/-, stk:1@e874a835", + " 24 pop VM:9260878f:test -> Err(Error(Value, InvalidInput))": "cpu:760224, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:760846, mem:897130, objs:-/11@f1eaa65a, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:760846, mem:897130, prngs:-/9b4a753, objs:-/11@f1eaa65a, vm:-/-, evt:-, store:-/2@f83a6a57, foot:2@36710152, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_0.json index 249ffc7f0..58d897ea6 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@30ac6ca", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@6167eb8f", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@cf3f5ffd, store:-/1@95396a6f, foot:1@ece7f129", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2dc86a0e", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@6a505c46", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@b1018bfd, store:-/1@11c14a63, foot:1@4b225d08", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@92324", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@96b271b6", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@c72afdf2, auth:1@4991ced0/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@b746160c, auth:1@67d60a88/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@4991ced0/1@3bc292ca", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@fa0fc22c", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@1d2f22b, foot:2@abcef20", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@b17519b5", - " 14 push VM:52dc4818:sym#13()": "cpu:587479, mem:734545, objs:-/8@aeed3c03, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ec066dcc, auth:2@eb7ae117/1@5c17c4ff", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@67d60a88/1@5e9ab55d", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@6daa9397", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@cf024a3a, foot:2@bed7dcee", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@2b632d", + " 14 push VM:8fe91e5e:sym#13()": "cpu:587479, mem:734545, objs:-/8@17db6ce6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a8dbb6d2, auth:2@411fe97a/1@100968af", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:52dc4818:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de84d879, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@6a04878", - " 22 push VM:52dc4818:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@ab72633d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@50179a96, auth:1@2eefa960/-", - " 23 call bls12_381_g2_add(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@ab72633d, vm:-/-, stk:1@6d14dc67", - " 24 pop VM:52dc4818:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@ab72633d, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@ab72633d, vm:-/-, evt:-, store:-/2@1d2f22b, foot:2@abcef20, stk:-, auth:-/-" + " 19 pop VM:8fe91e5e:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f9a550b8, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@e722a5e6", + " 22 push VM:8fe91e5e:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@5fce79bd, vm:65536@b1cd98b9/2@2f94d90d, stk:1@f351c6e7, auth:1@2eefa960/-", + " 23 call bls12_381_g2_add(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@5fce79bd, vm:-/-, stk:1@8a166343", + " 24 pop VM:8fe91e5e:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@5fce79bd, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@5fce79bd, vm:-/-, evt:-, store:-/2@cf024a3a, foot:2@bed7dcee, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_1.json index 5d021bc66..ea8f359c5 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_1.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_add_arg_1.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@30ac6ca", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@6167eb8f", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@cf3f5ffd, store:-/1@95396a6f, foot:1@ece7f129", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2dc86a0e", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@6a505c46", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@b1018bfd, store:-/1@11c14a63, foot:1@4b225d08", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@92324", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@96b271b6", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@c72afdf2, auth:1@4991ced0/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@b746160c, auth:1@67d60a88/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@4991ced0/1@3bc292ca", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@fa0fc22c", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@1d2f22b, foot:2@abcef20", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@b17519b5", - " 14 push VM:52dc4818:sym#13()": "cpu:587479, mem:734545, objs:-/8@aeed3c03, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ec066dcc, auth:2@eb7ae117/1@5c17c4ff", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@67d60a88/1@5e9ab55d", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@6daa9397", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@cf024a3a, foot:2@bed7dcee", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@2b632d", + " 14 push VM:8fe91e5e:sym#13()": "cpu:587479, mem:734545, objs:-/8@17db6ce6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a8dbb6d2, auth:2@411fe97a/1@100968af", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:52dc4818:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de84d879, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@5c0401b8", - " 22 push VM:52dc4818:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@32f0a095, vm:65536@b1cd98b9/2@2f94d90d, stk:1@65867f62, auth:1@2eefa960/-", - " 23 call bls12_381_g2_add(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@32f0a095, vm:-/-, stk:1@df0c3cdc", - " 24 pop VM:52dc4818:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@32f0a095, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@32f0a095, vm:-/-, evt:-, store:-/2@1d2f22b, foot:2@abcef20, stk:-, auth:-/-" + " 19 pop VM:8fe91e5e:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f9a550b8, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@d0faed5f", + " 22 push VM:8fe91e5e:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@574f71d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1cc86925, auth:1@2eefa960/-", + " 23 call bls12_381_g2_add(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@574f71d, vm:-/-, stk:1@976430e", + " 24 pop VM:8fe91e5e:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@574f71d, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@574f71d, vm:-/-, evt:-, store:-/2@cf024a3a, foot:2@bed7dcee, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_0.json index 5d0776a34..54bdc1f65 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@6167eb8f", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@e652b341", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@b1018bfd, store:-/1@11c14a63, foot:1@4b225d08", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@92324", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@96b271b6", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@4e24e8fb, store:-/1@4ee9a390, foot:1@6258bc59", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@b2b8465f", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@55fdb8e6", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@b746160c, auth:1@67d60a88/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@6789640d, auth:1@a28d2bc5/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@67d60a88/1@5e9ab55d", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@6daa9397", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@cf024a3a, foot:2@bed7dcee", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@2b632d", - " 14 push VM:8fe91e5e:sym#13()": "cpu:587479, mem:734545, objs:-/8@17db6ce6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a8dbb6d2, auth:2@411fe97a/1@100968af", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@a28d2bc5/1@afc282f7", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@5675844f", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@8d1aad92, foot:2@67664879", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@51a69b40", + " 14 push VM:319e95a6:sym#13()": "cpu:587479, mem:734545, objs:-/8@8619fff, vm:65536@b1cd98b9/2@2f94d90d, stk:1@3c77e611, auth:2@bc67f9ed/1@918ae649", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:8fe91e5e:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f9a550b8, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@b17947a2", - " 22 push VM:8fe91e5e:test(Vec(obj#123), Vec(obj#19))": "cpu:757168, mem:897091, objs:-/12@68fb312c, vm:65536@b1cd98b9/2@2f94d90d, stk:1@147dd7fe, auth:1@2eefa960/-", - " 23 call bls12_381_g2_msm(Vec(obj#123), Vec(obj#19))": "cpu:760716, mem:897202, objs:2@7a88623e/12@68fb312c, vm:-/-, stk:1@98b1755a", - " 24 pop VM:8fe91e5e:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@68fb312c, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@68fb312c, vm:-/-, evt:-, store:-/2@cf024a3a, foot:2@bed7dcee, stk:-, auth:-/-" + " 19 pop VM:319e95a6:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de342357, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@814912ba", + " 22 push VM:319e95a6:test(Vec(obj#123), Vec(obj#19))": "cpu:757168, mem:897091, objs:-/12@3dfed9dc, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b8b43733, auth:1@2eefa960/-", + " 23 call bls12_381_g2_msm(Vec(obj#123), Vec(obj#19))": "cpu:760716, mem:897202, objs:2@7a88623e/12@3dfed9dc, vm:-/-, stk:1@ee49b90b", + " 24 pop VM:319e95a6:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@3dfed9dc, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@3dfed9dc, vm:-/-, evt:-, store:-/2@8d1aad92, foot:2@67664879, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_1.json index c3021f325..d825c1e0a 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_1.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_msm_arg_1.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@6167eb8f", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@e652b341", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@b1018bfd, store:-/1@11c14a63, foot:1@4b225d08", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@92324", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@96b271b6", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@4e24e8fb, store:-/1@4ee9a390, foot:1@6258bc59", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@b2b8465f", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@55fdb8e6", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@b746160c, auth:1@67d60a88/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@6789640d, auth:1@a28d2bc5/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@67d60a88/1@5e9ab55d", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@6daa9397", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@cf024a3a, foot:2@bed7dcee", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@2b632d", - " 14 push VM:8fe91e5e:sym#13()": "cpu:587479, mem:734545, objs:-/8@17db6ce6, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a8dbb6d2, auth:2@411fe97a/1@100968af", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@a28d2bc5/1@afc282f7", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@5675844f", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@8d1aad92, foot:2@67664879", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@51a69b40", + " 14 push VM:319e95a6:sym#13()": "cpu:587479, mem:734545, objs:-/8@8619fff, vm:65536@b1cd98b9/2@2f94d90d, stk:1@3c77e611, auth:2@bc67f9ed/1@918ae649", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:8fe91e5e:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@f9a550b8, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@88711c24", - " 22 push VM:8fe91e5e:test(Vec(obj#19), Vec(obj#123))": "cpu:757168, mem:897091, objs:-/12@e96c76f7, vm:65536@b1cd98b9/2@2f94d90d, stk:1@9874e29a, auth:1@2eefa960/-", - " 23 call bls12_381_g2_msm(Vec(obj#19), Vec(obj#123))": "cpu:760716, mem:897202, objs:2@9973ea16/12@e96c76f7, vm:-/-, stk:1@d8f0451f", - " 24 pop VM:8fe91e5e:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@e96c76f7, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@e96c76f7, vm:-/-, evt:-, store:-/2@cf024a3a, foot:2@bed7dcee, stk:-, auth:-/-" + " 19 pop VM:319e95a6:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de342357, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@51ea2938", + " 22 push VM:319e95a6:test(Vec(obj#19), Vec(obj#123))": "cpu:757168, mem:897091, objs:-/12@ac53dc9e, vm:65536@b1cd98b9/2@2f94d90d, stk:1@5f008a3d, auth:1@2eefa960/-", + " 23 call bls12_381_g2_msm(Vec(obj#19), Vec(obj#123))": "cpu:760716, mem:897202, objs:2@9973ea16/12@ac53dc9e, vm:-/-, stk:1@6b699e14", + " 24 pop VM:319e95a6:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@ac53dc9e, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@ac53dc9e, vm:-/-, evt:-, store:-/2@8d1aad92, foot:2@67664879, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_mul_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_mul_arg_0.json index d82cee33a..5a88c08bb 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_mul_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_g2_mul_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@e21161a8", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@89b18d4b", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@1a71dd, store:-/1@5871e06b, foot:1@2ec8ea04", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@10ffd2ee", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@3ba2b8d3", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@7e0b4596, store:-/1@dcba5044, foot:1@a784cda9", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@370751dc", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@ca695cc5", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@81e09efc, auth:1@ad84a34f/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@843d5e7f, auth:1@e4e77220/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@ad84a34f/1@9e559db5", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@b96baac2", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@72312903, foot:2@42bbe255", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@f71e9505", - " 14 push VM:28643094:sym#13()": "cpu:587479, mem:734545, objs:-/8@1cd7c910, vm:65536@b1cd98b9/2@2f94d90d, stk:1@171ac322, auth:2@2f7815cc/1@d2252ed0", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@e4e77220/1@f3db61e8", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@9e2f6be", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@bd111451, foot:2@6b72f996", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@ab40979f", + " 14 push VM:3cab0db3:sym#13()": "cpu:587479, mem:734545, objs:-/8@88bbdc87, vm:65536@b1cd98b9/2@2f94d90d, stk:1@c16193c4, auth:2@d19f3515/1@40bd648", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:28643094:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@aeffeed4, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:591938, mem:734720, objs:-/10@7c457218", - " 22 push VM:28643094:test(Bytes(obj#123), U256(123))": "cpu:756728, mem:897027, objs:-/11@dc46a7b2, vm:65536@b1cd98b9/2@2f94d90d, stk:1@8f2ec930, auth:1@b1b428e/-", - " 23 call bls12_381_g2_mul(Bytes(obj#123), U256(123))": "cpu:759841, mem:897114, objs:1@1c4ba01b/11@dc46a7b2, vm:-/-, stk:1@ac4e1fc7", - " 24 pop VM:28643094:test -> Err(Error(Value, InvalidInput))": "cpu:760224, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:760846, mem:897130, objs:-/11@dc46a7b2, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:760846, mem:897130, prngs:-/9b4a753, objs:-/11@dc46a7b2, vm:-/-, evt:-, store:-/2@72312903, foot:2@42bbe255, stk:-, auth:-/-" + " 19 pop VM:3cab0db3:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@6415ceab, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:591938, mem:734720, objs:-/10@6b38bd7a", + " 22 push VM:3cab0db3:test(Bytes(obj#123), U256(123))": "cpu:756728, mem:897027, objs:-/11@75a0aac4, vm:65536@b1cd98b9/2@2f94d90d, stk:1@384951df, auth:1@b1b428e/-", + " 23 call bls12_381_g2_mul(Bytes(obj#123), U256(123))": "cpu:759841, mem:897114, objs:1@1c4ba01b/11@75a0aac4, vm:-/-, stk:1@eb76d12a", + " 24 pop VM:3cab0db3:test -> Err(Error(Value, InvalidInput))": "cpu:760224, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:760846, mem:897130, objs:-/11@75a0aac4, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:760846, mem:897130, prngs:-/9b4a753, objs:-/11@75a0aac4, vm:-/-, evt:-, store:-/2@bd111451, foot:2@6b72f996, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_0.json index 4a6433be0..0175854f5 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@ba0e28cf", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@30ac6ca", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@2529719d, store:-/1@8214f796, foot:1@b6a2c7f", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@bfc0f708", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@318855d8", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@cf3f5ffd, store:-/1@95396a6f, foot:1@ece7f129", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2dc86a0e", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@6a505c46", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@f37266de, auth:1@5a647477/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@c72afdf2, auth:1@4991ced0/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@5a647477/1@794bb88a", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@2d2555b3", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@60869dc1, foot:2@909ab5d1", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@d5832548", - " 14 push VM:cd8d3801:sym#13()": "cpu:587479, mem:734545, objs:-/8@82d77fd8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@375b8d47, auth:2@e1c21d62/1@f4e59b3e", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@4991ced0/1@3bc292ca", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@fa0fc22c", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@1d2f22b, foot:2@abcef20", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@b17519b5", + " 14 push VM:52dc4818:sym#13()": "cpu:587479, mem:734545, objs:-/8@aeed3c03, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ec066dcc, auth:2@eb7ae117/1@5c17c4ff", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:cd8d3801:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@8cd107bd, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@b9d3214a", - " 22 push VM:cd8d3801:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@e64a91d8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@7bb27b9b, auth:1@2eefa960/-", - " 23 call bls12_381_hash_to_g1(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@e64a91d8, vm:-/-, stk:1@b702f519", - " 24 pop VM:cd8d3801:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@e64a91d8, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@e64a91d8, vm:-/-, evt:-, store:-/2@60869dc1, foot:2@909ab5d1, stk:-, auth:-/-" + " 19 pop VM:52dc4818:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de84d879, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@6a04878", + " 22 push VM:52dc4818:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@ab72633d, vm:65536@b1cd98b9/2@2f94d90d, stk:1@50179a96, auth:1@2eefa960/-", + " 23 call bls12_381_hash_to_g1(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@ab72633d, vm:-/-, stk:1@6d14dc67", + " 24 pop VM:52dc4818:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@ab72633d, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@ab72633d, vm:-/-, evt:-, store:-/2@1d2f22b, foot:2@abcef20, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_1.json index 6e37c3cd3..475699798 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_1.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g1_arg_1.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@ba0e28cf", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@30ac6ca", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@2529719d, store:-/1@8214f796, foot:1@b6a2c7f", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@bfc0f708", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@318855d8", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@cf3f5ffd, store:-/1@95396a6f, foot:1@ece7f129", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@2dc86a0e", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@6a505c46", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@f37266de, auth:1@5a647477/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@c72afdf2, auth:1@4991ced0/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@5a647477/1@794bb88a", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@2d2555b3", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@60869dc1, foot:2@909ab5d1", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@d5832548", - " 14 push VM:cd8d3801:sym#13()": "cpu:587479, mem:734545, objs:-/8@82d77fd8, vm:65536@b1cd98b9/2@2f94d90d, stk:1@375b8d47, auth:2@e1c21d62/1@f4e59b3e", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@4991ced0/1@3bc292ca", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@fa0fc22c", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@1d2f22b, foot:2@abcef20", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@b17519b5", + " 14 push VM:52dc4818:sym#13()": "cpu:587479, mem:734545, objs:-/8@aeed3c03, vm:65536@b1cd98b9/2@2f94d90d, stk:1@ec066dcc, auth:2@eb7ae117/1@5c17c4ff", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:cd8d3801:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@8cd107bd, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@945cb174", - " 22 push VM:cd8d3801:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@d3cc13c, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a0981c11, auth:1@2eefa960/-", - " 23 call bls12_381_hash_to_g1(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@d3cc13c, vm:-/-, stk:1@eae1d254", - " 24 pop VM:cd8d3801:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@d3cc13c, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@d3cc13c, vm:-/-, evt:-, store:-/2@60869dc1, foot:2@909ab5d1, stk:-, auth:-/-" + " 19 pop VM:52dc4818:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de84d879, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@5c0401b8", + " 22 push VM:52dc4818:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@32f0a095, vm:65536@b1cd98b9/2@2f94d90d, stk:1@65867f62, auth:1@2eefa960/-", + " 23 call bls12_381_hash_to_g1(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@32f0a095, vm:-/-, stk:1@df0c3cdc", + " 24 pop VM:52dc4818:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@32f0a095, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@32f0a095, vm:-/-, evt:-, store:-/2@1d2f22b, foot:2@abcef20, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_0.json index a8f9ccdc6..daa5fe5b3 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@e652b341", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@a3d71a79", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@4e24e8fb, store:-/1@4ee9a390, foot:1@6258bc59", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@b2b8465f", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@55fdb8e6", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@f73a0b6, store:-/1@b7eed210, foot:1@e5f26416", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@1ae579a3", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@ce4f9f74", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@6789640d, auth:1@a28d2bc5/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@77a4563f, auth:1@ce7e628a/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@a28d2bc5/1@afc282f7", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@5675844f", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@8d1aad92, foot:2@67664879", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@51a69b40", - " 14 push VM:319e95a6:sym#13()": "cpu:587479, mem:734545, objs:-/8@8619fff, vm:65536@b1cd98b9/2@2f94d90d, stk:1@3c77e611, auth:2@bc67f9ed/1@918ae649", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@ce7e628a/1@9f6132e2", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@cfcb25b8", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@6540d0cf, foot:2@909af309", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@ef0db824", + " 14 push VM:41168af6:sym#13()": "cpu:587479, mem:734545, objs:-/8@38ad3738, vm:65536@b1cd98b9/2@2f94d90d, stk:1@e22b2fe2, auth:2@59bce04f/1@531567a2", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:319e95a6:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de342357, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@5631c33", - " 22 push VM:319e95a6:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@3d0c994, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1b66d74, auth:1@2eefa960/-", - " 23 call bls12_381_hash_to_g2(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@3d0c994, vm:-/-, stk:1@70ce428a", - " 24 pop VM:319e95a6:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@3d0c994, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@3d0c994, vm:-/-, evt:-, store:-/2@8d1aad92, foot:2@67664879, stk:-, auth:-/-" + " 19 pop VM:41168af6:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@884ebe5c, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@4da4ad09", + " 22 push VM:41168af6:test(Bytes(obj#123), Bytes(obj#19))": "cpu:757168, mem:897091, objs:-/12@2b2104f9, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b9df823b, auth:1@2eefa960/-", + " 23 call bls12_381_hash_to_g2(Bytes(obj#123), Bytes(obj#19))": "cpu:760716, mem:897202, objs:2@8ea461ac/12@2b2104f9, vm:-/-, stk:1@b9fab20c", + " 24 pop VM:41168af6:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@2b2104f9, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@2b2104f9, vm:-/-, evt:-, store:-/2@6540d0cf, foot:2@909af309, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_1.json index e9b2045db..2aa15b5ec 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_1.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_hash_to_g2_arg_1.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@e652b341", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@a3d71a79", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@4e24e8fb, store:-/1@4ee9a390, foot:1@6258bc59", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@b2b8465f", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@55fdb8e6", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@f73a0b6, store:-/1@b7eed210, foot:1@e5f26416", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@1ae579a3", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@ce4f9f74", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@6789640d, auth:1@a28d2bc5/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@77a4563f, auth:1@ce7e628a/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@a28d2bc5/1@afc282f7", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@5675844f", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@8d1aad92, foot:2@67664879", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@51a69b40", - " 14 push VM:319e95a6:sym#13()": "cpu:587479, mem:734545, objs:-/8@8619fff, vm:65536@b1cd98b9/2@2f94d90d, stk:1@3c77e611, auth:2@bc67f9ed/1@918ae649", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@ce7e628a/1@9f6132e2", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@cfcb25b8", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@6540d0cf, foot:2@909af309", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@ef0db824", + " 14 push VM:41168af6:sym#13()": "cpu:587479, mem:734545, objs:-/8@38ad3738, vm:65536@b1cd98b9/2@2f94d90d, stk:1@e22b2fe2, auth:2@59bce04f/1@531567a2", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:319e95a6:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@de342357, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@cc639c49", - " 22 push VM:319e95a6:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@2601b114, vm:65536@b1cd98b9/2@2f94d90d, stk:1@1e3a6314, auth:1@2eefa960/-", - " 23 call bls12_381_hash_to_g2(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@2601b114, vm:-/-, stk:1@b781e257", - " 24 pop VM:319e95a6:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@2601b114, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@2601b114, vm:-/-, evt:-, store:-/2@8d1aad92, foot:2@67664879, stk:-, auth:-/-" + " 19 pop VM:41168af6:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@884ebe5c, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@fcbf8cfa", + " 22 push VM:41168af6:test(Bytes(obj#19), Bytes(obj#123))": "cpu:757168, mem:897091, objs:-/12@c3ff94f, vm:65536@b1cd98b9/2@2f94d90d, stk:1@5efb6b27, auth:1@2eefa960/-", + " 23 call bls12_381_hash_to_g2(Bytes(obj#19), Bytes(obj#123))": "cpu:760716, mem:897202, objs:2@ed767fd2/12@c3ff94f, vm:-/-, stk:1@49b6164c", + " 24 pop VM:41168af6:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@c3ff94f, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@c3ff94f, vm:-/-, evt:-, store:-/2@6540d0cf, foot:2@909af309, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp2_to_g2_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp2_to_g2_arg_0.json index 16175f03d..d88970398 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp2_to_g2_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp2_to_g2_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(119)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1036, mem:199, objs:-/1@8156aea0", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1036, mem:199, objs:-/1@d770cd8a", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:238338, mem:407206, objs:-/2@8ebb1a47, store:-/1@b45b32f7, foot:1@378804e", - " 5 call bytes_new_from_slice(32)": "cpu:238778, mem:407270, objs:-/3@2157c3bc", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:239747, mem:407382, objs:-/4@1662544e", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:238338, mem:407206, objs:-/2@eded1f6c, store:-/1@ec5141ab, foot:1@61a18f1a", + " 5 call bytes_new_from_slice(32)": "cpu:238778, mem:407270, objs:-/3@f47c58ad", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:239747, mem:407382, objs:-/4@acbb857f", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:242358, mem:407622, objs:-/5@f297b019, auth:1@8af98181/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:242358, mem:407622, objs:-/5@ce048f67, auth:1@fb53f8ab/-", " 9 ret obj_cmp -> Ok(0)": "cpu:242650", - " 10 call get_ledger_network_id()": "cpu:242700, auth:1@8af98181/1@5c62024f", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:243730, mem:407734, objs:-/6@a598f37b", - " 12 call symbol_new_from_slice(13)": "cpu:420583, mem:572038, store:-/2@76805b99, foot:2@69bb5f12", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:421591, mem:572131, objs:-/7@5c4a852f", - " 14 push VM:4fc46e19:sym#13()": "cpu:584594, mem:734257, objs:-/8@1904b0e4, vm:65536@b1cd98b9/2@2f94d90d, stk:1@926ffb2b, auth:2@e7d48069/1@53b4bbfe", + " 10 call get_ledger_network_id()": "cpu:242700, auth:1@fb53f8ab/1@305cb2bf", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:243730, mem:407734, objs:-/6@cbaf3a7d", + " 12 call symbol_new_from_slice(13)": "cpu:420583, mem:572038, store:-/2@eb983604, foot:2@5ef8e17e", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:421591, mem:572131, objs:-/7@f6a82a3b", + " 14 push VM:f08eed4a:sym#13()": "cpu:584594, mem:734257, objs:-/8@371aa4b1, vm:65536@b1cd98b9/2@2f94d90d, stk:1@20986787, auth:2@2ce95641/1@52412d7", " 15 call symbol_len(Symbol(obj#13))": "cpu:587264, mem:734288", " 16 ret symbol_len -> Ok(U32(13))": "cpu:587386", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:587490", - " 19 pop VM:4fc46e19:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:588613, mem:734368, objs:-/9@c9b810ee, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:589053, mem:734432, objs:-/10@f1da2e4e", - " 22 push VM:4fc46e19:test(Bytes(obj#123))": "cpu:753837, mem:896718, objs:-/11@e358cdae, vm:65536@b1cd98b9/2@2f94d90d, stk:1@a5016864, auth:1@b1b428e/-", - " 23 call bls12_381_map_fp2_to_g2(Bytes(obj#123))": "cpu:756946, mem:896789, objs:1@1c4ba01b/11@e358cdae, vm:-/-, stk:1@e056e4b", - " 24 pop VM:4fc46e19:test -> Err(Error(Value, InvalidInput))": "cpu:757329, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:757951, mem:896805, objs:-/11@e358cdae, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:757951, mem:896805, prngs:-/9b4a753, objs:-/11@e358cdae, vm:-/-, evt:-, store:-/2@76805b99, foot:2@69bb5f12, stk:-, auth:-/-" + " 19 pop VM:f08eed4a:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:588613, mem:734368, objs:-/9@6b3236f5, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:589053, mem:734432, objs:-/10@2f2d60a5", + " 22 push VM:f08eed4a:test(Bytes(obj#123))": "cpu:753837, mem:896718, objs:-/11@bc3b7105, vm:65536@b1cd98b9/2@2f94d90d, stk:1@40eda9e1, auth:1@b1b428e/-", + " 23 call bls12_381_map_fp2_to_g2(Bytes(obj#123))": "cpu:756946, mem:896789, objs:1@1c4ba01b/11@bc3b7105, vm:-/-, stk:1@456f0032", + " 24 pop VM:f08eed4a:test -> Err(Error(Value, InvalidInput))": "cpu:757329, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:757951, mem:896805, objs:-/11@bc3b7105, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:757951, mem:896805, prngs:-/9b4a753, objs:-/11@bc3b7105, vm:-/-, evt:-, store:-/2@eb983604, foot:2@5ef8e17e, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp_to_g1_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp_to_g1_arg_0.json index adca4bbb1..7ef3a5086 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp_to_g1_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_map_fp_to_g1_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(119)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1036, mem:199, objs:-/1@b4bf0722", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1036, mem:199, objs:-/1@f54d47a1", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:238338, mem:407206, objs:-/2@de847db1, store:-/1@a1fb3ef7, foot:1@45218ec", - " 5 call bytes_new_from_slice(32)": "cpu:238778, mem:407270, objs:-/3@8095d706", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:239747, mem:407382, objs:-/4@b45b0d32", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:238338, mem:407206, objs:-/2@17213953, store:-/1@e381693d, foot:1@233b617b", + " 5 call bytes_new_from_slice(32)": "cpu:238778, mem:407270, objs:-/3@93532cdb", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:239747, mem:407382, objs:-/4@6770c1d6", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:242358, mem:407622, objs:-/5@1fb49e85, auth:1@5116618c/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:242358, mem:407622, objs:-/5@d6919c84, auth:1@c2559472/-", " 9 ret obj_cmp -> Ok(0)": "cpu:242650", - " 10 call get_ledger_network_id()": "cpu:242700, auth:1@5116618c/1@e381a43b", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:243730, mem:407734, objs:-/6@330e2088", - " 12 call symbol_new_from_slice(13)": "cpu:420583, mem:572038, store:-/2@8518547e, foot:2@81e7c618", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:421591, mem:572131, objs:-/7@a1191ef4", - " 14 push VM:d0e6b201:sym#13()": "cpu:584594, mem:734257, objs:-/8@9d94b5b4, vm:65536@b1cd98b9/2@2f94d90d, stk:1@54953624, auth:2@670a31bc/1@c5bb926b", + " 10 call get_ledger_network_id()": "cpu:242700, auth:1@c2559472/1@25e926c2", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:243730, mem:407734, objs:-/6@9000238e", + " 12 call symbol_new_from_slice(13)": "cpu:420583, mem:572038, store:-/2@f7c56d83, foot:2@923e3ff5", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:421591, mem:572131, objs:-/7@ac019723", + " 14 push VM:b68ab99e:sym#13()": "cpu:584594, mem:734257, objs:-/8@7f147d92, vm:65536@b1cd98b9/2@2f94d90d, stk:1@cd220379, auth:2@76da15a5/1@469a428a", " 15 call symbol_len(Symbol(obj#13))": "cpu:587264, mem:734288", " 16 ret symbol_len -> Ok(U32(13))": "cpu:587386", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:587490", - " 19 pop VM:d0e6b201:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:588613, mem:734368, objs:-/9@5040a4c3, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:589053, mem:734432, objs:-/10@f19212a1", - " 22 push VM:d0e6b201:test(Bytes(obj#123))": "cpu:753837, mem:896718, objs:-/11@e0f38903, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4b0c8a78, auth:1@b1b428e/-", - " 23 call bls12_381_map_fp_to_g1(Bytes(obj#123))": "cpu:756946, mem:896789, objs:1@1c4ba01b/11@e0f38903, vm:-/-, stk:1@c3c3a38c", - " 24 pop VM:d0e6b201:test -> Err(Error(Value, InvalidInput))": "cpu:757329, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:757951, mem:896805, objs:-/11@e0f38903, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:757951, mem:896805, prngs:-/9b4a753, objs:-/11@e0f38903, vm:-/-, evt:-, store:-/2@8518547e, foot:2@81e7c618, stk:-, auth:-/-" + " 19 pop VM:b68ab99e:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:588613, mem:734368, objs:-/9@290dbeb, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#19))": "cpu:589053, mem:734432, objs:-/10@5c9b2bc7", + " 22 push VM:b68ab99e:test(Bytes(obj#123))": "cpu:753837, mem:896718, objs:-/11@bed2c221, vm:65536@b1cd98b9/2@2f94d90d, stk:1@156d6d26, auth:1@b1b428e/-", + " 23 call bls12_381_map_fp_to_g1(Bytes(obj#123))": "cpu:756946, mem:896789, objs:1@1c4ba01b/11@bed2c221, vm:-/-, stk:1@23ea204", + " 24 pop VM:b68ab99e:test -> Err(Error(Value, InvalidInput))": "cpu:757329, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:757951, mem:896805, objs:-/11@bed2c221, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:757951, mem:896805, prngs:-/9b4a753, objs:-/11@bed2c221, vm:-/-, evt:-, store:-/2@f7c56d83, foot:2@923e3ff5, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_0.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_0.json index 0cb553c98..67fb18447 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_0.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_0.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@bf556d6e", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@8a54d213", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@6730610d, store:-/1@70a3c418, foot:1@130f87c8", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@4554fb8f", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@b0cb9d95", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@f66e0e1e, store:-/1@feb40b8d, foot:1@b8ba8b4e", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@58798b9b", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@7768e183", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@388f748d, auth:1@9453e2aa/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@48dd7797, auth:1@29475bf7/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@9453e2aa/1@7c502362", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@a4e6149e", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@50f2b3d8, foot:2@ff5217cb", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@79609873", - " 14 push VM:5243202f:sym#13()": "cpu:587479, mem:734545, objs:-/8@d4fc5a0, vm:65536@b1cd98b9/2@2f94d90d, stk:1@6b51ff6f, auth:2@7772c868/1@c2248c61", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@29475bf7/1@6597d098", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@fca73d8b", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@a3e9e625, foot:2@dac64e91", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@cc82198d", + " 14 push VM:5c8378ed:sym#13()": "cpu:587479, mem:734545, objs:-/8@80a8aa57, vm:65536@b1cd98b9/2@2f94d90d, stk:1@bf4bb881, auth:2@fc57efd9/1@ac4ec361", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:5243202f:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@7b5404d7, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@ecf857a8", - " 22 push VM:5243202f:test(Vec(obj#123), Vec(obj#19))": "cpu:757168, mem:897091, objs:-/12@3937b1ae, vm:65536@b1cd98b9/2@2f94d90d, stk:1@b41c727a, auth:1@2eefa960/-", - " 23 call bls12_381_multi_pairing_check(Vec(obj#123), Vec(obj#19))": "cpu:760716, mem:897202, objs:2@7a88623e/12@3937b1ae, vm:-/-, stk:1@68599fd5", - " 24 pop VM:5243202f:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@3937b1ae, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@3937b1ae, vm:-/-, evt:-, store:-/2@50f2b3d8, foot:2@ff5217cb, stk:-, auth:-/-" + " 19 pop VM:5c8378ed:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@489e2401, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@3b357db9", + " 22 push VM:5c8378ed:test(Vec(obj#123), Vec(obj#19))": "cpu:757168, mem:897091, objs:-/12@d1225fbb, vm:65536@b1cd98b9/2@2f94d90d, stk:1@955c972, auth:1@2eefa960/-", + " 23 call bls12_381_multi_pairing_check(Vec(obj#123), Vec(obj#19))": "cpu:760716, mem:897202, objs:2@7a88623e/12@d1225fbb, vm:-/-, stk:1@2cad9299", + " 24 pop VM:5c8378ed:test -> Err(Error(Value, InvalidInput))": "cpu:761099, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761721, mem:897218, objs:-/12@d1225fbb, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761721, mem:897218, prngs:-/9b4a753, objs:-/12@d1225fbb, vm:-/-, evt:-, store:-/2@a3e9e625, foot:2@dac64e91, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_1.json b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_1.json index 8384e888c..b2405a593 100644 --- a/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_1.json +++ b/soroban-env-host/observations/22/test__dispatch__invalid_object_handle_bls12_381_multi_pairing_check_arg_1.json @@ -1,29 +1,29 @@ { " 0 begin": "cpu:14488, mem:0, prngs:-/9b4a753, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", " 1 call bytes_new_from_slice(122)": "cpu:47", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@bf556d6e", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1038, mem:202, objs:-/1@8a54d213", " 3 call upload_wasm(Bytes(obj#1))": "", - " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@6730610d, store:-/1@70a3c418, foot:1@130f87c8", - " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@4554fb8f", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@b0cb9d95", + " 4 ret upload_wasm -> Ok(Bytes(obj#3))": "cpu:241219, mem:407484, objs:-/2@f66e0e1e, store:-/1@feb40b8d, foot:1@b8ba8b4e", + " 5 call bytes_new_from_slice(32)": "cpu:241659, mem:407548, objs:-/3@58798b9b", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:242628, mem:407660, objs:-/4@7768e183", " 7 call create_contract(Address(obj#5), Bytes(obj#3), Bytes(obj#7))": "", - " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@388f748d, auth:1@9453e2aa/-", + " 8 call obj_cmp(Address(obj#9), Address(obj#5))": "cpu:245239, mem:407900, objs:-/5@48dd7797, auth:1@29475bf7/-", " 9 ret obj_cmp -> Ok(0)": "cpu:245531", - " 10 call get_ledger_network_id()": "cpu:245581, auth:1@9453e2aa/1@7c502362", - " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@a4e6149e", - " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@50f2b3d8, foot:2@ff5217cb", - " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@79609873", - " 14 push VM:5243202f:sym#13()": "cpu:587479, mem:734545, objs:-/8@d4fc5a0, vm:65536@b1cd98b9/2@2f94d90d, stk:1@6b51ff6f, auth:2@7772c868/1@c2248c61", + " 10 call get_ledger_network_id()": "cpu:245581, auth:1@29475bf7/1@6597d098", + " 11 ret get_ledger_network_id -> Ok(Bytes(obj#11))": "cpu:246611, mem:408012, objs:-/6@fca73d8b", + " 12 call symbol_new_from_slice(13)": "cpu:423466, mem:572321, store:-/2@a3e9e625, foot:2@dac64e91", + " 13 ret symbol_new_from_slice -> Ok(Symbol(obj#13))": "cpu:424474, mem:572414, objs:-/7@cc82198d", + " 14 push VM:5c8378ed:sym#13()": "cpu:587479, mem:734545, objs:-/8@80a8aa57, vm:65536@b1cd98b9/2@2f94d90d, stk:1@bf4bb881, auth:2@fc57efd9/1@ac4ec361", " 15 call symbol_len(Symbol(obj#13))": "cpu:590149, mem:734576", " 16 ret symbol_len -> Ok(U32(13))": "cpu:590271", " 17 call symbol_copy_to_slice(Symbol(obj#13), U32(0), 13)": "", " 18 ret symbol_copy_to_slice -> Ok(())": "cpu:590375", - " 19 pop VM:5243202f:sym#13 -> Ok(Void)": "", - " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@7b5404d7, vm:-/-, stk:-, auth:-/-", - " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@ed2527c8", - " 22 push VM:5243202f:test(Vec(obj#19), Vec(obj#123))": "cpu:757168, mem:897091, objs:-/12@d5028bfc, vm:65536@b1cd98b9/2@2f94d90d, stk:1@46751f80, auth:1@2eefa960/-", - " 23 call bls12_381_multi_pairing_check(Vec(obj#19), Vec(obj#123))": "cpu:760716, mem:897202, objs:2@9973ea16/12@d5028bfc, vm:-/-, stk:1@2136021e", - " 24 pop VM:5243202f:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", - " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@d5028bfc, vm:-/-, stk:-, auth:-/-", - " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@d5028bfc, vm:-/-, evt:-, store:-/2@50f2b3d8, foot:2@ff5217cb, stk:-, auth:-/-" + " 19 pop VM:5c8378ed:sym#13 -> Ok(Void)": "", + " 20 ret create_contract -> Ok(Address(obj#17))": "cpu:591498, mem:734656, objs:-/9@489e2401, vm:-/-, stk:-, auth:-/-", + " 21 call call(Address(obj#17), Symbol(test), Vec(obj#21))": "cpu:592378, mem:734784, objs:-/11@681e605", + " 22 push VM:5c8378ed:test(Vec(obj#19), Vec(obj#123))": "cpu:757168, mem:897091, objs:-/12@ac2a44cf, vm:65536@b1cd98b9/2@2f94d90d, stk:1@4b1bfd53, auth:1@2eefa960/-", + " 23 call bls12_381_multi_pairing_check(Vec(obj#19), Vec(obj#123))": "cpu:760716, mem:897202, objs:2@9973ea16/12@ac2a44cf, vm:-/-, stk:1@3cb44c13", + " 24 pop VM:5c8378ed:test -> Err(Error(Value, InvalidInput))": "cpu:761160, vm:65536@b1cd98b9/2@2f94d90d", + " 25 ret call -> Err(Error(Value, InvalidInput))": "cpu:761782, mem:897218, objs:-/12@ac2a44cf, vm:-/-, stk:-, auth:-/-", + " 26 end": "cpu:761782, mem:897218, prngs:-/9b4a753, objs:-/12@ac2a44cf, vm:-/-, evt:-, store:-/2@a3e9e625, foot:2@dac64e91, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/src/budget.rs b/soroban-env-host/src/budget.rs index efd091598..533f4272a 100644 --- a/soroban-env-host/src/budget.rs +++ b/soroban-env-host/src/budget.rs @@ -117,8 +117,10 @@ impl Default for BudgetTracker { ContractCostType::VerifyEcdsaSecp256r1Sig => (), ContractCostType::Bls12381EncodeFp => (), ContractCostType::Bls12381DecodeFp => (), - ContractCostType::Bls12381G1Validate => (), - ContractCostType::Bls12381G2Validate => (), + ContractCostType::Bls12381G1CheckPointOnCurve => (), + ContractCostType::Bls12381G1CheckPointInSubgroup => (), + ContractCostType::Bls12381G2CheckPointOnCurve => (), + ContractCostType::Bls12381G2CheckPointInSubgroup => (), ContractCostType::Bls12381G1ProjectiveToAffine => (), ContractCostType::Bls12381G2ProjectiveToAffine => (), ContractCostType::Bls12381G1Add => (), @@ -588,12 +590,20 @@ impl Default for BudgetImpl { cpu.const_term = 985; cpu.lin_term = ScaledU64(0); } - ContractCostType::Bls12381G1Validate => { - cpu.const_term = 732301; + ContractCostType::Bls12381G1CheckPointOnCurve => { + cpu.const_term = 1934; cpu.lin_term = ScaledU64(0); } - ContractCostType::Bls12381G2Validate => { - cpu.const_term = 1063432; + ContractCostType::Bls12381G1CheckPointInSubgroup => { + cpu.const_term = 730510; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2CheckPointOnCurve => { + cpu.const_term = 5921; + cpu.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2CheckPointInSubgroup => { + cpu.const_term = 1057822; cpu.lin_term = ScaledU64(0); } ContractCostType::Bls12381G1ProjectiveToAffine => { @@ -871,11 +881,19 @@ impl Default for BudgetImpl { mem.const_term = 0; mem.lin_term = ScaledU64(0); } - ContractCostType::Bls12381G1Validate => { + ContractCostType::Bls12381G1CheckPointOnCurve => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G1CheckPointInSubgroup => { + mem.const_term = 0; + mem.lin_term = ScaledU64(0); + } + ContractCostType::Bls12381G2CheckPointOnCurve => { mem.const_term = 0; mem.lin_term = ScaledU64(0); } - ContractCostType::Bls12381G2Validate => { + ContractCostType::Bls12381G2CheckPointInSubgroup => { mem.const_term = 0; mem.lin_term = ScaledU64(0); } diff --git a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs index 33408298e..06c1f3a5f 100644 --- a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs +++ b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs @@ -8,10 +8,10 @@ use crate::{ xdr::ContractCostType::{ self, Bls12381DecodeFp, Bls12381EncodeFp, Bls12381FrAddSub, Bls12381FrFromU256, Bls12381FrInv, Bls12381FrMul, Bls12381FrPow, Bls12381FrToU256, Bls12381G1Add, - Bls12381G1Msm, Bls12381G1Mul, Bls12381G1ProjectiveToAffine, Bls12381G1Validate, - Bls12381G2Add, Bls12381G2Msm, Bls12381G2Mul, Bls12381G2ProjectiveToAffine, - Bls12381G2Validate, Bls12381HashToG1, Bls12381HashToG2, Bls12381MapFp2ToG2, - Bls12381MapFpToG1, Bls12381Pairing, + Bls12381G1CheckPointInSubgroup, Bls12381G1CheckPointOnCurve, Bls12381G1Msm, Bls12381G1Mul, + Bls12381G1ProjectiveToAffine, Bls12381G2Add, Bls12381G2CheckPointInSubgroup, + Bls12381G2CheckPointOnCurve, Bls12381G2Msm, Bls12381G2Mul, Bls12381G2ProjectiveToAffine, + Bls12381HashToG1, Bls12381HashToG2, Bls12381MapFp2ToG2, Bls12381MapFpToG1, Bls12381Pairing, }, Host, U256Val, }; @@ -19,8 +19,10 @@ use std::hint::black_box; pub struct Bls12381EncodeFpRun; pub struct Bls12381DecodeFpRun; -pub struct Bls12381G1ValidateRun; -pub struct Bls12381G2ValidateRun; +pub struct Bls12381G1CheckPointOnCurveRun; +pub struct Bls12381G1CheckPointInSubgroupRun; +pub struct Bls12381G2CheckPointOnCurveRun; +pub struct Bls12381G2CheckPointInSubgroupRun; pub struct Bls12381G1ProjectiveToAffineRun; pub struct Bls12381G2ProjectiveToAffineRun; pub struct Bls12381G1AddRun; @@ -73,9 +75,13 @@ pub struct Bls12381EncodeFpSample(pub Vec, pub Fq); #[derive(Clone)] pub struct Bls12381DecodeFpSample(pub Vec); #[derive(Clone)] -pub struct Bls12381G1ValidateSample(pub G1Affine, pub ContractCostType); +pub struct Bls12381G1CheckPointOnCurveSample(pub G1Affine, pub ContractCostType); #[derive(Clone)] -pub struct Bls12381G2ValidateSample(pub G2Affine, pub ContractCostType); +pub struct Bls12381G1CheckPointInSubgroupSample(pub G1Affine, pub ContractCostType); +#[derive(Clone)] +pub struct Bls12381G2CheckPointOnCurveSample(pub G2Affine, pub ContractCostType); +#[derive(Clone)] +pub struct Bls12381G2CheckPointInSubgroupSample(pub G2Affine, pub ContractCostType); #[derive(Clone)] pub struct Bls12381FrToU256Sample(pub Fr); #[derive(Clone)] @@ -156,24 +162,6 @@ impl_const_cost_runner_for_bls_consume_sample!( G2Affine, fq2 ); -impl_const_cost_runner_for_bls_consume_sample!( - Bls12381G1ValidateRun, - Bls12381G1Validate, - metered_check_point, - Bls12381G1ValidateSample, - G1Affine, - pt, - ct -); -impl_const_cost_runner_for_bls_consume_sample!( - Bls12381G2ValidateRun, - Bls12381G2Validate, - metered_check_point, - Bls12381G2ValidateSample, - G2Affine, - pt, - ct -); impl_const_cost_runner_for_bls_consume_sample!( Bls12381FrFromU256Run, Bls12381FrFromU256, @@ -351,3 +339,40 @@ impl_lin_cost_runner_for_bls_deref_sample!( lhs, rhs ); + +impl_const_cost_runner_for_bls_deref_sample!( + Bls12381G1CheckPointOnCurveRun, + Bls12381G1CheckPointOnCurve, + check_point_is_on_curve, + Bls12381G1CheckPointOnCurveSample, + bool, + pt, + ty +); +impl_const_cost_runner_for_bls_deref_sample!( + Bls12381G1CheckPointInSubgroupRun, + Bls12381G1CheckPointInSubgroup, + check_point_is_in_subgroup, + Bls12381G1CheckPointInSubgroupSample, + bool, + pt, + ty +); +impl_const_cost_runner_for_bls_deref_sample!( + Bls12381G2CheckPointOnCurveRun, + Bls12381G2CheckPointOnCurve, + check_point_is_on_curve, + Bls12381G2CheckPointOnCurveSample, + bool, + pt, + ty +); +impl_const_cost_runner_for_bls_deref_sample!( + Bls12381G2CheckPointInSubgroupRun, + Bls12381G2CheckPointInSubgroup, + check_point_is_in_subgroup, + Bls12381G2CheckPointInSubgroupSample, + bool, + pt, + ty +); diff --git a/soroban-env-host/src/cost_runner/experimental/bls12_381.rs b/soroban-env-host/src/cost_runner/experimental/bls12_381.rs index 12d3fcbc1..58467c44f 100644 --- a/soroban-env-host/src/cost_runner/experimental/bls12_381.rs +++ b/soroban-env-host/src/cost_runner/experimental/bls12_381.rs @@ -175,18 +175,6 @@ macro_rules! impl_experiment_const_cost_runner_for_bls_deref_sample { } impl Host { - fn check_g1_on_curve(&self, pt: &G1Affine) -> Result { - Ok(pt.is_on_curve()) - } - fn check_g1_in_subgroup(&self, pt: &G1Affine) -> Result { - Ok(pt.is_in_correct_subgroup_assuming_on_curve()) - } - fn check_g2_on_curve(&self, pt: &G2Affine) -> Result { - Ok(pt.is_on_curve()) - } - fn check_g2_in_subgroup(&self, pt: &G2Affine) -> Result { - Ok(pt.is_in_correct_subgroup_assuming_on_curve()) - } fn g1_compute_y_from_x(&self, pt: &G1Affine) -> Result { Ok(G1Affine::get_ys_from_x_unchecked(pt.x).unwrap().0) } @@ -195,34 +183,6 @@ impl Host { } } -pub struct Bls12381G1CheckPointOnCurveRun; - -#[derive(Clone)] -pub struct Bls12381G1CheckPointOnCurveSample(pub G1Affine); - -impl_experiment_const_cost_runner_for_bls_deref_sample!( - Bls12381G1CheckPointOnCurveRun, - Bls12381G1CheckPointOnCurve, - check_g1_on_curve, - Bls12381G1CheckPointOnCurveSample, - bool, - pt -); - -pub struct Bls12381G1CheckPointInSubgroupRun; - -#[derive(Clone)] -pub struct Bls12381G1CheckPointInSubgroupSample(pub G1Affine); - -impl_experiment_const_cost_runner_for_bls_deref_sample!( - Bls12381G1CheckPointInSubgroupRun, - Bls12381G1CheckPointInSubgroup, - check_g1_in_subgroup, - Bls12381G1CheckPointInSubgroupSample, - bool, - pt -); - pub struct Bls12381G1ComputeYFromXRun; #[derive(Clone)] @@ -237,34 +197,6 @@ impl_experiment_const_cost_runner_for_bls_deref_sample!( pt ); -pub struct Bls12381G2CheckPointOnCurveRun; - -#[derive(Clone)] -pub struct Bls12381G2CheckPointOnCurveSample(pub G2Affine); - -impl_experiment_const_cost_runner_for_bls_deref_sample!( - Bls12381G2CheckPointOnCurveRun, - Bls12381G2CheckPointOnCurve, - check_g2_on_curve, - Bls12381G2CheckPointOnCurveSample, - bool, - pt -); - -pub struct Bls12381G2CheckPointInSubgroupRun; - -#[derive(Clone)] -pub struct Bls12381G2CheckPointInSubgroupSample(pub G2Affine); - -impl_experiment_const_cost_runner_for_bls_deref_sample!( - Bls12381G2CheckPointInSubgroupRun, - Bls12381G2CheckPointInSubgroup, - check_g2_in_subgroup, - Bls12381G2CheckPointInSubgroupSample, - bool, - pt -); - pub struct Bls12381G2ComputeYFromXRun; #[derive(Clone)] diff --git a/soroban-env-host/src/cost_runner/experimental/mod.rs b/soroban-env-host/src/cost_runner/experimental/mod.rs index 9eb3730d4..ff98ce138 100644 --- a/soroban-env-host/src/cost_runner/experimental/mod.rs +++ b/soroban-env-host/src/cost_runner/experimental/mod.rs @@ -30,11 +30,7 @@ pub enum ExperimentalCostType { Bls12381G2AffineDeserializeUncompressed, Bls12381G2AffineSerializeUncompressed, Bls12381Fp2DeserializeUncompressed, - Bls12381G1CheckPointOnCurve, - Bls12381G1CheckPointInSubgroup, Bls12381G1ComputeYFromX, - Bls12381G2CheckPointOnCurve, - Bls12381G2CheckPointInSubgroup, Bls12381G2ComputeYFromX, } @@ -64,15 +60,7 @@ impl Name for ExperimentalCostType { ExperimentalCostType::Bls12381Fp2DeserializeUncompressed => { "Bls12381Fp2DeserializeUncompressed" } - ExperimentalCostType::Bls12381G1CheckPointOnCurve => "Bls12381G1CheckPointOnCurve", - ExperimentalCostType::Bls12381G1CheckPointInSubgroup => { - "Bls12381G1CheckPointInSubgroup" - } ExperimentalCostType::Bls12381G1ComputeYFromX => "Bls12381G1ComputeYFromX", - ExperimentalCostType::Bls12381G2CheckPointOnCurve => "Bls12381G2CheckPointOnCurve", - ExperimentalCostType::Bls12381G2CheckPointInSubgroup => { - "Bls12381G2CheckPointInSubgroup" - } ExperimentalCostType::Bls12381G2ComputeYFromX => "Bls12381G2ComputeYFromX", } } diff --git a/soroban-env-host/src/crypto/bls12_381.rs b/soroban-env-host/src/crypto/bls12_381.rs index 56c673664..178c824f4 100644 --- a/soroban-env-host/src/crypto/bls12_381.rs +++ b/soroban-env-host/src/crypto/bls12_381.rs @@ -20,7 +20,7 @@ use ark_ec::{ CurveGroup, }; use ark_ff::{field_hashers::DefaultFieldHasher, BigInteger, Field, PrimeField}; -use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Valid, Validate}; +use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Validate}; use num_traits::Zero; use sha2::Sha256; use std::cmp::Ordering; @@ -120,28 +120,30 @@ impl Host { } } - pub(crate) fn metered_check_point( + pub(crate) fn check_point_is_on_curve( &self, - pt: Affine

, - ty: ContractCostType, - ) -> Result, HostError> { - self.charge_budget(ty, None)?; - // performs following checks 1. point belongs to the curve 2. point - // belongs to the correct subgroup - pt.check().map_err(|_| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "bls12-381 G1 affine deserialize: invalid point", - &[], - ) - })?; - Ok(pt) + pt: &Affine

, + ty: &ContractCostType, + ) -> Result { + // passing ty by reference in order to make it more template friendly for cost_runner code + self.charge_budget(*ty, None)?; + Ok(pt.is_on_curve()) + } + + pub(crate) fn check_point_is_in_subgroup( + &self, + pt: &Affine

, + ty: &ContractCostType, + ) -> Result { + // passing ty by reference in order to make it more template friendly for cost_runner code + self.charge_budget(*ty, None)?; + Ok(pt.is_in_correct_subgroup_assuming_on_curve()) } pub(crate) fn g1_affine_deserialize_from_bytesobj( &self, bo: BytesObject, + subgroup_check: bool, ) -> Result { let msg: &str = "G1"; let pt: G1Affine = self.visit_obj(bo, |bytes: &ScBytes| { @@ -165,10 +167,79 @@ impl Host { // didn't find that being an invalid condition, so we will leave them as is. self.deserialize_uncompessed_no_validate(&bytes, 2, msg) })?; - self.metered_check_point::( - pt, - ContractCostType::Bls12381G1Validate, - ) + if !self.check_point_is_on_curve(&pt, &ContractCostType::Bls12381G1CheckPointOnCurve)? { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!("bls12-381 {}: point not on curve", msg).as_str(), + &[], + )); + } + if subgroup_check + && !self.check_point_is_in_subgroup( + &pt, + &ContractCostType::Bls12381G1CheckPointInSubgroup, + )? + { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!("bls12-381 {}: point not in the correct subgroup", msg).as_str(), + &[], + )); + } + Ok(pt) + } + + pub(crate) fn g2_affine_deserialize_from_bytesobj( + &self, + bo: BytesObject, + subgroup_check: bool, + ) -> Result { + let msg: &str = "G2"; + let pt: G2Affine = self.visit_obj(bo, |bytes: &ScBytes| { + self.validate_point_encoding::(&bytes, msg)?; + // `CanonicalDeserialize` of `Affine

` calls into + // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::g2::Config`, the + // core logic is in `arc_bls12_381::curves::util::read_g2_uncompressed`. + // + // The `arc_bls12_381` lib already expects the input to be serialized in + // big-endian order (aligning with the common standard and contrary + // to ark::serialize's convention), + // + // i.e. `input = be_bytes(X) || be_bytes(Y)` and the + // most-significant three bits of X are flags: + // + // `bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` + // + // internally when deserializing `Fp`, the flag bits are masked off + // to get `X: Fp`. The Y however, does not have the top bits masked off + // so it is possible for Y to exceed 381 bits. I've checked all over and + // didn't find that being an invalid condition, so we will leave them as is. + self.deserialize_uncompessed_no_validate(&bytes, 4, msg) + })?; + if !self.check_point_is_on_curve(&pt, &ContractCostType::Bls12381G2CheckPointOnCurve)? { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!("bls12-381 {}: point not on curve", msg).as_str(), + &[], + )); + } + if subgroup_check + && !self.check_point_is_in_subgroup( + &pt, + &ContractCostType::Bls12381G2CheckPointInSubgroup, + )? + { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!("bls12-381 {}: point not in the correct subgroup", msg).as_str(), + &[], + )); + } + Ok(pt) } pub(crate) fn g1_projective_into_affine( @@ -205,38 +276,6 @@ impl Host { self.g1_affine_serialize_uncompressed(g1_affine) } - pub(crate) fn g2_affine_deserialize_from_bytesobj( - &self, - bo: BytesObject, - ) -> Result { - let msg: &str = "G2"; - let pt: G2Affine = self.visit_obj(bo, |bytes: &ScBytes| { - self.validate_point_encoding::(&bytes, msg)?; - // `CanonicalDeserialize` of `Affine

` calls into - // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::g2::Config`, the - // core logic is in `arc_bls12_381::curves::util::read_g2_uncompressed`. - // - // The `arc_bls12_381` lib already expects the input to be serialized in - // big-endian order (aligning with the common standard and contrary - // to ark::serialize's convention), - // - // i.e. `input = be_bytes(X) || be_bytes(Y)` and the - // most-significant three bits of X are flags: - // - // `bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` - // - // internally when deserializing `Fp`, the flag bits are masked off - // to get `X: Fp`. The Y however, does not have the top bits masked off - // so it is possible for Y to exceed 381 bits. I've checked all over and - // didn't find that being an invalid condition, so we will leave them as is. - self.deserialize_uncompessed_no_validate(&bytes, 4, msg) - })?; - self.metered_check_point::( - pt, - ContractCostType::Bls12381G2Validate, - ) - } - pub(crate) fn g2_projective_into_affine( &self, g2: G2Projective, @@ -371,8 +410,10 @@ impl Host { points.reserve(len as usize); let _ = self.visit_obj(vp, |vp: &HostVec| { for p in vp.iter() { - let pp = - self.g1_affine_deserialize_from_bytesobj(BytesObject::try_from_val(self, p)?)?; + let pp = self.g1_affine_deserialize_from_bytesobj( + BytesObject::try_from_val(self, p)?, + true, + )?; points.push(pp); } Ok(()) @@ -492,8 +533,10 @@ impl Host { let mut points: Vec = Vec::with_capacity(len as usize); let _ = self.visit_obj(vp, |vp: &HostVec| { for p in vp.iter() { - let pp = - self.g2_affine_deserialize_from_bytesobj(BytesObject::try_from_val(self, p)?)?; + let pp = self.g2_affine_deserialize_from_bytesobj( + BytesObject::try_from_val(self, p)?, + true, + )?; points.push(pp); } Ok(()) diff --git a/soroban-env-host/src/host.rs b/soroban-env-host/src/host.rs index 7c8ec067a..d519b82b1 100644 --- a/soroban-env-host/src/host.rs +++ b/soroban-env-host/src/host.rs @@ -2916,14 +2916,24 @@ impl VmCallerEnv for Host { Ok(res.into()) } + fn bls12_381_check_g1_is_in_subgroup( + &self, + _vmcaller: &mut VmCaller, + pt: BytesObject, + ) -> Result { + let pt = self.g1_affine_deserialize_from_bytesobj(pt, false)?; + self.check_point_is_in_subgroup(&pt, &ContractCostType::Bls12381G1CheckPointInSubgroup) + .map(|b| Bool::from(b)) + } + fn bls12_381_g1_add( &self, _vmcaller: &mut VmCaller, p0: BytesObject, p1: BytesObject, ) -> Result { - let p0 = self.g1_affine_deserialize_from_bytesobj(p0)?; - let p1 = self.g1_affine_deserialize_from_bytesobj(p1)?; + let p0 = self.g1_affine_deserialize_from_bytesobj(p0, false)?; + let p1 = self.g1_affine_deserialize_from_bytesobj(p1, false)?; let res = self.g1_add_internal(p0, p1)?; self.g1_projective_serialize_uncompressed(res) } @@ -2934,7 +2944,7 @@ impl VmCallerEnv for Host { p0: BytesObject, scalar: U256Val, ) -> Result { - let p0 = self.g1_affine_deserialize_from_bytesobj(p0)?; + let p0 = self.g1_affine_deserialize_from_bytesobj(p0, true)?; let scalar = self.fr_from_u256val(scalar)?; let res = self.g1_mul_internal(p0, scalar)?; self.g1_projective_serialize_uncompressed(res) @@ -2998,14 +3008,24 @@ impl VmCallerEnv for Host { self.g1_affine_serialize_uncompressed(g1) } + fn bls12_381_check_g2_is_in_subgroup( + &self, + _vmcaller: &mut VmCaller, + pt: BytesObject, + ) -> Result { + let pt = self.g2_affine_deserialize_from_bytesobj(pt, false)?; + self.check_point_is_in_subgroup(&pt, &ContractCostType::Bls12381G2CheckPointInSubgroup) + .map(|b| Bool::from(b)) + } + fn bls12_381_g2_add( &self, _vmcaller: &mut VmCaller, p0: BytesObject, p1: BytesObject, ) -> Result { - let p0 = self.g2_affine_deserialize_from_bytesobj(p0)?; - let p1 = self.g2_affine_deserialize_from_bytesobj(p1)?; + let p0 = self.g2_affine_deserialize_from_bytesobj(p0, false)?; + let p1 = self.g2_affine_deserialize_from_bytesobj(p1, false)?; let res = self.g2_add_internal(p0, p1)?; self.g2_projective_serialize_uncompressed(res) } @@ -3016,7 +3036,7 @@ impl VmCallerEnv for Host { p0: BytesObject, scalar_le_bytes: U256Val, ) -> Result { - let p0 = self.g2_affine_deserialize_from_bytesobj(p0)?; + let p0 = self.g2_affine_deserialize_from_bytesobj(p0, true)?; let scalar = self.fr_from_u256val(scalar_le_bytes)?; let res = self.g2_mul_internal(p0, scalar)?; self.g2_projective_serialize_uncompressed(res) diff --git a/soroban-env-host/src/test/bls12_381.rs b/soroban-env-host/src/test/bls12_381.rs index a08130c14..c7e3d574a 100644 --- a/soroban-env-host/src/test/bls12_381.rs +++ b/soroban-env-host/src/test/bls12_381.rs @@ -74,16 +74,14 @@ fn parse_hex(s: &str) -> Vec { Vec::from_hex(s.trim_start_matches("0x")).unwrap() } -fn sample_g1(host: &Host) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); - host.g1_affine_serialize_uncompressed(G1Affine::rand(&mut rng)) +fn sample_g1(host: &Host, rng: &mut StdRng) -> Result { + host.g1_affine_serialize_uncompressed(G1Affine::rand(rng)) } -fn sample_g1_not_on_curve(host: &Host) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); +fn sample_g1_not_on_curve(host: &Host, rng: &mut StdRng) -> Result { loop { - let x = Fq::rand(&mut rng); - let y = Fq::rand(&mut rng); + let x = Fq::rand(rng); + let y = Fq::rand(rng); let p = G1Affine::new_unchecked(x, y); if !p.is_on_curve() { return host.g1_affine_serialize_uncompressed(p); @@ -91,10 +89,9 @@ fn sample_g1_not_on_curve(host: &Host) -> Result { } } -fn sample_g1_not_in_subgroup(host: &Host) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); +fn sample_g1_not_in_subgroup(host: &Host, rng: &mut StdRng) -> Result { loop { - let x = Fq::rand(&mut rng); + let x = Fq::rand(rng); if let Some(p) = G1Affine::get_point_from_x_unchecked(x, true) { assert!(p.is_on_curve()); if !p.is_in_correct_subgroup_assuming_on_curve() { @@ -109,13 +106,16 @@ fn g1_zero(host: &Host) -> Result { } fn neg_g1(bo: BytesObject, host: &Host) -> Result { - let g1 = host.g1_affine_deserialize_from_bytesobj(bo)?; + let g1 = host.g1_affine_deserialize_from_bytesobj(bo, true)?; host.g1_affine_serialize_uncompressed(-g1) } -fn invalid_g1(host: &Host, ty: InvalidPointTypes) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); - let affine = G1Affine::rand(&mut rng); +fn invalid_g1( + host: &Host, + ty: InvalidPointTypes, + rng: &mut StdRng, +) -> Result { + let affine = G1Affine::rand(rng); assert!(!affine.is_zero()); let bo = host.g1_affine_serialize_uncompressed(affine)?; match ty { @@ -142,21 +142,19 @@ fn invalid_g1(host: &Host, ty: InvalidPointTypes) -> Result sample_g1_not_on_curve(host), - InvalidPointTypes::PointNotInSubgroup => sample_g1_not_in_subgroup(host), + InvalidPointTypes::PointNotOnCurve => sample_g1_not_on_curve(host, rng), + InvalidPointTypes::PointNotInSubgroup => sample_g1_not_in_subgroup(host, rng), } } -fn sample_g2(host: &Host) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); - host.g2_affine_serialize_uncompressed(G2Affine::rand(&mut rng)) +fn sample_g2(host: &Host, rng: &mut StdRng) -> Result { + host.g2_affine_serialize_uncompressed(G2Affine::rand(rng)) } -fn sample_g2_not_on_curve(host: &Host) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); +fn sample_g2_not_on_curve(host: &Host, rng: &mut StdRng) -> Result { loop { - let x = Fq2::rand(&mut rng); - let y = Fq2::rand(&mut rng); + let x = Fq2::rand(rng); + let y = Fq2::rand(rng); let p = G2Affine::new_unchecked(x, y); if !p.is_on_curve() { return host.g2_affine_serialize_uncompressed(p); @@ -164,10 +162,9 @@ fn sample_g2_not_on_curve(host: &Host) -> Result { } } -fn sample_g2_not_in_subgroup(host: &Host) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); +fn sample_g2_not_in_subgroup(host: &Host, rng: &mut StdRng) -> Result { loop { - let x = Fq2::rand(&mut rng); + let x = Fq2::rand(rng); if let Some(p) = G2Affine::get_point_from_x_unchecked(x, true) { assert!(p.is_on_curve()); if !p.is_in_correct_subgroup_assuming_on_curve() { @@ -182,13 +179,16 @@ fn g2_zero(host: &Host) -> Result { } fn neg_g2(bo: BytesObject, host: &Host) -> Result { - let g2 = host.g2_affine_deserialize_from_bytesobj(bo)?; + let g2 = host.g2_affine_deserialize_from_bytesobj(bo, true)?; host.g2_affine_serialize_uncompressed(-g2) } -fn invalid_g2(host: &Host, ty: InvalidPointTypes) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); - let affine = G2Affine::rand(&mut rng); +fn invalid_g2( + host: &Host, + ty: InvalidPointTypes, + rng: &mut StdRng, +) -> Result { + let affine = G2Affine::rand(rng); assert!(!affine.is_zero()); let bo = host.g2_affine_serialize_uncompressed(affine)?; match ty { @@ -215,8 +215,8 @@ fn invalid_g2(host: &Host, ty: InvalidPointTypes) -> Result sample_g2_not_on_curve(host), - InvalidPointTypes::PointNotInSubgroup => sample_g2_not_in_subgroup(host), + InvalidPointTypes::PointNotOnCurve => sample_g2_not_on_curve(host, rng), + InvalidPointTypes::PointNotInSubgroup => sample_g2_not_in_subgroup(host, rng), } } @@ -236,17 +236,19 @@ fn parse_g2_point_test_case(host: &Host, p: Point) -> Result Result { - let mut rng = StdRng::from_seed([0xff; 32]); - let fp = Fq::rand(&mut rng); +fn sample_fp(host: &Host, rng: &mut StdRng) -> Result { + let fp = Fq::rand(rng); let mut buf = [0u8; FP_SERIALIZED_SIZE]; host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; host.bytes_new_from_slice(&buf) } -fn invalid_fp(host: &Host, ty: InvalidPointTypes) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); - let fp = Fq::rand(&mut rng); +fn invalid_fp( + host: &Host, + ty: InvalidPointTypes, + rng: &mut StdRng, +) -> Result { + let fp = Fq::rand(rng); match ty { InvalidPointTypes::TooManyBytes => { let mut buf = [0u8; FP_SERIALIZED_SIZE + 1]; // one extra zero byte @@ -263,17 +265,19 @@ fn invalid_fp(host: &Host, ty: InvalidPointTypes) -> Result Result { - let mut rng = StdRng::from_seed([0xff; 32]); - let fp = Fq2::rand(&mut rng); +fn sample_fp2(host: &Host, rng: &mut StdRng) -> Result { + let fp = Fq2::rand(rng); let mut buf = [0u8; FP2_SERIALIZED_SIZE]; host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; host.bytes_new_from_slice(&buf) } -fn invalid_fp2(host: &Host, ty: InvalidPointTypes) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); - let fp = Fq::rand(&mut rng); +fn invalid_fp2( + host: &Host, + ty: InvalidPointTypes, + rng: &mut StdRng, +) -> Result { + let fp = Fq::rand(rng); match ty { InvalidPointTypes::TooManyBytes => { let mut buf = [0u8; FP2_SERIALIZED_SIZE + 1]; // one extra zero byte @@ -289,13 +293,12 @@ fn invalid_fp2(host: &Host, ty: InvalidPointTypes) -> Result Result { - let mut rng = StdRng::from_seed([0xff; 32]); +fn sample_fr(host: &Host, rng: &mut StdRng) -> Result { let obj = host.obj_from_u256_pieces( - u64::rand(&mut rng), - u64::rand(&mut rng), - u64::rand(&mut rng), - u64::rand(&mut rng), + u64::rand(rng), + u64::rand(rng), + u64::rand(rng), + u64::rand(rng), )?; Ok(obj.into()) } @@ -304,12 +307,12 @@ fn sample_host_vec( host: &Host, buf_size: usize, vec_len: usize, + rng: &mut StdRng, ) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); let vals: Vec = (0..vec_len) .into_iter() .map(|_| { - let t = T::rand(&mut rng); + let t = T::rand(rng); let mut buf = vec![0; buf_size]; host.serialize_uncompressed_into_slice(&t, &mut buf, 1, "test") .unwrap(); @@ -319,16 +322,15 @@ fn sample_host_vec( host.vec_new_from_slice(&vals) } -fn sample_fr_vec(host: &Host, vec_len: usize) -> Result { - let mut rng = StdRng::from_seed([0xff; 32]); +fn sample_fr_vec(host: &Host, vec_len: usize, rng: &mut StdRng) -> Result { let vals: Vec = (0..vec_len) .into_iter() .map(|_| { host.obj_from_u256_pieces( - u64::rand(&mut rng), - u64::rand(&mut rng), - u64::rand(&mut rng), - u64::rand(&mut rng), + u64::rand(rng), + u64::rand(rng), + u64::rand(rng), + u64::rand(rng), ) .unwrap() .to_val() @@ -338,107 +340,228 @@ fn sample_fr_vec(host: &Host, vec_len: usize) -> Result { } #[test] -fn g1_add() -> Result<(), HostError> { +fn check_g1_is_in_subgroup() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); let host = observe_host!(Host::test_host()); host.enable_debug()?; - // invalid p1 + // invalid point { - let p2 = sample_g1(&host)?; assert!(HostError::result_matches_err( - host.bls12_381_g1_add(invalid_g1(&host, InvalidPointTypes::TooManyBytes)?, p2), + host.bls12_381_check_g1_is_in_subgroup(invalid_g1( + &host, + InvalidPointTypes::TooManyBytes, + &mut rng + )?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_check_g1_is_in_subgroup(invalid_g1( + &host, + InvalidPointTypes::TooFewBytes, + &mut rng + )?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_check_g1_is_in_subgroup(invalid_g1( + &host, + InvalidPointTypes::CompressionFlagSet, + &mut rng + )?,), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_check_g1_is_in_subgroup(invalid_g1( + &host, + InvalidPointTypes::InfinityFlagSetBitsNotAllZero, + &mut rng + )?,), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( - host.bls12_381_g1_add(invalid_g1(&host, InvalidPointTypes::TooFewBytes)?, p2), + host.bls12_381_check_g1_is_in_subgroup(invalid_g1( + &host, + InvalidPointTypes::SortFlagSet, + &mut rng + )?), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); + assert!(HostError::result_matches_err( + host.bls12_381_check_g1_is_in_subgroup(invalid_g1( + &host, + InvalidPointTypes::PointNotOnCurve, + &mut rng + )?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // valid point in subgroup + { + for _ in 0..10 { + assert!(host + .bls12_381_check_g1_is_in_subgroup(sample_g1(&host, &mut rng)?)? + .to_val() + .is_true()) + } + } + // infinity point is in subgroup + { + assert!(host + .bls12_381_check_g1_is_in_subgroup(g1_zero(&host)?)? + .to_val() + .is_true()) + } + // out of subgroup + { + for _ in 0..10 { + assert!(host + .bls12_381_check_g1_is_in_subgroup(invalid_g1( + &host, + InvalidPointTypes::PointNotInSubgroup, + &mut rng + )?)? + .to_val() + .is_false()) + } + } + Ok(()) +} + +#[test] +fn g1_add() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // invalid p1 + { + let p2 = sample_g1(&host, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_g1_add( - invalid_g1(&host, InvalidPointTypes::CompressionFlagSet)?, + invalid_g1(&host, InvalidPointTypes::TooManyBytes, &mut rng)?, p2 ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g1_add( - invalid_g1(&host, InvalidPointTypes::InfinityFlagSetBitsNotAllZero)?, + invalid_g1(&host, InvalidPointTypes::TooFewBytes, &mut rng)?, p2 ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( - host.bls12_381_g1_add(invalid_g1(&host, InvalidPointTypes::SortFlagSet)?, p2), + host.bls12_381_g1_add( + invalid_g1(&host, InvalidPointTypes::CompressionFlagSet, &mut rng)?, + p2 + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( - host.bls12_381_g1_add(invalid_g1(&host, InvalidPointTypes::PointNotOnCurve)?, p2), + host.bls12_381_g1_add( + invalid_g1( + &host, + InvalidPointTypes::InfinityFlagSetBitsNotAllZero, + &mut rng + )?, + p2 + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g1_add( - invalid_g1(&host, InvalidPointTypes::PointNotInSubgroup)?, + invalid_g1(&host, InvalidPointTypes::SortFlagSet, &mut rng)?, p2 ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); - } - // invalid p2 - { - let p1 = sample_g1(&host)?; assert!(HostError::result_matches_err( - host.bls12_381_g1_add(p1, invalid_g1(&host, InvalidPointTypes::TooManyBytes)?), + host.bls12_381_g1_add( + invalid_g1(&host, InvalidPointTypes::PointNotOnCurve, &mut rng)?, + p2 + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); + // addition does not require input points to be in the correcct subgroup + assert!(host + .bls12_381_g1_add( + invalid_g1(&host, InvalidPointTypes::PointNotInSubgroup, &mut rng)?, + p2 + ) + .is_ok()) + } + // invalid p2 + { + let p1 = sample_g1(&host, &mut rng)?; assert!(HostError::result_matches_err( - host.bls12_381_g1_add(p1, invalid_g1(&host, InvalidPointTypes::TooFewBytes)?), + host.bls12_381_g1_add( + p1, + invalid_g1(&host, InvalidPointTypes::TooManyBytes, &mut rng)? + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g1_add( p1, - invalid_g1(&host, InvalidPointTypes::CompressionFlagSet)? + invalid_g1(&host, InvalidPointTypes::TooFewBytes, &mut rng)? ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g1_add( p1, - invalid_g1(&host, InvalidPointTypes::InfinityFlagSetBitsNotAllZero)? + invalid_g1(&host, InvalidPointTypes::CompressionFlagSet, &mut rng)? ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( - host.bls12_381_g1_add(p1, invalid_g1(&host, InvalidPointTypes::SortFlagSet)?), + host.bls12_381_g1_add( + p1, + invalid_g1( + &host, + InvalidPointTypes::InfinityFlagSetBitsNotAllZero, + &mut rng + )? + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( - host.bls12_381_g1_add(p1, invalid_g1(&host, InvalidPointTypes::PointNotOnCurve)?), + host.bls12_381_g1_add( + p1, + invalid_g1(&host, InvalidPointTypes::SortFlagSet, &mut rng)? + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g1_add( p1, - invalid_g1(&host, InvalidPointTypes::PointNotInSubgroup)? + invalid_g1(&host, InvalidPointTypes::PointNotOnCurve, &mut rng)? ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); + // addition does not require input points to be in the correcct subgroup + assert!(host + .bls12_381_g1_add( + p1, + invalid_g1(&host, InvalidPointTypes::PointNotInSubgroup, &mut rng)? + ) + .is_ok()); } // 3. lhs.add(zero) = lhs { - let p1 = sample_g1(&host)?; + let p1 = sample_g1(&host, &mut rng)?; let res = host.bls12_381_g1_add(p1, g1_zero(&host)?)?; assert_eq!(host.obj_cmp(p1.into(), res.into())?, Ordering::Equal as i64); } // 4. zero.add(rhs) = rhs { - let p2 = sample_g1(&host)?; + let p2 = sample_g1(&host, &mut rng)?; let res = host.bls12_381_g1_add(g1_zero(&host)?, p2)?; assert_eq!(host.obj_cmp(p2.into(), res.into())?, Ordering::Equal as i64); } // 5. communitive a + b = b + a { - let a = sample_g1(&host)?; - let b = sample_g1(&host)?; + let a = sample_g1(&host, &mut rng)?; + let b = sample_g1(&host, &mut rng)?; let a_plus_b = host.bls12_381_g1_add(a, b)?; let b_plus_a = host.bls12_381_g1_add(b, a)?; assert_eq!( @@ -448,9 +571,9 @@ fn g1_add() -> Result<(), HostError> { } // 6. associative (a + b) + c = a + (b + c) { - let a = sample_g1(&host)?; - let b = sample_g1(&host)?; - let c = sample_g1(&host)?; + let a = sample_g1(&host, &mut rng)?; + let b = sample_g1(&host, &mut rng)?; + let c = sample_g1(&host, &mut rng)?; let aplusb = host.bls12_381_g1_add(a, b)?; let aplusb_plus_c = host.bls12_381_g1_add(aplusb, c)?; let bplusc = host.bls12_381_g1_add(b, c)?; @@ -462,7 +585,7 @@ fn g1_add() -> Result<(), HostError> { } // 7. a - a = zero { - let a = sample_g1(&host)?; + let a = sample_g1(&host, &mut rng)?; let neg_a = neg_g1(a.clone(), &host)?; let res = host.bls12_381_g1_add(a, neg_a)?; let zero = g1_zero(&host)?; @@ -476,11 +599,12 @@ fn g1_add() -> Result<(), HostError> { #[test] fn g1_mul() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); let host = observe_host!(Host::test_host()); host.enable_debug()?; // 2. lhs * 0 = 0 { - let lhs = sample_g1(&host)?; + let lhs = sample_g1(&host, &mut rng)?; let rhs = host.obj_from_u256_pieces(0, 0, 0, 0)?; let res = host.bls12_381_g1_mul(lhs, rhs.into())?; let zero = g1_zero(&host)?; @@ -491,7 +615,7 @@ fn g1_mul() -> Result<(), HostError> { } // 3. lhs * 1 = lhs { - let lhs = sample_g1(&host)?; + let lhs = sample_g1(&host, &mut rng)?; let rhs = U256Val::from_u32(1); let res = host.bls12_381_g1_mul(lhs, rhs.into())?; assert_eq!( @@ -501,9 +625,9 @@ fn g1_mul() -> Result<(), HostError> { } // 4. associative P * a * b = P * b * a { - let p = sample_g1(&host)?; - let a = sample_fr(&host)?; - let b = sample_fr(&host)?; + let p = sample_g1(&host, &mut rng)?; + let a = sample_fr(&host, &mut rng)?; + let b = sample_fr(&host, &mut rng)?; let pa = host.bls12_381_g1_mul(p, a)?; let pab = host.bls12_381_g1_mul(pa, b)?; let pb = host.bls12_381_g1_mul(p, b)?; @@ -518,6 +642,7 @@ fn g1_mul() -> Result<(), HostError> { #[test] fn g1_msm() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); let host = observe_host!(Host::test_host()); host.enable_debug()?; // vector lengths are zero @@ -531,8 +656,8 @@ fn g1_msm() -> Result<(), HostError> { } // vector lengths not equal { - let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 2)?; - let vs = sample_fr_vec(&host, 3)?; + let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 2, &mut rng)?; + let vs = sample_fr_vec(&host, 3, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_g1_msm(vp, vs), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -541,11 +666,11 @@ fn g1_msm() -> Result<(), HostError> { // vector g1 not valid { let vp = host.vec_new_from_slice(&[ - sample_g1(&host)?.to_val(), - invalid_g1(&host, InvalidPointTypes::PointNotInSubgroup)?.to_val(), - sample_g1(&host)?.to_val(), + sample_g1(&host, &mut rng)?.to_val(), + invalid_g1(&host, InvalidPointTypes::PointNotInSubgroup, &mut rng)?.to_val(), + sample_g1(&host, &mut rng)?.to_val(), ])?; - let vs = sample_fr_vec(&host, 3)?; + let vs = sample_fr_vec(&host, 3, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_g1_msm(vp, vs), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -554,7 +679,7 @@ fn g1_msm() -> Result<(), HostError> { // vector of zero points result zero { let vp = host.vec_new_from_slice(&[g1_zero(&host)?.to_val(); 3])?; - let vs = sample_fr_vec(&host, 3)?; + let vs = sample_fr_vec(&host, 3, &mut rng)?; let res = host.bls12_381_g1_msm(vp, vs)?; assert_eq!( host.obj_cmp(res.into(), g1_zero(&host)?.into())?, @@ -563,7 +688,7 @@ fn g1_msm() -> Result<(), HostError> { } // vector of zero scalars result in zero point { - let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3)?; + let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; let vs = host.vec_new_from_slice(&[U256Val::from_u32(0).to_val(); 3])?; let res = host.bls12_381_g1_msm(vp, vs)?; assert_eq!( @@ -573,7 +698,7 @@ fn g1_msm() -> Result<(), HostError> { } // 6. g1 * (1) + g1 (-1) = 0 { - let pt = sample_g1(&host)?; + let pt = sample_g1(&host, &mut rng)?; let zero = g1_zero(&host)?; assert_ne!( host.obj_cmp(pt.into(), zero.into())?, @@ -592,16 +717,16 @@ fn g1_msm() -> Result<(), HostError> { { host.budget_ref().reset_default()?; let mut vp = vec![ - sample_g1(&host)?.to_val(), - sample_g1(&host)?.to_val(), - sample_g1(&host)?.to_val(), - sample_g1(&host)?.to_val(), + sample_g1(&host, &mut rng)?.to_val(), + sample_g1(&host, &mut rng)?.to_val(), + sample_g1(&host, &mut rng)?.to_val(), + sample_g1(&host, &mut rng)?.to_val(), ]; let mut vs = vec![ - sample_fr(&host)?.to_val(), - sample_fr(&host)?.to_val(), - sample_fr(&host)?.to_val(), - sample_fr(&host)?.to_val(), + sample_fr(&host, &mut rng)?.to_val(), + sample_fr(&host, &mut rng)?.to_val(), + sample_fr(&host, &mut rng)?.to_val(), + sample_fr(&host, &mut rng)?.to_val(), ]; let ref_res = host.bls12_381_g1_msm(host.vec_new_from_slice(&vp)?, host.vec_new_from_slice(&vs)?)?; @@ -631,8 +756,8 @@ fn g1_msm() -> Result<(), HostError> { // 8. msm result is same as invidial mul and add { host.budget_ref().reset_default()?; - let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 10)?; - let vs = sample_fr_vec(&host, 10)?; + let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 10, &mut rng)?; + let vs = sample_fr_vec(&host, 10, &mut rng)?; let ref_res = host.bls12_381_g1_msm(vp, vs)?; let mut res = g1_zero(&host)?; for i in 0..10 { @@ -651,16 +776,17 @@ fn g1_msm() -> Result<(), HostError> { #[test] fn map_fp_to_g1() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); let host = observe_host!(Host::test_host()); host.enable_debug()?; // invalid fp: wrong length { - let p1 = invalid_fp(&host, InvalidPointTypes::TooFewBytes)?; + let p1 = invalid_fp(&host, InvalidPointTypes::TooFewBytes, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_map_fp_to_g1(p1), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); - let p2 = invalid_fp(&host, InvalidPointTypes::TooManyBytes)?; + let p2 = invalid_fp(&host, InvalidPointTypes::TooManyBytes, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_map_fp_to_g1(p2), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -751,108 +877,230 @@ fn hash_to_g1() -> Result<(), HostError> { } // g2 tests + #[test] -fn g2_add() -> Result<(), HostError> { +fn check_g2_is_in_subgroup() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); let host = observe_host!(Host::test_host()); host.enable_debug()?; - // invalid p1 + // invalid point { - let p2 = sample_g2(&host)?; assert!(HostError::result_matches_err( - host.bls12_381_g2_add(invalid_g2(&host, InvalidPointTypes::TooManyBytes)?, p2), + host.bls12_381_check_g2_is_in_subgroup(invalid_g2( + &host, + InvalidPointTypes::TooManyBytes, + &mut rng + )?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_check_g2_is_in_subgroup(invalid_g2( + &host, + InvalidPointTypes::TooFewBytes, + &mut rng + )?), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( - host.bls12_381_g2_add(invalid_g2(&host, InvalidPointTypes::TooFewBytes)?, p2), + host.bls12_381_check_g2_is_in_subgroup(invalid_g2( + &host, + InvalidPointTypes::CompressionFlagSet, + &mut rng + )?,), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_check_g2_is_in_subgroup(invalid_g2( + &host, + InvalidPointTypes::InfinityFlagSetBitsNotAllZero, + &mut rng + )?,), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_check_g2_is_in_subgroup(invalid_g2( + &host, + InvalidPointTypes::SortFlagSet, + &mut rng + )?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + assert!(HostError::result_matches_err( + host.bls12_381_check_g2_is_in_subgroup(invalid_g2( + &host, + InvalidPointTypes::PointNotOnCurve, + &mut rng + )?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + // valid point in subgroup + { + for _ in 0..10 { + assert!(host + .bls12_381_check_g2_is_in_subgroup(sample_g2(&host, &mut rng)?)? + .to_val() + .is_true()) + } + } + // infinity point is in subgroup + { + assert!(host + .bls12_381_check_g2_is_in_subgroup(g2_zero(&host)?)? + .to_val() + .is_true()) + } + // out of subgroup + { + for _ in 0..10 { + assert!(host + .bls12_381_check_g2_is_in_subgroup(invalid_g2( + &host, + InvalidPointTypes::PointNotInSubgroup, + &mut rng + )?)? + .to_val() + .is_false()) + } + } + Ok(()) +} + +#[test] +fn g2_add() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // invalid p1 + { + let p2 = sample_g2(&host, &mut rng)?; + assert!(HostError::result_matches_err( + host.bls12_381_g2_add( + invalid_g2(&host, InvalidPointTypes::TooManyBytes, &mut rng)?, + p2 + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g2_add( - invalid_g2(&host, InvalidPointTypes::CompressionFlagSet)?, + invalid_g2(&host, InvalidPointTypes::TooFewBytes, &mut rng)?, p2 ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g2_add( - invalid_g2(&host, InvalidPointTypes::InfinityFlagSetBitsNotAllZero)?, + invalid_g2(&host, InvalidPointTypes::CompressionFlagSet, &mut rng)?, p2 ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( - host.bls12_381_g2_add(invalid_g2(&host, InvalidPointTypes::SortFlagSet)?, p2), + host.bls12_381_g2_add( + invalid_g2( + &host, + InvalidPointTypes::InfinityFlagSetBitsNotAllZero, + &mut rng + )?, + p2 + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( - host.bls12_381_g2_add(invalid_g2(&host, InvalidPointTypes::PointNotOnCurve)?, p2), + host.bls12_381_g2_add( + invalid_g2(&host, InvalidPointTypes::SortFlagSet, &mut rng)?, + p2 + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g2_add( - invalid_g2(&host, InvalidPointTypes::PointNotInSubgroup)?, + invalid_g2(&host, InvalidPointTypes::PointNotOnCurve, &mut rng)?, p2 ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); + // addition does not require input points to be in the correcct subgroup + assert!(host + .bls12_381_g2_add( + invalid_g2(&host, InvalidPointTypes::PointNotInSubgroup, &mut rng)?, + p2 + ) + .is_ok()); } // invalid p2 { - let p1 = sample_g2(&host)?; + let p1 = sample_g2(&host, &mut rng)?; assert!(HostError::result_matches_err( - host.bls12_381_g2_add(p1, invalid_g2(&host, InvalidPointTypes::TooManyBytes)?), - (ScErrorType::Crypto, ScErrorCode::InvalidInput) - )); - assert!(HostError::result_matches_err( - host.bls12_381_g2_add(p1, invalid_g2(&host, InvalidPointTypes::TooFewBytes)?), + host.bls12_381_g2_add( + p1, + invalid_g2(&host, InvalidPointTypes::TooManyBytes, &mut rng)? + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g2_add( p1, - invalid_g2(&host, InvalidPointTypes::CompressionFlagSet)? + invalid_g2(&host, InvalidPointTypes::TooFewBytes, &mut rng)? ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g2_add( p1, - invalid_g2(&host, InvalidPointTypes::InfinityFlagSetBitsNotAllZero)? + invalid_g2(&host, InvalidPointTypes::CompressionFlagSet, &mut rng)? ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( - host.bls12_381_g2_add(p1, invalid_g2(&host, InvalidPointTypes::SortFlagSet)?), + host.bls12_381_g2_add( + p1, + invalid_g2( + &host, + InvalidPointTypes::InfinityFlagSetBitsNotAllZero, + &mut rng + )? + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( - host.bls12_381_g2_add(p1, invalid_g2(&host, InvalidPointTypes::PointNotOnCurve)?), + host.bls12_381_g2_add( + p1, + invalid_g2(&host, InvalidPointTypes::SortFlagSet, &mut rng)? + ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); assert!(HostError::result_matches_err( host.bls12_381_g2_add( p1, - invalid_g2(&host, InvalidPointTypes::PointNotInSubgroup)? + invalid_g2(&host, InvalidPointTypes::PointNotOnCurve, &mut rng)? ), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); + // addition does not require input points to be in the correcct subgroup + assert!(host + .bls12_381_g2_add( + p1, + invalid_g2(&host, InvalidPointTypes::PointNotInSubgroup, &mut rng)? + ) + .is_ok()); } // 3. lhs.add(zero) = lhs { - let p1 = sample_g2(&host)?; + let p1 = sample_g2(&host, &mut rng)?; let res = host.bls12_381_g2_add(p1, g2_zero(&host)?)?; assert_eq!(host.obj_cmp(p1.into(), res.into())?, Ordering::Equal as i64); } // 4. zero.add(rhs) = rhs { - let p2 = sample_g2(&host)?; + let p2 = sample_g2(&host, &mut rng)?; let res = host.bls12_381_g2_add(g2_zero(&host)?, p2)?; assert_eq!(host.obj_cmp(p2.into(), res.into())?, Ordering::Equal as i64); } // 5. communitive a + b = b + a { - let a = sample_g2(&host)?; - let b = sample_g2(&host)?; + let a = sample_g2(&host, &mut rng)?; + let b = sample_g2(&host, &mut rng)?; let a_plus_b = host.bls12_381_g2_add(a, b)?; let b_plus_a = host.bls12_381_g2_add(b, a)?; assert_eq!( @@ -862,9 +1110,9 @@ fn g2_add() -> Result<(), HostError> { } // 6. associative (a + b) + c = a + (b + c) { - let a = sample_g2(&host)?; - let b = sample_g2(&host)?; - let c = sample_g2(&host)?; + let a = sample_g2(&host, &mut rng)?; + let b = sample_g2(&host, &mut rng)?; + let c = sample_g2(&host, &mut rng)?; let aplusb = host.bls12_381_g2_add(a, b)?; let aplusb_plus_c = host.bls12_381_g2_add(aplusb, c)?; let bplusc = host.bls12_381_g2_add(b, c)?; @@ -876,7 +1124,7 @@ fn g2_add() -> Result<(), HostError> { } // 7. a - a = zero { - let a = sample_g2(&host)?; + let a = sample_g2(&host, &mut rng)?; let neg_a = neg_g2(a.clone(), &host)?; let res = host.bls12_381_g2_add(a, neg_a)?; let zero = g2_zero(&host)?; @@ -890,11 +1138,12 @@ fn g2_add() -> Result<(), HostError> { #[test] fn g2_mul() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); let host = observe_host!(Host::test_host()); host.enable_debug()?; // 2. lhs * 0 = 0 { - let lhs = sample_g2(&host)?; + let lhs = sample_g2(&host, &mut rng)?; let rhs = host.obj_from_u256_pieces(0, 0, 0, 0)?; let res = host.bls12_381_g2_mul(lhs, rhs.into())?; let zero = g2_zero(&host)?; @@ -905,7 +1154,7 @@ fn g2_mul() -> Result<(), HostError> { } // 3. lhs * 1 = lhs { - let lhs = sample_g2(&host)?; + let lhs = sample_g2(&host, &mut rng)?; let rhs = U256Val::from_u32(1); let res = host.bls12_381_g2_mul(lhs, rhs.into())?; assert_eq!( @@ -915,9 +1164,9 @@ fn g2_mul() -> Result<(), HostError> { } // 4. associative P * a * b = P * b * a { - let p = sample_g2(&host)?; - let a = sample_fr(&host)?; - let b = sample_fr(&host)?; + let p = sample_g2(&host, &mut rng)?; + let a = sample_fr(&host, &mut rng)?; + let b = sample_fr(&host, &mut rng)?; let pa = host.bls12_381_g2_mul(p, a)?; let pab = host.bls12_381_g2_mul(pa, b)?; let pb = host.bls12_381_g2_mul(p, b)?; @@ -932,6 +1181,7 @@ fn g2_mul() -> Result<(), HostError> { #[test] fn g2_msm() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); let host = observe_host!(Host::test_host()); host.enable_debug()?; // vector lengths are zero @@ -945,8 +1195,8 @@ fn g2_msm() -> Result<(), HostError> { } // vector lengths not equal { - let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2)?; - let vs = sample_fr_vec(&host, 3)?; + let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2, &mut rng)?; + let vs = sample_fr_vec(&host, 3, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_g2_msm(vp, vs), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -955,11 +1205,11 @@ fn g2_msm() -> Result<(), HostError> { // vector g2 not valid { let vp = host.vec_new_from_slice(&[ - sample_g2(&host)?.to_val(), - invalid_g2(&host, InvalidPointTypes::PointNotInSubgroup)?.to_val(), - sample_g2(&host)?.to_val(), + sample_g2(&host, &mut rng)?.to_val(), + invalid_g2(&host, InvalidPointTypes::PointNotInSubgroup, &mut rng)?.to_val(), + sample_g2(&host, &mut rng)?.to_val(), ])?; - let vs = sample_fr_vec(&host, 3)?; + let vs = sample_fr_vec(&host, 3, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_g2_msm(vp, vs), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -968,7 +1218,7 @@ fn g2_msm() -> Result<(), HostError> { // vector of zero points result zero { let vp = host.vec_new_from_slice(&[g2_zero(&host)?.to_val(); 3])?; - let vs = sample_fr_vec(&host, 3)?; + let vs = sample_fr_vec(&host, 3, &mut rng)?; let res = host.bls12_381_g2_msm(vp, vs)?; assert_eq!( host.obj_cmp(res.into(), g2_zero(&host)?.into())?, @@ -977,7 +1227,7 @@ fn g2_msm() -> Result<(), HostError> { } // vector of zero scalars result in zero point { - let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3)?; + let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3, &mut rng)?; let vs = host.vec_new_from_slice(&[U256Val::from_u32(0).to_val(); 3])?; let res = host.bls12_381_g2_msm(vp, vs)?; assert_eq!( @@ -987,7 +1237,7 @@ fn g2_msm() -> Result<(), HostError> { } // 6. g2 * (1) + g2 (-1) = 0 { - let pt = sample_g2(&host)?; + let pt = sample_g2(&host, &mut rng)?; let zero = g2_zero(&host)?; assert_ne!( host.obj_cmp(pt.into(), zero.into())?, @@ -1005,16 +1255,16 @@ fn g2_msm() -> Result<(), HostError> { // 7. associative: shuffle points orders results stay the same { let mut vp = vec![ - sample_g2(&host)?.to_val(), - sample_g2(&host)?.to_val(), - sample_g2(&host)?.to_val(), - sample_g2(&host)?.to_val(), + sample_g2(&host, &mut rng)?.to_val(), + sample_g2(&host, &mut rng)?.to_val(), + sample_g2(&host, &mut rng)?.to_val(), + sample_g2(&host, &mut rng)?.to_val(), ]; let mut vs = vec![ - sample_fr(&host)?.to_val(), - sample_fr(&host)?.to_val(), - sample_fr(&host)?.to_val(), - sample_fr(&host)?.to_val(), + sample_fr(&host, &mut rng)?.to_val(), + sample_fr(&host, &mut rng)?.to_val(), + sample_fr(&host, &mut rng)?.to_val(), + sample_fr(&host, &mut rng)?.to_val(), ]; let ref_res = host.bls12_381_g2_msm(host.vec_new_from_slice(&vp)?, host.vec_new_from_slice(&vs)?)?; @@ -1045,8 +1295,8 @@ fn g2_msm() -> Result<(), HostError> { // 8. msm result is same as invidial mul and add { host.budget_ref().reset_default()?; - let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 5)?; - let vs = sample_fr_vec(&host, 5)?; + let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 5, &mut rng)?; + let vs = sample_fr_vec(&host, 5, &mut rng)?; let ref_res = host.bls12_381_g2_msm(vp, vs)?; let mut res = g2_zero(&host)?; for i in 0..5 { @@ -1065,16 +1315,17 @@ fn g2_msm() -> Result<(), HostError> { #[test] fn map_fp2_to_g2() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); let host = observe_host!(Host::test_host()); host.enable_debug()?; // invalid fp2: wrong length { - let p1 = invalid_fp2(&host, InvalidPointTypes::TooFewBytes)?; + let p1 = invalid_fp2(&host, InvalidPointTypes::TooFewBytes, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_map_fp2_to_g2(p1), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); - let p2 = invalid_fp2(&host, InvalidPointTypes::TooManyBytes)?; + let p2 = invalid_fp2(&host, InvalidPointTypes::TooManyBytes, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_map_fp2_to_g2(p2), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -1160,12 +1411,13 @@ fn hash_to_g2() -> Result<(), HostError> { // pairing checks #[test] fn pairing() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); let host = observe_host!(Host::test_host()); host.enable_debug()?; // 1. vector lengths don't match { - let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3)?; - let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2)?; + let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; + let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_multi_pairing_check(vp1, vp2), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -1173,8 +1425,8 @@ fn pairing() -> Result<(), HostError> { } // 2. vector length is 0 { - let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 0)?; - let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 0)?; + let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 0, &mut rng)?; + let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 0, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_multi_pairing_check(vp1, vp2), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -1182,13 +1434,13 @@ fn pairing() -> Result<(), HostError> { } // 3. any g1 is invalid { - let mut vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3)?; + let mut vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; vp1 = host.vec_put( vp1, U32Val::from(1), - sample_g1_not_in_subgroup(&host)?.to_val(), + sample_g1_not_in_subgroup(&host, &mut rng)?.to_val(), )?; - let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2)?; + let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_multi_pairing_check(vp1, vp2), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -1196,12 +1448,12 @@ fn pairing() -> Result<(), HostError> { } // 4. any g2 is invalid { - let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3)?; - let mut vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3)?; + let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; + let mut vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3, &mut rng)?; vp2 = host.vec_put( vp2, U32Val::from(1), - sample_g2_not_on_curve(&host)?.to_val(), + sample_g2_not_on_curve(&host, &mut rng)?.to_val(), )?; assert!(HostError::result_matches_err( host.bls12_381_multi_pairing_check(vp1, vp2), @@ -1211,10 +1463,10 @@ fn pairing() -> Result<(), HostError> { // 5. e(P, Q+R) = e(P, Q)*e(P, R) { host.budget_ref().reset_default()?; - let p = sample_g1(&host)?; + let p = sample_g1(&host, &mut rng)?; let neg_p = neg_g1(p, &host)?; - let q = sample_g2(&host)?; - let r = sample_g2(&host)?; + let q = sample_g2(&host, &mut rng)?; + let r = sample_g2(&host, &mut rng)?; let q_plus_r = host.bls12_381_g2_add(q, r)?; //check e(-P, Q+R)*e(P, Q)*e(P, R) == 1 @@ -1226,9 +1478,9 @@ fn pairing() -> Result<(), HostError> { // 6. e(P+S, R) = e(P, R)*e(S, R) { host.budget_ref().reset_default()?; - let p = sample_g1(&host)?; - let s = sample_g1(&host)?; - let r = sample_g2(&host)?; + let p = sample_g1(&host, &mut rng)?; + let s = sample_g1(&host, &mut rng)?; + let r = sample_g2(&host, &mut rng)?; let neg_r = neg_g2(r, &host)?; let p_plus_s = host.bls12_381_g1_add(p, s)?; // check e(P+S, -R) * e(P, R)*e(S, R) == 1 @@ -1241,11 +1493,11 @@ fn pairing() -> Result<(), HostError> { // 7. e([a]P, [b]Q) = e([b]P, [a]Q) = e([ab]P, Q)= e(P, [ab]Q) { host.budget_ref().reset_default()?; - let a = sample_fr(&host)?; - let b = sample_fr(&host)?; - let p = sample_g1(&host)?; + let a = sample_fr(&host, &mut rng)?; + let b = sample_fr(&host, &mut rng)?; + let p = sample_g1(&host, &mut rng)?; let neg_p = neg_g1(p, &host)?; - let q = sample_g2(&host)?; + let q = sample_g2(&host, &mut rng)?; let neg_q = neg_g2(q, &host)?; let a_p = host.bls12_381_g1_mul(p, a)?; let b_p = host.bls12_381_g1_mul(p, b)?; diff --git a/soroban-env-host/src/test/budget_metering.rs b/soroban-env-host/src/test/budget_metering.rs index e9cc201ed..75a70e531 100644 --- a/soroban-env-host/src/test/budget_metering.rs +++ b/soroban-env-host/src/test/budget_metering.rs @@ -399,8 +399,10 @@ fn total_amount_charged_from_random_inputs() -> Result<(), HostError> { tracker.extend_from_slice(&[ (1, None), /* Bls12381EncodeFp */ (1, None), /* Bls12381DecodeFp */ - (1, None), /* Bls12381G1Validate */ - (1, None), /* Bls12381G2Validate */ + (1, None), /* Bls12381G1CheckPointOnCurve */ + (1, None), /* Bls12381G1CheckPointInSubgroup */ + (1, None), /* Bls12381G2CheckPointOnCurve */ + (1, None), /* Bls12381G2CheckPointInSubgroup */ (1, None), /* Bls12381G1ProjectiveToAffine */ (1, None), /* Bls12381G2ProjectiveToAffine */ (1, None), /* Bls12381G1Add */ @@ -436,7 +438,7 @@ fn total_amount_charged_from_random_inputs() -> Result<(), HostError> { let actual = format!("{:?}", host.as_budget()); let expected = expect![[r#" =============================================================================================================================================================================== - Cpu limit: 100000000; used: 71071093 + Cpu limit: 100000000; used: 71071547 Mem limit: 41943040; used: 733666 =============================================================================================================================================================================== CostType iterations input cpu_insns mem_bytes const_term_cpu lin_term_cpu const_term_mem lin_term_mem @@ -487,8 +489,10 @@ fn total_amount_charged_from_random_inputs() -> Result<(), HostError> { VerifyEcdsaSecp256r1Sig 1 None 3000906 0 3000906 0 0 0 Bls12381EncodeFp 1 None 661 0 661 0 0 0 Bls12381DecodeFp 1 None 985 0 985 0 0 0 - Bls12381G1Validate 1 None 732301 0 732301 0 0 0 - Bls12381G2Validate 1 None 1063432 0 1063432 0 0 0 + Bls12381G1CheckPointOnCurve 1 None 1934 0 1934 0 0 0 + Bls12381G1CheckPointInSubgroup 1 None 730510 0 730510 0 0 0 + Bls12381G2CheckPointOnCurve 1 None 5921 0 5921 0 0 0 + Bls12381G2CheckPointInSubgroup 1 None 1057822 0 1057822 0 0 0 Bls12381G1ProjectiveToAffine 1 None 92642 0 92642 0 0 0 Bls12381G2ProjectiveToAffine 1 None 100742 0 100742 0 0 0 Bls12381G1Add 1 None 7689 0 7689 0 0 0 @@ -510,8 +514,8 @@ fn total_amount_charged_from_random_inputs() -> Result<(), HostError> { Bls12381FrInv 1 None 35421 0 35421 0 0 0 =============================================================================================================================================================================== Internal details (diagnostics info, does not affect fees) - Total # times meter was called: 68 - Shadow cpu limit: 100000000; used: 71071093 + Total # times meter was called: 70 + Shadow cpu limit: 100000000; used: 71071547 Shadow mem limit: 41943040; used: 733666 =============================================================================================================================================================================== diff --git a/soroban-env-host/src/test/hostile.rs b/soroban-env-host/src/test/hostile.rs index e5746a774..7e42f2ae9 100644 --- a/soroban-env-host/src/test/hostile.rs +++ b/soroban-env-host/src/test/hostile.rs @@ -577,8 +577,10 @@ fn excessive_logging() -> Result<(), HostError> { VerifyEcdsaSecp256r1Sig 0 0 Bls12381EncodeFp 0 0 Bls12381DecodeFp 0 0 - Bls12381G1Validate 0 0 - Bls12381G2Validate 0 0 + Bls12381G1CheckPointOnCurve 0 0 + Bls12381G1CheckPointInSubgroup 0 0 + Bls12381G2CheckPointOnCurve 0 0 + Bls12381G2CheckPointInSubgroup 0 0 Bls12381G1ProjectiveToAffine 0 0 Bls12381G2ProjectiveToAffine 0 0 Bls12381G1Add 0 0 From f5e68d4c10d2ef8006369e5254b2fa57d80c9c07 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Fri, 13 Sep 2024 20:50:46 -0400 Subject: [PATCH 09/18] analysis panic condition for pairing function; add test for infinity --- .../22/test__bls12_381__pairing.json | 60 ++++++++++++++++++- soroban-env-host/src/crypto/bls12_381.rs | 34 +++++++++-- soroban-env-host/src/test/bls12_381.rs | 39 ++++++++++++ 3 files changed, 128 insertions(+), 5 deletions(-) diff --git a/soroban-env-host/observations/22/test__bls12_381__pairing.json b/soroban-env-host/observations/22/test__bls12_381__pairing.json index 969bcd043..67bad5244 100644 --- a/soroban-env-host/observations/22/test__bls12_381__pairing.json +++ b/soroban-env-host/observations/22/test__bls12_381__pairing.json @@ -118,5 +118,63 @@ " 116 call vec_len(Vec(obj#113))": "cpu:41777386, mem:3304", " 117 ret vec_len -> Ok(U32(4))": "cpu:41777508", " 118 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:76385043, mem:298181", - " 119 end": "cpu:76385043, mem:298181, prngs:-/-, objs:-/57@cba81af, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 119 call bytes_new_from_slice(96)": "cpu:661, mem:0", + " 120 ret bytes_new_from_slice -> Ok(Bytes(obj#115))": "cpu:1646, mem:176, objs:-/58@ac299a82", + " 121 call bytes_new_from_slice(96)": "cpu:2307", + " 122 ret bytes_new_from_slice -> Ok(Bytes(obj#117))": "cpu:3292, mem:352, objs:-/59@113198f9", + " 123 call bytes_new_from_slice(96)": "cpu:3953", + " 124 ret bytes_new_from_slice -> Ok(Bytes(obj#119))": "cpu:4938, mem:528, objs:-/60@37eadd60", + " 125 call vec_new_from_slice(3)": "", + " 126 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:6088, mem:632, objs:-/61@b3526a16", + " 127 call vec_put(Vec(obj#121), U32(1), Bytes(obj#123))": "cpu:8395, mem:808, objs:-/62@e4a76af5", + " 128 ret vec_put -> Ok(Vec(obj#125))": "cpu:9649, mem:912, objs:-/63@5b689763", + " 129 call bytes_new_from_slice(192)": "cpu:10310", + " 130 ret bytes_new_from_slice -> Ok(Bytes(obj#127))": "cpu:11319, mem:1184, objs:-/64@8aa5fc15", + " 131 call bytes_new_from_slice(192)": "cpu:11980", + " 132 ret bytes_new_from_slice -> Ok(Bytes(obj#129))": "cpu:12989, mem:1456, objs:-/65@b4fc63e0", + " 133 call bytes_new_from_slice(192)": "cpu:13650", + " 134 ret bytes_new_from_slice -> Ok(Bytes(obj#131))": "cpu:14659, mem:1728, objs:-/66@5c98ecb1", + " 135 call vec_new_from_slice(3)": "", + " 136 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:15809, mem:1832, objs:-/67@3f3912a7", + " 137 call bls12_381_multi_pairing_check(Vec(obj#125), Vec(obj#133))": "", + " 138 call vec_len(Vec(obj#125))": "cpu:16053", + " 139 ret vec_len -> Ok(U32(3))": "cpu:16175", + " 140 call vec_len(Vec(obj#133))": "cpu:2220131, mem:2136", + " 141 ret vec_len -> Ok(U32(3))": "cpu:2220253", + " 142 ret bls12_381_multi_pairing_check -> Ok(False)": "cpu:30815794, mem:223849", + " 143 call bytes_new_from_slice(96)": "cpu:661, mem:0", + " 144 ret bytes_new_from_slice -> Ok(Bytes(obj#135))": "cpu:1646, mem:176, objs:-/68@47cc533a", + " 145 call bytes_new_from_slice(96)": "cpu:2307", + " 146 ret bytes_new_from_slice -> Ok(Bytes(obj#137))": "cpu:3292, mem:352, objs:-/69@9420de5f", + " 147 call bytes_new_from_slice(96)": "cpu:3953", + " 148 ret bytes_new_from_slice -> Ok(Bytes(obj#139))": "cpu:4938, mem:528, objs:-/70@f09a5b7a", + " 149 call vec_new_from_slice(3)": "", + " 150 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:6088, mem:632, objs:-/71@71e61918", + " 151 call bytes_new_from_slice(192)": "cpu:6749", + " 152 ret bytes_new_from_slice -> Ok(Bytes(obj#143))": "cpu:7758, mem:904, objs:-/72@b2c885b9", + " 153 call bytes_new_from_slice(192)": "cpu:8419", + " 154 ret bytes_new_from_slice -> Ok(Bytes(obj#145))": "cpu:9428, mem:1176, objs:-/73@890ee9f4", + " 155 call bytes_new_from_slice(192)": "cpu:10089", + " 156 ret bytes_new_from_slice -> Ok(Bytes(obj#147))": "cpu:11098, mem:1448, objs:-/74@c894f888", + " 157 call vec_new_from_slice(3)": "", + " 158 ret vec_new_from_slice -> Ok(Vec(obj#149))": "cpu:12248, mem:1552, objs:-/75@6f0bc56a", + " 159 call vec_put(Vec(obj#149), U32(2), Bytes(obj#151))": "cpu:15901, mem:1824, objs:-/76@85e20168", + " 160 ret vec_put -> Ok(Vec(obj#153))": "cpu:17155, mem:1928, objs:-/77@35e77666", + " 161 call bls12_381_multi_pairing_check(Vec(obj#141), Vec(obj#153))": "", + " 162 call vec_len(Vec(obj#141))": "cpu:17399", + " 163 ret vec_len -> Ok(U32(3))": "cpu:17521", + " 164 call vec_len(Vec(obj#153))": "cpu:2221477, mem:2232", + " 165 ret vec_len -> Ok(U32(3))": "cpu:2221599", + " 166 ret bls12_381_multi_pairing_check -> Ok(False)": "cpu:30817140, mem:223945", + " 167 call vec_new_from_slice(5)": "cpu:11535, mem:880, objs:-/82@40297403", + " 168 ret vec_new_from_slice -> Ok(Vec(obj#165))": "cpu:12811, mem:1000, objs:-/83@2d838f8e", + " 169 call vec_new_from_slice(5)": "cpu:31076, mem:2360, objs:-/88@c33dc4c0", + " 170 ret vec_new_from_slice -> Ok(Vec(obj#177))": "cpu:32352, mem:2480, objs:-/89@cb153807", + " 171 call bls12_381_multi_pairing_check(Vec(obj#165), Vec(obj#177))": "", + " 172 call vec_len(Vec(obj#165))": "cpu:32596", + " 173 ret vec_len -> Ok(U32(5))": "cpu:32718", + " 174 call vec_len(Vec(obj#177))": "cpu:3705648, mem:2976", + " 175 ret vec_len -> Ok(U32(5))": "cpu:3705770", + " 176 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:44325299, mem:371018", + " 177 end": "cpu:44325299, mem:371018, prngs:-/-, objs:-/89@cb153807, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/src/crypto/bls12_381.rs b/soroban-env-host/src/crypto/bls12_381.rs index 178c824f4..c9aab90dc 100644 --- a/soroban-env-host/src/crypto/bls12_381.rs +++ b/soroban-env-host/src/crypto/bls12_381.rs @@ -641,14 +641,40 @@ impl Host { ); } self.charge_budget(ContractCostType::Bls12381Pairing, Some(vp1.len() as u64))?; - // This is doing exact same as `Bls12_381::pairing(p, q)`, but avoids - // the `unwrap` + + // This calls into `Bls12::multi_miller_loop`, which just calls + // `ark_ec::models::bls12::Bls12Config::multi_miller_loop` with specific + // parameters defined in `ark_bls12_381::curves`. + // + // Panic analysis: + // + // The following potential panic conditions could exist: + // 1. if two input vector lengths are not equal. There is a `zip_eq` + // which panics if the length of the two vectors are not equal. This is + // weeded out up front. + // + // 2. `coeffs.next().unwrap()`. This occurs when the algorithm Loops + // over pairs of `(a: G1Affine, b: G2Affine)`, converting them into + // `Vec<(G1Prepared, G2Preared::EllCoeff)>`, the latter contains + // three elements of Fp2. For each pair, the coeffs.next() can at most + // be called twice, when the bit being looped over in `Config::X` is + // set. So this panic cannot happen. + // + // 3. if any of the G1Affine point is infinity. The ell() function which + // calls p.xy().unwrap(), which is when the point is infinity. This + // condition also cannot happen because when the pairs are generated, + // any pair containing a zero point is filtered. + // + // The above analysis is best effort to weed out panics from the source, + // however the algorithm is quite involved. So we cannot be 100% certain + // every panic condition has been excluded. let mlo = Bls12_381::multi_miller_loop(vp1, vp2); + // final_exponentiation returning None means the `mlo.0.is_zero()` Bls12_381::final_exponentiation(mlo).ok_or_else(|| { self.err( ScErrorType::Crypto, - ScErrorCode::InternalError, - "fail to perform final exponentiation", + ScErrorCode::InvalidInput, + "final_exponentiation has failed, most likely multi_miller_loop produced infinity", &[], ) }) diff --git a/soroban-env-host/src/test/bls12_381.rs b/soroban-env-host/src/test/bls12_381.rs index c7e3d574a..51d7a8007 100644 --- a/soroban-env-host/src/test/bls12_381.rs +++ b/soroban-env-host/src/test/bls12_381.rs @@ -322,6 +322,22 @@ fn sample_host_vec( host.vec_new_from_slice(&vals) } +fn zero_g1_vec(host: &Host, vec_len: usize) -> Result { + let vals: Vec = (0..vec_len) + .into_iter() + .map(|_| g1_zero(host).unwrap().to_val()) + .collect(); + host.vec_new_from_slice(&vals) +} + +fn zero_g2_vec(host: &Host, vec_len: usize) -> Result { + let vals: Vec = (0..vec_len) + .into_iter() + .map(|_| g2_zero(host).unwrap().to_val()) + .collect(); + host.vec_new_from_slice(&vals) +} + fn sample_fr_vec(host: &Host, vec_len: usize, rng: &mut StdRng) -> Result { let vals: Vec = (0..vec_len) .into_iter() @@ -1514,6 +1530,29 @@ fn pairing() -> Result<(), HostError> { let res = host.bls12_381_multi_pairing_check(g1_vec, g2_vec)?; assert!(res.as_val().is_true()) } + // 8. any of g1 point is infinity + { + host.budget_ref().reset_default()?; + let mut vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; + vp1 = host.vec_put(vp1, U32Val::from(1), g1_zero(&host)?.to_val())?; + let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3, &mut rng)?; + assert!(host.bls12_381_multi_pairing_check(vp1, vp2).is_ok()); + } + // 9. any of g2 point is infinity + { + host.budget_ref().reset_default()?; + let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; + let mut vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3, &mut rng)?; + vp2 = host.vec_put(vp2, U32Val::from(2), g2_zero(&host)?.to_val())?; + assert!(host.bls12_381_multi_pairing_check(vp1, vp2).is_ok()); + } + // 10. entire vector is zero + { + host.budget_ref().reset_default()?; + let vp1 = zero_g1_vec(&host, 5)?; + let vp2 = zero_g2_vec(&host, 5)?; + assert!(host.bls12_381_multi_pairing_check(vp1, vp2).is_ok()); + } Ok(()) } From a83cefbb259ad3e92a1712cd52aa8b774f7934ff Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Sun, 15 Sep 2024 09:04:00 -0400 Subject: [PATCH 10/18] Elaborate on panic conditions of map-to-curve; turn them into templates --- .../benches/common/cost_types/bls12_381.rs | 8 +- .../src/cost_runner/cost_types/bls12_381.rs | 28 ++-- soroban-env-host/src/crypto/bls12_381.rs | 143 ++++++++++-------- soroban-env-host/src/host.rs | 10 +- 4 files changed, 104 insertions(+), 85 deletions(-) diff --git a/soroban-env-host/benches/common/cost_types/bls12_381.rs b/soroban-env-host/benches/common/cost_types/bls12_381.rs index dbe888a2e..f4c07a20b 100644 --- a/soroban-env-host/benches/common/cost_types/bls12_381.rs +++ b/soroban-env-host/benches/common/cost_types/bls12_381.rs @@ -225,7 +225,7 @@ impl HostCostMeasurement for Bls12381MapFpToG1Measure { fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381MapFpToG1Sample { let fp = Fq::rand(rng); - Bls12381MapFpToG1Sample(fp) + Bls12381MapFpToG1Sample(fp, Bls12381MapFpToG1) } } @@ -242,7 +242,7 @@ impl HostCostMeasurement for Bls12381HashToG1Measure { .to_vec(); let mut msg = vec![0u8; len as usize]; rng.fill(msg.as_mut_slice()); - Bls12381HashToG1Sample(domain, msg) + Bls12381HashToG1Sample(domain, msg, Bls12381HashToG1) } } @@ -308,7 +308,7 @@ impl HostCostMeasurement for Bls12381MapFp2ToG2Measure { fn new_random_case(_host: &Host, rng: &mut StdRng, _input: u64) -> Bls12381MapFp2ToG2Sample { let fp2 = Fq2::rand(rng); - Bls12381MapFp2ToG2Sample(fp2) + Bls12381MapFp2ToG2Sample(fp2, Bls12381MapFp2ToG2) } } @@ -325,7 +325,7 @@ impl HostCostMeasurement for Bls12381HashToG2Measure { .to_vec(); let mut msg = vec![0u8; len as usize]; rng.fill(msg.as_mut_slice()); - Bls12381HashToG2Sample(domain, msg) + Bls12381HashToG2Sample(domain, msg, Bls12381HashToG2) } } diff --git a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs index 06c1f3a5f..301791037 100644 --- a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs +++ b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs @@ -53,9 +53,9 @@ pub struct Bls12381G1MulSample(pub G1Affine, pub Fr); #[derive(Clone)] pub struct Bls12381G1MsmSample(pub Vec, pub Vec); #[derive(Clone)] -pub struct Bls12381MapFpToG1Sample(pub Fq); +pub struct Bls12381MapFpToG1Sample(pub Fq, pub ContractCostType); #[derive(Clone)] -pub struct Bls12381HashToG1Sample(pub Vec, pub Vec); +pub struct Bls12381HashToG1Sample(pub Vec, pub Vec, pub ContractCostType); #[derive(Clone)] pub struct Bls12381G2ProjectiveToAffineSample(pub G2Projective); #[derive(Clone)] @@ -65,9 +65,9 @@ pub struct Bls12381G2MulSample(pub G2Affine, pub Fr); #[derive(Clone)] pub struct Bls12381G2MsmSample(pub Vec, pub Vec); #[derive(Clone)] -pub struct Bls12381MapFp2ToG2Sample(pub Fq2); +pub struct Bls12381MapFp2ToG2Sample(pub Fq2, pub ContractCostType); #[derive(Clone)] -pub struct Bls12381HashToG2Sample(pub Vec, pub Vec); +pub struct Bls12381HashToG2Sample(pub Vec, pub Vec, pub ContractCostType); #[derive(Clone)] pub struct Bls12381PairingSample(pub Vec, pub Vec); #[derive(Clone)] @@ -122,10 +122,11 @@ impl_const_cost_runner_for_bls_consume_sample!( impl_const_cost_runner_for_bls_consume_sample!( Bls12381MapFpToG1Run, Bls12381MapFpToG1, - map_fp_to_g1_internal, + map_to_curve, Bls12381MapFpToG1Sample, G1Affine, - fq + fq, + ty ); impl_const_cost_runner_for_bls_consume_sample!( @@ -157,10 +158,11 @@ impl_const_cost_runner_for_bls_consume_sample!( impl_const_cost_runner_for_bls_consume_sample!( Bls12381MapFp2ToG2Run, Bls12381MapFp2ToG2, - map_fp2_to_g2_internal, + map_to_curve, Bls12381MapFp2ToG2Sample, G2Affine, - fq2 + fq2, + ty ); impl_const_cost_runner_for_bls_consume_sample!( Bls12381FrFromU256Run, @@ -182,20 +184,22 @@ impl_const_cost_runner_for_bls_consume_sample!( impl_lin_cost_runner_for_bls_deref_sample!( Bls12381HashToG1Run, Bls12381HashToG1, - hash_to_g1_internal, + hash_to_curve, Bls12381HashToG1Sample, G1Affine, domain, - msg + msg, + ty ); impl_lin_cost_runner_for_bls_deref_sample!( Bls12381HashToG2Run, Bls12381HashToG2, - hash_to_g2_internal, + hash_to_curve, Bls12381HashToG2Sample, G2Affine, domain, - msg + msg, + ty ); impl_lin_cost_runner_for_bls_deref_sample!( diff --git a/soroban-env-host/src/crypto/bls12_381.rs b/soroban-env-host/src/crypto/bls12_381.rs index c9aab90dc..c6554c698 100644 --- a/soroban-env-host/src/crypto/bls12_381.rs +++ b/soroban-env-host/src/crypto/bls12_381.rs @@ -6,18 +6,14 @@ use crate::{ U256Small, U256Val, Val, VecObject, U256, }; use ark_bls12_381::{ - g1, g2, Bls12_381, Fq, Fq12, Fq2, Fr, G1Affine, G1Projective, G2Affine, G2Projective, + Bls12_381, Fq, Fq12, Fq2, Fr, G1Affine, G1Projective, G2Affine, G2Projective, }; use ark_ec::{ hashing::{ - curve_maps::wb::WBMap, + curve_maps::wb::{WBConfig, WBMap}, map_to_curve_hasher::{MapToCurve, MapToCurveBasedHasher}, HashToCurve, - }, - pairing::{Pairing, PairingOutput}, - scalar_mul::variable_base::VariableBaseMSM, - short_weierstrass::{Affine, Projective, SWCurveConfig}, - CurveGroup, + }, pairing::{Pairing, PairingOutput}, scalar_mul::variable_base::VariableBaseMSM, short_weierstrass::{Affine, Projective, SWCurveConfig}, AffineRepr, CurveGroup }; use ark_ff::{field_hashers::DefaultFieldHasher, BigInteger, Field, PrimeField}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Validate}; @@ -475,55 +471,6 @@ impl Host { Ok(G1Projective::msm_unchecked(points, scalars)) } - pub(crate) fn map_fp_to_g1_internal(&self, fp: Fq) -> Result { - self.charge_budget(ContractCostType::Bls12381MapFpToG1, None)?; - let mapper = WBMap::::new().map_err(|e| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InternalError, - format!("hash-to-curve error {e}").as_str(), - &[], - ) - })?; - mapper.map_to_curve(fp).map_err(|e| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InternalError, - format!("hash-to-curve error {e}").as_str(), - &[], - ) - }) - } - - pub(crate) fn hash_to_g1_internal( - &self, - domain: &[u8], - msg: &[u8], - ) -> Result { - self.charge_budget(ContractCostType::Bls12381HashToG1, Some(msg.len() as u64))?; - let g1_mapper = MapToCurveBasedHasher::< - Projective, - DefaultFieldHasher, - WBMap, - >::new(domain) - .map_err(|e| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InternalError, - format!("hash-to-curve error {e}").as_str(), - &[], - ) - })?; - g1_mapper.hash(msg.as_ref()).map_err(|e| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InternalError, - format!("hash-to-curve error {e}").as_str(), - &[], - ) - }) - } - pub(crate) fn g2_vec_from_vecobj(&self, vp: VecObject) -> Result, HostError> { let len: u32 = self.vec_len(vp)?.into(); self.charge_budget( @@ -580,9 +527,26 @@ impl Host { Ok(G2Projective::msm_unchecked(points, scalars)) } - pub(crate) fn map_fp2_to_g2_internal(&self, fp: Fq2) -> Result { - self.charge_budget(ContractCostType::Bls12381MapFp2ToG2, None)?; - let mapper = WBMap::::new().map_err(|e| { + pub(crate) fn map_to_curve(&self, fp: as AffineRepr>::BaseField, ty: ContractCostType) -> Result, HostError> { + self.charge_budget(ty, None)?; + + // The `WBMap::new()` first calls + // `P::ISOGENY_MAP.apply(GENERATOR)` which returns error if the result + // point is not on curve. This should not happen if the map constants + // have been correctly defined. otherwise it would be an internal error + // since it's a bug in the library implementation. + // + // Then it returns `WBMap`, which wraps a `SWUMap

` where P is the + // `ark_bls12_381::curves::g2_swu_iso::SwuIsoConfig`. + // + // Potential panic condition: `SWUMap::new().unwrap()` + // + // The `SWUMap::new()` function performs some validation on the static + // parameters `ZETA`, `COEFF_A`, `COEFF_B`, all of which are statically + // defined in `ark_bls12_381::curves::g1_swu_iso` and `g2_swu_iso`. + // Realistically this panic cannot occur, otherwise it will panic every + // time including during tests + let mapper = WBMap::

::new().map_err(|e| { self.err( ScErrorType::Crypto, ScErrorCode::InternalError, @@ -590,6 +554,21 @@ impl Host { &[], ) })?; + + // The `SWUMap::map_to_curve` function contains several panic conditions + // 1. assert!(!div3.is_zero()) + // 2. gx1.sqrt().expect() + // 3. zeta_gx1.sqrt().expect() + // 4. assert!(point_on_curve.is_on_curve()) + // + // While all of these should theoretically just be debug assertions that + // can't happen if the map parameters are correctly defined (several of + // these have recently been downgraded to debug_assert, e.g see + // https://github.com/arkworks-rs/algebra/pull/659#discussion_r1450808159), + // we cannot guaruantee with 100% confidence these panics will never + // happen. + // + // Otherwise, this function should never Err. mapper.map_to_curve(fp).map_err(|e| { self.err( ScErrorType::Crypto, @@ -600,16 +579,24 @@ impl Host { }) } - pub(crate) fn hash_to_g2_internal( + pub(crate) fn hash_to_curve( &self, domain: &[u8], msg: &[u8], - ) -> Result { - self.charge_budget(ContractCostType::Bls12381HashToG2, Some(msg.len() as u64))?; + ty: &ContractCostType + ) -> Result, HostError> { + self.charge_budget(*ty, Some(msg.len() as u64))?; + + // The `new` function here constructs a DefaultFieldHasher and a WBMap. + // - The DefaultFieldHasher::new() function creates an ExpanderXmd with + // Sha256. This cannot fail or panic. + // - Construction of WBMap follows the exact same analysis as map_to_curve + // function earlier. + // This function cannot realistically produce an error or panic. let mapper = MapToCurveBasedHasher::< - Projective, + Projective

, DefaultFieldHasher, - WBMap, + WBMap

, >::new(domain) .map_err(|e| { self.err( @@ -619,6 +606,34 @@ impl Host { &[], ) })?; + + // `ark_ec::hashing::map_to_curve_hasher::MapToCurveBasedHasher::hash` + // contains the following calls + // - `DefaultFieldHasher::hash_to_field` + // - `SWUMap::map_to_curve` + // - `clear_cofactor`. This cannot fail or panic. + // + // `hash_to_field` calls the ExpanderXmd::expand function, there are two + // assertions on the length of bytes produced by the hash function. Both + // of these cannot happen because the output size can be computed + // analytically. Let's use G2: + // - `block_size = 384 (Fp bit size) + 128 (security padding) / 8 = 64` + // - `len_in_bytes = 2 (number of elements to produce) * 2 (extention + // degree of Fp2) * 64 (block_size) = 256` + // - `ell = 256 (len_in_bytes) / 32 (sha256 output size) = 8` + // + // # Assertion #1. ell <= 255, which is saying the expander cannot expand + // up to a certain length. in our case ell == 8. + // # Assertion #2. len_in_bytes < 2^16, which is clearly true as well. + // + // The rest is just hashing, dividing bytes into element size, and + // producing field elements from bytes. None of these can panic or + // error. + // + // The only panic conditions we cannot 100% exclude comes from + // `map_to_curve`, see previous analysis. + // + // This function should not Err. mapper.hash(msg.as_ref()).map_err(|e| { self.err( ScErrorType::Crypto, diff --git a/soroban-env-host/src/host.rs b/soroban-env-host/src/host.rs index d519b82b1..a7be6f999 100644 --- a/soroban-env-host/src/host.rs +++ b/soroban-env-host/src/host.rs @@ -2978,7 +2978,7 @@ impl VmCallerEnv for Host { fp: BytesObject, ) -> Result { let fp = self.fp_deserialize_from_bytesobj(fp)?; - let g1 = self.map_fp_to_g1_internal(fp)?; + let g1 = self.map_to_curve(fp, ContractCostType::Bls12381MapFpToG1)?; self.g1_affine_serialize_uncompressed(g1) } @@ -3002,7 +3002,7 @@ impl VmCallerEnv for Host { &[], )); } - self.hash_to_g1_internal(dst.as_slice(), msg.as_slice()) + self.hash_to_curve(dst.as_slice(), msg.as_slice(), &ContractCostType::Bls12381HashToG1) }) })?; self.g1_affine_serialize_uncompressed(g1) @@ -3070,8 +3070,8 @@ impl VmCallerEnv for Host { fp2: BytesObject, ) -> Result { let fp2 = self.fp2_deserialize_from_bytesobj(fp2)?; - let g2 = self.map_fp2_to_g2_internal(fp2)?; - self.g2_affine_serialize_uncompressed(g2) + let g2 = self.map_to_curve(fp2, ContractCostType::Bls12381MapFp2ToG2)?; + self.g2_affine_serialize_uncompressed(&g2) } fn bls12_381_hash_to_g2( @@ -3094,7 +3094,7 @@ impl VmCallerEnv for Host { &[], )); } - self.hash_to_g2_internal(dst.as_slice(), msg.as_slice()) + self.hash_to_curve(dst.as_slice(), msg.as_slice(), &ContractCostType::Bls12381HashToG2) }) })?; self.g2_affine_serialize_uncompressed(g2) From 82d7ad4a5f5db3220293835e4778751c17b695de Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Mon, 16 Sep 2024 10:48:07 -0400 Subject: [PATCH 11/18] turn some more deserialization functions into generic; add roundtrip tests Add serialization roundtrip tests --- .../22/test__bls12_381__g1_msm.json | 282 +++++++-------- .../22/test__bls12_381__g2_msm.json | 236 ++++++------- .../22/test__bls12_381__map_fp2_to_g2.json | 12 +- .../22/test__bls12_381__map_fp_to_g1.json | 6 +- .../22/test__bls12_381__pairing.json | 188 +++++----- ...s12_381__test_serialization_roundtrip.json | 44 +++ .../src/cost_runner/cost_types/bls12_381.rs | 5 +- soroban-env-host/src/crypto/bls12_381.rs | 323 ++++++++++-------- soroban-env-host/src/host.rs | 18 +- soroban-env-host/src/test/bls12_381.rs | 233 ++++++++++--- 10 files changed, 781 insertions(+), 566 deletions(-) create mode 100644 soroban-env-host/observations/22/test__bls12_381__test_serialization_roundtrip.json diff --git a/soroban-env-host/observations/22/test__bls12_381__g1_msm.json b/soroban-env-host/observations/22/test__bls12_381__g1_msm.json index e80e531ad..6cf77e292 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g1_msm.json +++ b/soroban-env-host/observations/22/test__bls12_381__g1_msm.json @@ -6,88 +6,88 @@ " 4 ret vec_new -> Ok(Vec(obj#3))": "cpu:1002, mem:128, objs:-/2@14339b3d", " 5 call bls12_381_g1_msm(Vec(obj#1), Vec(obj#3))": "", " 6 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1246", - " 7 call bytes_new_from_slice(96)": "cpu:1907", - " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:2892, mem:304, objs:-/3@f987415", - " 9 call bytes_new_from_slice(96)": "cpu:3553", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:4538, mem:480, objs:-/4@f550cb25", + " 7 call bytes_new_from_slice(96)": "cpu:2568", + " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:3553, mem:304, objs:-/3@f987415", + " 9 call bytes_new_from_slice(96)": "cpu:4875", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:5860, mem:480, objs:-/4@f550cb25", " 11 call vec_new_from_slice(2)": "", - " 12 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:5625, mem:576, objs:-/5@27393823", + " 12 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:6947, mem:576, objs:-/5@27393823", " 13 call obj_from_u256_pieces(2515383451482204963, 3798294199605637777, 9874121741094930036, 5634530503602181405)": "", - " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:6126, mem:640, objs:-/6@3f49b7c2", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:7448, mem:640, objs:-/6@3f49b7c2", " 15 call obj_from_u256_pieces(16161944172311556037, 9348631246554537043, 7119928359786205760, 2656543668720567255)": "", - " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:6627, mem:704, objs:-/7@2ed0a706", + " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:7949, mem:704, objs:-/7@2ed0a706", " 17 call obj_from_u256_pieces(9580499452994475139, 12513764331848801915, 17507952593492800906, 8551509165293236575)": "", - " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:7128, mem:768, objs:-/8@43230a4b", + " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:8450, mem:768, objs:-/8@43230a4b", " 19 call vec_new_from_slice(3)": "", - " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:8278, mem:872, objs:-/9@ac0e3b8c", + " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:9600, mem:872, objs:-/9@ac0e3b8c", " 21 call bls12_381_g1_msm(Vec(obj#9), Vec(obj#17))": "", - " 22 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:8522", - " 23 call vec_new_from_slice(3)": "cpu:17750, mem:1576, objs:-/13@561be3e7", - " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:18900, mem:1680, objs:-/14@c49c6ff2", + " 22 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:9844", + " 23 call vec_new_from_slice(3)": "cpu:19072, mem:1576, objs:-/13@561be3e7", + " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:20222, mem:1680, objs:-/14@c49c6ff2", " 25 call obj_from_u256_pieces(11943197420912477102, 14634913559439210090, 15499375484791752188, 12925620935896195067)": "", - " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:19401, mem:1744, objs:-/15@3da47540", + " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:20723, mem:1744, objs:-/15@3da47540", " 27 call obj_from_u256_pieces(5622195026378228418, 9560417407481221846, 8127851712333271140, 4557073498745857109)": "", - " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:19902, mem:1808, objs:-/16@d07ec2c0", + " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:21224, mem:1808, objs:-/16@d07ec2c0", " 29 call obj_from_u256_pieces(12072680829433668232, 2892971212195715449, 599041459787463398, 17399677212821182399)": "", - " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:20403, mem:1872, objs:-/17@2d23aeeb", + " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:21725, mem:1872, objs:-/17@2d23aeeb", " 31 call vec_new_from_slice(3)": "", - " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:21553, mem:1976, objs:-/18@9ffeec8c", + " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:22875, mem:1976, objs:-/18@9ffeec8c", " 33 call bls12_381_g1_msm(Vec(obj#27), Vec(obj#35))": "", - " 34 call vec_len(Vec(obj#27))": "cpu:21797", - " 35 ret vec_len -> Ok(U32(3))": "cpu:21919", - " 36 call vec_len(Vec(obj#35))": "cpu:1491400, mem:2280", - " 37 ret vec_len -> Ok(U32(3))": "cpu:1491522", - " 38 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1498194, mem:2392", - " 39 call vec_new_from_slice(3)": "cpu:1500501, mem:2568, objs:-/19@42952458", - " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:1501651, mem:2672, objs:-/20@a0bd3ff", + " 34 call vec_len(Vec(obj#27))": "cpu:23119", + " 35 ret vec_len -> Ok(U32(3))": "cpu:23241", + " 36 call vec_len(Vec(obj#35))": "cpu:1492722, mem:2280", + " 37 ret vec_len -> Ok(U32(3))": "cpu:1492844", + " 38 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1499516, mem:2392", + " 39 call vec_new_from_slice(3)": "cpu:1501823, mem:2568, objs:-/19@42952458", + " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:1502973, mem:2672, objs:-/20@a0bd3ff", " 41 call obj_from_u256_pieces(9030446305465662626, 6854247188031249140, 3026823929057343686, 5018424221301027056)": "", - " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:1502152, mem:2736, objs:-/21@5d27dd7c", + " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:1503474, mem:2736, objs:-/21@5d27dd7c", " 43 call obj_from_u256_pieces(17540322581155608940, 9042723259083353182, 9336846948556567215, 15266620357577816939)": "", - " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:1502653, mem:2800, objs:-/22@32305aea", + " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:1503975, mem:2800, objs:-/22@32305aea", " 45 call obj_from_u256_pieces(2273584195287690476, 203274327658109228, 545101579437905274, 9593152778203258958)": "", - " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:1503154, mem:2864, objs:-/23@d5672c27", + " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:1504476, mem:2864, objs:-/23@d5672c27", " 47 call vec_new_from_slice(3)": "", - " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:1504304, mem:2968, objs:-/24@f299ae2e", + " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:1505626, mem:2968, objs:-/24@f299ae2e", " 49 call bls12_381_g1_msm(Vec(obj#39), Vec(obj#47))": "", - " 50 call vec_len(Vec(obj#39))": "cpu:1504548", - " 51 ret vec_len -> Ok(U32(3))": "cpu:1504670", - " 52 call vec_len(Vec(obj#47))": "cpu:3708626, mem:3272", - " 53 ret vec_len -> Ok(U32(3))": "cpu:3708748", - " 54 ret bls12_381_g1_msm -> Ok(Bytes(obj#49))": "cpu:8496472, mem:121366, objs:-/25@e3c1a53", - " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:8498779, mem:121542, objs:-/26@f6f4e327", - " 56 ret obj_cmp -> Ok(0)": "cpu:8499079", - " 57 call bytes_new_from_slice(96)": "cpu:8499740", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:8500725, mem:121718, objs:-/27@de36fc43", - " 59 call bytes_new_from_slice(96)": "cpu:8501386", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:8502371, mem:121894, objs:-/28@d5575135", - " 61 call bytes_new_from_slice(96)": "cpu:8503032", - " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:8504017, mem:122070, objs:-/29@75b6bfd6", + " 50 call vec_len(Vec(obj#39))": "cpu:1505870", + " 51 ret vec_len -> Ok(U32(3))": "cpu:1505992", + " 52 call vec_len(Vec(obj#47))": "cpu:3709948, mem:3272", + " 53 ret vec_len -> Ok(U32(3))": "cpu:3710070", + " 54 ret bls12_381_g1_msm -> Ok(Bytes(obj#49))": "cpu:8497794, mem:121366, objs:-/25@e3c1a53", + " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:8500101, mem:121542, objs:-/26@f6f4e327", + " 56 ret obj_cmp -> Ok(0)": "cpu:8500401", + " 57 call bytes_new_from_slice(96)": "cpu:8501723", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:8502708, mem:121718, objs:-/27@de36fc43", + " 59 call bytes_new_from_slice(96)": "cpu:8504030", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:8505015, mem:121894, objs:-/28@d5575135", + " 61 call bytes_new_from_slice(96)": "cpu:8506337", + " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:8507322, mem:122070, objs:-/29@75b6bfd6", " 63 call vec_new_from_slice(3)": "", - " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:8505167, mem:122174, objs:-/30@a0da8ba2", + " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:8508472, mem:122174, objs:-/30@a0da8ba2", " 65 call vec_new_from_slice(3)": "", - " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:8506134, mem:122278, objs:-/31@3969541b", + " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:8509439, mem:122278, objs:-/31@3969541b", " 67 call bls12_381_g1_msm(Vec(obj#59), Vec(obj#61))": "", - " 68 call vec_len(Vec(obj#59))": "cpu:8506378", - " 69 ret vec_len -> Ok(U32(3))": "cpu:8506500", - " 70 call vec_len(Vec(obj#61))": "cpu:10710456, mem:122582", - " 71 ret vec_len -> Ok(U32(3))": "cpu:10710578", - " 72 ret bls12_381_g1_msm -> Ok(Bytes(obj#63))": "cpu:15498119, mem:240676, objs:-/32@4cf72b63", - " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:15500426, mem:240852, objs:-/33@2b1e328c", - " 74 ret obj_cmp -> Ok(0)": "cpu:15500726", - " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:15505340, mem:241204, objs:-/35@c5e3864a", - " 76 ret obj_cmp -> Ok(-1)": "cpu:15505640", - " 77 call vec_new_from_slice(2)": "cpu:16242422, mem:241380, objs:-/36@48960b91", - " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:16243509, mem:241476, objs:-/37@9fba2a30", + " 68 call vec_len(Vec(obj#59))": "cpu:8509683", + " 69 ret vec_len -> Ok(U32(3))": "cpu:8509805", + " 70 call vec_len(Vec(obj#61))": "cpu:10713761, mem:122582", + " 71 ret vec_len -> Ok(U32(3))": "cpu:10713883", + " 72 ret bls12_381_g1_msm -> Ok(Bytes(obj#63))": "cpu:15501424, mem:240676, objs:-/32@4cf72b63", + " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:15503731, mem:240852, objs:-/33@2b1e328c", + " 74 ret obj_cmp -> Ok(0)": "cpu:15504031", + " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:15508645, mem:241204, objs:-/35@c5e3864a", + " 76 ret obj_cmp -> Ok(-1)": "cpu:15508945", + " 77 call vec_new_from_slice(2)": "cpu:16245727, mem:241380, objs:-/36@48960b91", + " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:16246814, mem:241476, objs:-/37@9fba2a30", " 79 call vec_new_from_slice(2)": "", - " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:16244474, mem:241572, objs:-/38@417ebf06", + " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:16247779, mem:241572, objs:-/38@417ebf06", " 81 call bls12_381_g1_msm(Vec(obj#73), Vec(obj#75))": "", - " 82 call vec_len(Vec(obj#73))": "cpu:16244718", - " 83 ret vec_len -> Ok(U32(2))": "cpu:16244840", - " 84 call vec_len(Vec(obj#75))": "cpu:17714309, mem:241780", - " 85 ret vec_len -> Ok(U32(2))": "cpu:17714431", - " 86 ret bls12_381_g1_msm -> Ok(Bytes(obj#77))": "cpu:21746867, mem:357071, objs:-/39@d2932e3e", - " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:21749174, mem:357247, objs:-/40@3b58e936", - " 88 ret obj_cmp -> Ok(0)": "cpu:21749474", + " 82 call vec_len(Vec(obj#73))": "cpu:16248023", + " 83 ret vec_len -> Ok(U32(2))": "cpu:16248145", + " 84 call vec_len(Vec(obj#75))": "cpu:17717614, mem:241780", + " 85 ret vec_len -> Ok(U32(2))": "cpu:17717736", + " 86 ret bls12_381_g1_msm -> Ok(Bytes(obj#77))": "cpu:21750172, mem:357071, objs:-/39@d2932e3e", + " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:21752479, mem:357247, objs:-/40@3b58e936", + " 88 ret obj_cmp -> Ok(0)": "cpu:21752779", " 89 call obj_from_u256_pieces(2137869300824195577, 2408943964792666977, 4119820914549582912, 10689500621133072587)": "cpu:9228, mem:704, objs:-/44@bdf24bea", " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:9729, mem:768, objs:-/45@ff9db193", " 91 call obj_from_u256_pieces(1962485755387024656, 9106496787558144827, 9789057793268231909, 16221084701331329973)": "", @@ -226,137 +226,137 @@ " 224 ret bls12_381_g1_msm -> Ok(Bytes(obj#161))": "cpu:93340649, mem:1337691, objs:-/81@9f62a7d5", " 225 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", " 226 ret obj_cmp -> Ok(0)": "cpu:93340949", - " 227 call bytes_new_from_slice(96)": "cpu:661, mem:0", - " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:1646, mem:176, objs:-/82@dd48ce00", - " 229 call bytes_new_from_slice(96)": "cpu:2307", - " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:3292, mem:352, objs:-/83@2ba0a36c", - " 231 call bytes_new_from_slice(96)": "cpu:3953", - " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:4938, mem:528, objs:-/84@a00db887", - " 233 call bytes_new_from_slice(96)": "cpu:5599", - " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:6584, mem:704, objs:-/85@2ff3a0e7", - " 235 call bytes_new_from_slice(96)": "cpu:7245", - " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:8230, mem:880, objs:-/86@67a727f9", - " 237 call bytes_new_from_slice(96)": "cpu:8891", - " 238 ret bytes_new_from_slice -> Ok(Bytes(obj#173))": "cpu:9876, mem:1056, objs:-/87@928f7064", - " 239 call bytes_new_from_slice(96)": "cpu:10537", - " 240 ret bytes_new_from_slice -> Ok(Bytes(obj#175))": "cpu:11522, mem:1232, objs:-/88@8e6f6128", - " 241 call bytes_new_from_slice(96)": "cpu:12183", - " 242 ret bytes_new_from_slice -> Ok(Bytes(obj#177))": "cpu:13168, mem:1408, objs:-/89@8b355a07", - " 243 call bytes_new_from_slice(96)": "cpu:13829", - " 244 ret bytes_new_from_slice -> Ok(Bytes(obj#179))": "cpu:14814, mem:1584, objs:-/90@2bebefc3", - " 245 call bytes_new_from_slice(96)": "cpu:15475", - " 246 ret bytes_new_from_slice -> Ok(Bytes(obj#181))": "cpu:16460, mem:1760, objs:-/91@87d223bb", + " 227 call bytes_new_from_slice(96)": "cpu:1322, mem:0", + " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:2307, mem:176, objs:-/82@dd48ce00", + " 229 call bytes_new_from_slice(96)": "cpu:3629", + " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:4614, mem:352, objs:-/83@2ba0a36c", + " 231 call bytes_new_from_slice(96)": "cpu:5936", + " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:6921, mem:528, objs:-/84@a00db887", + " 233 call bytes_new_from_slice(96)": "cpu:8243", + " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:9228, mem:704, objs:-/85@2ff3a0e7", + " 235 call bytes_new_from_slice(96)": "cpu:10550", + " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:11535, mem:880, objs:-/86@67a727f9", + " 237 call bytes_new_from_slice(96)": "cpu:12857", + " 238 ret bytes_new_from_slice -> Ok(Bytes(obj#173))": "cpu:13842, mem:1056, objs:-/87@928f7064", + " 239 call bytes_new_from_slice(96)": "cpu:15164", + " 240 ret bytes_new_from_slice -> Ok(Bytes(obj#175))": "cpu:16149, mem:1232, objs:-/88@8e6f6128", + " 241 call bytes_new_from_slice(96)": "cpu:17471", + " 242 ret bytes_new_from_slice -> Ok(Bytes(obj#177))": "cpu:18456, mem:1408, objs:-/89@8b355a07", + " 243 call bytes_new_from_slice(96)": "cpu:19778", + " 244 ret bytes_new_from_slice -> Ok(Bytes(obj#179))": "cpu:20763, mem:1584, objs:-/90@2bebefc3", + " 245 call bytes_new_from_slice(96)": "cpu:22085", + " 246 ret bytes_new_from_slice -> Ok(Bytes(obj#181))": "cpu:23070, mem:1760, objs:-/91@87d223bb", " 247 call vec_new_from_slice(10)": "", - " 248 ret vec_new_from_slice -> Ok(Vec(obj#183))": "cpu:18051, mem:1920, objs:-/92@e05d7d45", + " 248 ret vec_new_from_slice -> Ok(Vec(obj#183))": "cpu:24661, mem:1920, objs:-/92@e05d7d45", " 249 call obj_from_u256_pieces(17618770950827998744, 14662068724577735075, 2249062990298394979, 9977923089826089615)": "", - " 250 ret obj_from_u256_pieces -> Ok(U256(obj#185))": "cpu:18552, mem:1984, objs:-/93@e4abda0a", + " 250 ret obj_from_u256_pieces -> Ok(U256(obj#185))": "cpu:25162, mem:1984, objs:-/93@e4abda0a", " 251 call obj_from_u256_pieces(2821194631792961874, 16547277464900892467, 14819559542962736549, 17981056101655367365)": "", - " 252 ret obj_from_u256_pieces -> Ok(U256(obj#187))": "cpu:19053, mem:2048, objs:-/94@59894c0f", + " 252 ret obj_from_u256_pieces -> Ok(U256(obj#187))": "cpu:25663, mem:2048, objs:-/94@59894c0f", " 253 call obj_from_u256_pieces(14823680325444367514, 16057910356200631686, 11653412393475167983, 17971148540471083046)": "", - " 254 ret obj_from_u256_pieces -> Ok(U256(obj#189))": "cpu:19554, mem:2112, objs:-/95@f611f183", + " 254 ret obj_from_u256_pieces -> Ok(U256(obj#189))": "cpu:26164, mem:2112, objs:-/95@f611f183", " 255 call obj_from_u256_pieces(16502273625602787483, 2713688267813643125, 15061415354752276271, 16690818686241479208)": "", - " 256 ret obj_from_u256_pieces -> Ok(U256(obj#191))": "cpu:20055, mem:2176, objs:-/96@b6efa1b5", + " 256 ret obj_from_u256_pieces -> Ok(U256(obj#191))": "cpu:26665, mem:2176, objs:-/96@b6efa1b5", " 257 call obj_from_u256_pieces(7027192125185647877, 17045944964573428771, 10144290202347477085, 10705035438189734679)": "", - " 258 ret obj_from_u256_pieces -> Ok(U256(obj#193))": "cpu:20556, mem:2240, objs:-/97@f626d632", + " 258 ret obj_from_u256_pieces -> Ok(U256(obj#193))": "cpu:27166, mem:2240, objs:-/97@f626d632", " 259 call obj_from_u256_pieces(14552017996338670628, 17384320552016825872, 12623460464266321339, 2351693706725345962)": "", - " 260 ret obj_from_u256_pieces -> Ok(U256(obj#195))": "cpu:21057, mem:2304, objs:-/98@dc0fd6a8", + " 260 ret obj_from_u256_pieces -> Ok(U256(obj#195))": "cpu:27667, mem:2304, objs:-/98@dc0fd6a8", " 261 call obj_from_u256_pieces(4037855643097226315, 3588748593401323528, 18145554024939280631, 6805129555195258487)": "", - " 262 ret obj_from_u256_pieces -> Ok(U256(obj#197))": "cpu:21558, mem:2368, objs:-/99@3a43cf0d", + " 262 ret obj_from_u256_pieces -> Ok(U256(obj#197))": "cpu:28168, mem:2368, objs:-/99@3a43cf0d", " 263 call obj_from_u256_pieces(10690484396013942008, 3220507769215303921, 6575779185716732641, 1735816512470570891)": "", - " 264 ret obj_from_u256_pieces -> Ok(U256(obj#199))": "cpu:22059, mem:2432, objs:-/100@72aa4d1", + " 264 ret obj_from_u256_pieces -> Ok(U256(obj#199))": "cpu:28669, mem:2432, objs:-/100@72aa4d1", " 265 call obj_from_u256_pieces(854729243539327218, 14181304886955281704, 12059208175304010597, 16702944845996181439)": "", - " 266 ret obj_from_u256_pieces -> Ok(U256(obj#201))": "cpu:22560, mem:2496, objs:-/101@898aec71", + " 266 ret obj_from_u256_pieces -> Ok(U256(obj#201))": "cpu:29170, mem:2496, objs:-/101@898aec71", " 267 call obj_from_u256_pieces(11497158191995684079, 43326291776979156, 14533160951240524555, 12852174102015084654)": "", - " 268 ret obj_from_u256_pieces -> Ok(U256(obj#203))": "cpu:23061, mem:2560, objs:-/102@a0762125", + " 268 ret obj_from_u256_pieces -> Ok(U256(obj#203))": "cpu:29671, mem:2560, objs:-/102@a0762125", " 269 call vec_new_from_slice(10)": "", - " 270 ret vec_new_from_slice -> Ok(Vec(obj#205))": "cpu:24652, mem:2720, objs:-/103@d1b8c868", + " 270 ret vec_new_from_slice -> Ok(Vec(obj#205))": "cpu:31262, mem:2720, objs:-/103@d1b8c868", " 271 call bls12_381_g1_msm(Vec(obj#183), Vec(obj#205))": "", - " 272 call vec_len(Vec(obj#183))": "cpu:24896", - " 273 ret vec_len -> Ok(U32(10))": "cpu:25018", - " 274 call vec_len(Vec(obj#205))": "cpu:7370383, mem:3696", - " 275 ret vec_len -> Ok(U32(10))": "cpu:7370505", - " 276 ret bls12_381_g1_msm -> Ok(Bytes(obj#207))": "cpu:17444390, mem:141410, objs:-/104@5e3fb337", - " 277 call vec_get(Vec(obj#183), U32(0))": "cpu:17446697, mem:141586, objs:-/105@cc1ad99a", - " 278 ret vec_get -> Ok(Bytes(obj#163))": "cpu:17446923", + " 272 call vec_len(Vec(obj#183))": "cpu:31506", + " 273 ret vec_len -> Ok(U32(10))": "cpu:31628", + " 274 call vec_len(Vec(obj#205))": "cpu:7376993, mem:3696", + " 275 ret vec_len -> Ok(U32(10))": "cpu:7377115", + " 276 ret bls12_381_g1_msm -> Ok(Bytes(obj#207))": "cpu:17451000, mem:141410, objs:-/104@5e3fb337", + " 277 call vec_get(Vec(obj#183), U32(0))": "cpu:17453307, mem:141586, objs:-/105@cc1ad99a", + " 278 ret vec_get -> Ok(Bytes(obj#163))": "cpu:17453533", " 279 call vec_get(Vec(obj#205), U32(0))": "", - " 280 ret vec_get -> Ok(U256(obj#185))": "cpu:17447149", + " 280 ret vec_get -> Ok(U256(obj#185))": "cpu:17453759", " 281 call bls12_381_g1_mul(Bytes(obj#163), U256(obj#185))": "", - " 282 ret bls12_381_g1_mul -> Ok(Bytes(obj#211))": "cpu:20737796, mem:141762, objs:-/106@4d87b466", + " 282 ret bls12_381_g1_mul -> Ok(Bytes(obj#211))": "cpu:20744406, mem:141762, objs:-/106@4d87b466", " 283 call bls12_381_g1_add(Bytes(obj#209), Bytes(obj#211))": "", - " 284 ret bls12_381_g1_add -> Ok(Bytes(obj#213))": "cpu:20848547, mem:141938, objs:-/107@a668862", + " 284 ret bls12_381_g1_add -> Ok(Bytes(obj#213))": "cpu:20855157, mem:141938, objs:-/107@a668862", " 285 call vec_get(Vec(obj#183), U32(1))": "", - " 286 ret vec_get -> Ok(Bytes(obj#165))": "cpu:20848773", + " 286 ret vec_get -> Ok(Bytes(obj#165))": "cpu:20855383", " 287 call vec_get(Vec(obj#205), U32(1))": "", - " 288 ret vec_get -> Ok(U256(obj#187))": "cpu:20848999", + " 288 ret vec_get -> Ok(U256(obj#187))": "cpu:20855609", " 289 call bls12_381_g1_mul(Bytes(obj#165), U256(obj#187))": "", - " 290 ret bls12_381_g1_mul -> Ok(Bytes(obj#215))": "cpu:24139646, mem:142114, objs:-/108@26939bdb", + " 290 ret bls12_381_g1_mul -> Ok(Bytes(obj#215))": "cpu:24146256, mem:142114, objs:-/108@26939bdb", " 291 call bls12_381_g1_add(Bytes(obj#213), Bytes(obj#215))": "", - " 292 ret bls12_381_g1_add -> Ok(Bytes(obj#217))": "cpu:24250397, mem:142290, objs:-/109@afa942f2", + " 292 ret bls12_381_g1_add -> Ok(Bytes(obj#217))": "cpu:24257007, mem:142290, objs:-/109@afa942f2", " 293 call vec_get(Vec(obj#183), U32(2))": "", - " 294 ret vec_get -> Ok(Bytes(obj#167))": "cpu:24250623", + " 294 ret vec_get -> Ok(Bytes(obj#167))": "cpu:24257233", " 295 call vec_get(Vec(obj#205), U32(2))": "", - " 296 ret vec_get -> Ok(U256(obj#189))": "cpu:24250849", + " 296 ret vec_get -> Ok(U256(obj#189))": "cpu:24257459", " 297 call bls12_381_g1_mul(Bytes(obj#167), U256(obj#189))": "", - " 298 ret bls12_381_g1_mul -> Ok(Bytes(obj#219))": "cpu:27541496, mem:142466, objs:-/110@80ebabcb", + " 298 ret bls12_381_g1_mul -> Ok(Bytes(obj#219))": "cpu:27548106, mem:142466, objs:-/110@80ebabcb", " 299 call bls12_381_g1_add(Bytes(obj#217), Bytes(obj#219))": "", - " 300 ret bls12_381_g1_add -> Ok(Bytes(obj#221))": "cpu:27652247, mem:142642, objs:-/111@c5129985", + " 300 ret bls12_381_g1_add -> Ok(Bytes(obj#221))": "cpu:27658857, mem:142642, objs:-/111@c5129985", " 301 call vec_get(Vec(obj#183), U32(3))": "", - " 302 ret vec_get -> Ok(Bytes(obj#169))": "cpu:27652473", + " 302 ret vec_get -> Ok(Bytes(obj#169))": "cpu:27659083", " 303 call vec_get(Vec(obj#205), U32(3))": "", - " 304 ret vec_get -> Ok(U256(obj#191))": "cpu:27652699", + " 304 ret vec_get -> Ok(U256(obj#191))": "cpu:27659309", " 305 call bls12_381_g1_mul(Bytes(obj#169), U256(obj#191))": "", - " 306 ret bls12_381_g1_mul -> Ok(Bytes(obj#223))": "cpu:30943346, mem:142818, objs:-/112@185b22ec", + " 306 ret bls12_381_g1_mul -> Ok(Bytes(obj#223))": "cpu:30949956, mem:142818, objs:-/112@185b22ec", " 307 call bls12_381_g1_add(Bytes(obj#221), Bytes(obj#223))": "", - " 308 ret bls12_381_g1_add -> Ok(Bytes(obj#225))": "cpu:31054097, mem:142994, objs:-/113@c4f97300", + " 308 ret bls12_381_g1_add -> Ok(Bytes(obj#225))": "cpu:31060707, mem:142994, objs:-/113@c4f97300", " 309 call vec_get(Vec(obj#183), U32(4))": "", - " 310 ret vec_get -> Ok(Bytes(obj#171))": "cpu:31054323", + " 310 ret vec_get -> Ok(Bytes(obj#171))": "cpu:31060933", " 311 call vec_get(Vec(obj#205), U32(4))": "", - " 312 ret vec_get -> Ok(U256(obj#193))": "cpu:31054549", + " 312 ret vec_get -> Ok(U256(obj#193))": "cpu:31061159", " 313 call bls12_381_g1_mul(Bytes(obj#171), U256(obj#193))": "", - " 314 ret bls12_381_g1_mul -> Ok(Bytes(obj#227))": "cpu:34345196, mem:143170, objs:-/114@5dcb2245", + " 314 ret bls12_381_g1_mul -> Ok(Bytes(obj#227))": "cpu:34351806, mem:143170, objs:-/114@5dcb2245", " 315 call bls12_381_g1_add(Bytes(obj#225), Bytes(obj#227))": "", - " 316 ret bls12_381_g1_add -> Ok(Bytes(obj#229))": "cpu:34455947, mem:143346, objs:-/115@9b8b7719", + " 316 ret bls12_381_g1_add -> Ok(Bytes(obj#229))": "cpu:34462557, mem:143346, objs:-/115@9b8b7719", " 317 call vec_get(Vec(obj#183), U32(5))": "", - " 318 ret vec_get -> Ok(Bytes(obj#173))": "cpu:34456173", + " 318 ret vec_get -> Ok(Bytes(obj#173))": "cpu:34462783", " 319 call vec_get(Vec(obj#205), U32(5))": "", - " 320 ret vec_get -> Ok(U256(obj#195))": "cpu:34456399", + " 320 ret vec_get -> Ok(U256(obj#195))": "cpu:34463009", " 321 call bls12_381_g1_mul(Bytes(obj#173), U256(obj#195))": "", - " 322 ret bls12_381_g1_mul -> Ok(Bytes(obj#231))": "cpu:37747046, mem:143522, objs:-/116@7e32132b", + " 322 ret bls12_381_g1_mul -> Ok(Bytes(obj#231))": "cpu:37753656, mem:143522, objs:-/116@7e32132b", " 323 call bls12_381_g1_add(Bytes(obj#229), Bytes(obj#231))": "", - " 324 ret bls12_381_g1_add -> Ok(Bytes(obj#233))": "cpu:37857797, mem:143698, objs:-/117@820927b5", + " 324 ret bls12_381_g1_add -> Ok(Bytes(obj#233))": "cpu:37864407, mem:143698, objs:-/117@820927b5", " 325 call vec_get(Vec(obj#183), U32(6))": "", - " 326 ret vec_get -> Ok(Bytes(obj#175))": "cpu:37858023", + " 326 ret vec_get -> Ok(Bytes(obj#175))": "cpu:37864633", " 327 call vec_get(Vec(obj#205), U32(6))": "", - " 328 ret vec_get -> Ok(U256(obj#197))": "cpu:37858249", + " 328 ret vec_get -> Ok(U256(obj#197))": "cpu:37864859", " 329 call bls12_381_g1_mul(Bytes(obj#175), U256(obj#197))": "", - " 330 ret bls12_381_g1_mul -> Ok(Bytes(obj#235))": "cpu:41148896, mem:143874, objs:-/118@734cedc3", + " 330 ret bls12_381_g1_mul -> Ok(Bytes(obj#235))": "cpu:41155506, mem:143874, objs:-/118@734cedc3", " 331 call bls12_381_g1_add(Bytes(obj#233), Bytes(obj#235))": "", - " 332 ret bls12_381_g1_add -> Ok(Bytes(obj#237))": "cpu:41259647, mem:144050, objs:-/119@9f782901", + " 332 ret bls12_381_g1_add -> Ok(Bytes(obj#237))": "cpu:41266257, mem:144050, objs:-/119@9f782901", " 333 call vec_get(Vec(obj#183), U32(7))": "", - " 334 ret vec_get -> Ok(Bytes(obj#177))": "cpu:41259873", + " 334 ret vec_get -> Ok(Bytes(obj#177))": "cpu:41266483", " 335 call vec_get(Vec(obj#205), U32(7))": "", - " 336 ret vec_get -> Ok(U256(obj#199))": "cpu:41260099", + " 336 ret vec_get -> Ok(U256(obj#199))": "cpu:41266709", " 337 call bls12_381_g1_mul(Bytes(obj#177), U256(obj#199))": "", - " 338 ret bls12_381_g1_mul -> Ok(Bytes(obj#239))": "cpu:44550746, mem:144226, objs:-/120@6222b65f", + " 338 ret bls12_381_g1_mul -> Ok(Bytes(obj#239))": "cpu:44557356, mem:144226, objs:-/120@6222b65f", " 339 call bls12_381_g1_add(Bytes(obj#237), Bytes(obj#239))": "", - " 340 ret bls12_381_g1_add -> Ok(Bytes(obj#241))": "cpu:44661497, mem:144402, objs:-/121@ec08d7b8", + " 340 ret bls12_381_g1_add -> Ok(Bytes(obj#241))": "cpu:44668107, mem:144402, objs:-/121@ec08d7b8", " 341 call vec_get(Vec(obj#183), U32(8))": "", - " 342 ret vec_get -> Ok(Bytes(obj#179))": "cpu:44661723", + " 342 ret vec_get -> Ok(Bytes(obj#179))": "cpu:44668333", " 343 call vec_get(Vec(obj#205), U32(8))": "", - " 344 ret vec_get -> Ok(U256(obj#201))": "cpu:44661949", + " 344 ret vec_get -> Ok(U256(obj#201))": "cpu:44668559", " 345 call bls12_381_g1_mul(Bytes(obj#179), U256(obj#201))": "", - " 346 ret bls12_381_g1_mul -> Ok(Bytes(obj#243))": "cpu:47952596, mem:144578, objs:-/122@ed50266c", + " 346 ret bls12_381_g1_mul -> Ok(Bytes(obj#243))": "cpu:47959206, mem:144578, objs:-/122@ed50266c", " 347 call bls12_381_g1_add(Bytes(obj#241), Bytes(obj#243))": "", - " 348 ret bls12_381_g1_add -> Ok(Bytes(obj#245))": "cpu:48063347, mem:144754, objs:-/123@c4adee2a", + " 348 ret bls12_381_g1_add -> Ok(Bytes(obj#245))": "cpu:48069957, mem:144754, objs:-/123@c4adee2a", " 349 call vec_get(Vec(obj#183), U32(9))": "", - " 350 ret vec_get -> Ok(Bytes(obj#181))": "cpu:48063573", + " 350 ret vec_get -> Ok(Bytes(obj#181))": "cpu:48070183", " 351 call vec_get(Vec(obj#205), U32(9))": "", - " 352 ret vec_get -> Ok(U256(obj#203))": "cpu:48063799", + " 352 ret vec_get -> Ok(U256(obj#203))": "cpu:48070409", " 353 call bls12_381_g1_mul(Bytes(obj#181), U256(obj#203))": "", - " 354 ret bls12_381_g1_mul -> Ok(Bytes(obj#247))": "cpu:51354446, mem:144930, objs:-/124@e5cf2285", + " 354 ret bls12_381_g1_mul -> Ok(Bytes(obj#247))": "cpu:51361056, mem:144930, objs:-/124@e5cf2285", " 355 call bls12_381_g1_add(Bytes(obj#245), Bytes(obj#247))": "", - " 356 ret bls12_381_g1_add -> Ok(Bytes(obj#249))": "cpu:51465197, mem:145106, objs:-/125@e28e8633", + " 356 ret bls12_381_g1_add -> Ok(Bytes(obj#249))": "cpu:51471807, mem:145106, objs:-/125@e28e8633", " 357 call obj_cmp(Bytes(obj#249), Bytes(obj#207))": "", - " 358 ret obj_cmp -> Ok(0)": "cpu:51465497", - " 359 end": "cpu:51465497, mem:145106, prngs:-/-, objs:-/125@e28e8633, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 358 ret obj_cmp -> Ok(0)": "cpu:51472107", + " 359 end": "cpu:51472107, mem:145106, prngs:-/-, objs:-/125@e28e8633, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g2_msm.json b/soroban-env-host/observations/22/test__bls12_381__g2_msm.json index 65bb88699..7a8c4af56 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g2_msm.json +++ b/soroban-env-host/observations/22/test__bls12_381__g2_msm.json @@ -6,106 +6,106 @@ " 4 ret vec_new -> Ok(Vec(obj#3))": "cpu:1002, mem:128, objs:-/2@14339b3d", " 5 call bls12_381_g2_msm(Vec(obj#1), Vec(obj#3))": "", " 6 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1246", - " 7 call bytes_new_from_slice(192)": "cpu:1907", - " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:2916, mem:400, objs:-/3@bd2bad33", - " 9 call bytes_new_from_slice(192)": "cpu:3577", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:4586, mem:672, objs:-/4@84c0214b", + " 7 call bytes_new_from_slice(192)": "cpu:3890", + " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:4899, mem:400, objs:-/3@bd2bad33", + " 9 call bytes_new_from_slice(192)": "cpu:7543", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:8552, mem:672, objs:-/4@84c0214b", " 11 call vec_new_from_slice(2)": "", - " 12 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:5673, mem:768, objs:-/5@e2867bea", + " 12 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:9639, mem:768, objs:-/5@e2867bea", " 13 call obj_from_u256_pieces(11753201120659576617, 12800183645227990272, 6449591311112480650, 11530214657355711865)": "", - " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:6174, mem:832, objs:-/6@d2c1550a", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:10140, mem:832, objs:-/6@d2c1550a", " 15 call obj_from_u256_pieces(17867260108045272079, 6594056455511558201, 8394146189024495608, 16477234698079725300)": "", - " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:6675, mem:896, objs:-/7@b83c4f1d", + " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:10641, mem:896, objs:-/7@b83c4f1d", " 17 call obj_from_u256_pieces(5093470543443933884, 12596616304565341690, 2875592832172597214, 8474459150244119113)": "", - " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:7176, mem:960, objs:-/8@5b2279ba", + " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:11142, mem:960, objs:-/8@5b2279ba", " 19 call vec_new_from_slice(3)": "", - " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:8326, mem:1064, objs:-/9@2c5030af", + " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:12292, mem:1064, objs:-/9@2c5030af", " 21 call bls12_381_g2_msm(Vec(obj#9), Vec(obj#17))": "", - " 22 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:8570", - " 23 call vec_new_from_slice(3)": "cpu:23182, mem:2152, objs:-/13@c72ec5e5", - " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:24332, mem:2256, objs:-/14@138c972e", + " 22 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:12536", + " 23 call vec_new_from_slice(3)": "cpu:27148, mem:2152, objs:-/13@c72ec5e5", + " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:28298, mem:2256, objs:-/14@138c972e", " 25 call obj_from_u256_pieces(2670602178858449459, 7519702381861979968, 12131847362652268029, 15324157160071379208)": "", - " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:24833, mem:2320, objs:-/15@cca0974f", + " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:28799, mem:2320, objs:-/15@cca0974f", " 27 call obj_from_u256_pieces(14448951281277473340, 10183372082303375121, 11609568207825743232, 10582668507445555283)": "", - " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:25334, mem:2384, objs:-/16@338703b5", + " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:29300, mem:2384, objs:-/16@338703b5", " 29 call obj_from_u256_pieces(8613971480719722045, 14687201964851969652, 13467859308725023972, 5056481814551667924)": "", - " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:25835, mem:2448, objs:-/17@e29c96a4", + " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:29801, mem:2448, objs:-/17@e29c96a4", " 31 call vec_new_from_slice(3)": "", - " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:26985, mem:2552, objs:-/18@bd3fe61d", + " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:30951, mem:2552, objs:-/18@bd3fe61d", " 33 call bls12_381_g2_msm(Vec(obj#27), Vec(obj#35))": "", - " 34 call vec_len(Vec(obj#27))": "cpu:27229", - " 35 ret vec_len -> Ok(U32(3))": "cpu:27351", - " 36 call vec_len(Vec(obj#35))": "cpu:2163406, mem:3144", - " 37 ret vec_len -> Ok(U32(3))": "cpu:2163528", - " 38 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:2170200, mem:3256", - " 39 call vec_new_from_slice(3)": "cpu:2173853, mem:3528, objs:-/19@fc4eae83", - " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:2175003, mem:3632, objs:-/20@fc5a7848", + " 34 call vec_len(Vec(obj#27))": "cpu:31195", + " 35 ret vec_len -> Ok(U32(3))": "cpu:31317", + " 36 call vec_len(Vec(obj#35))": "cpu:2167372, mem:3144", + " 37 ret vec_len -> Ok(U32(3))": "cpu:2167494", + " 38 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:2174166, mem:3256", + " 39 call vec_new_from_slice(3)": "cpu:2177819, mem:3528, objs:-/19@fc4eae83", + " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:2178969, mem:3632, objs:-/20@fc5a7848", " 41 call obj_from_u256_pieces(10885390432521285204, 10089357480003724487, 11017657889674374380, 349979284301977343)": "", - " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:2175504, mem:3696, objs:-/21@c11c1e9", + " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:2179470, mem:3696, objs:-/21@c11c1e9", " 43 call obj_from_u256_pieces(15502034860521929120, 5197508503879521041, 10172360046471299633, 18026852881196000031)": "", - " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:2176005, mem:3760, objs:-/22@fbed0030", + " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:2179971, mem:3760, objs:-/22@fbed0030", " 45 call obj_from_u256_pieces(7434520258580032483, 1508470301556677986, 6272863840242768080, 12830499169355232182)": "", - " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:2176506, mem:3824, objs:-/23@7c759a0d", + " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:2180472, mem:3824, objs:-/23@7c759a0d", " 47 call vec_new_from_slice(3)": "", - " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:2177656, mem:3928, objs:-/24@892a5924", + " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:2181622, mem:3928, objs:-/24@892a5924", " 49 call bls12_381_g2_msm(Vec(obj#39), Vec(obj#47))": "", - " 50 call vec_len(Vec(obj#39))": "cpu:2177900", - " 51 ret vec_len -> Ok(U32(3))": "cpu:2178022", - " 52 call vec_len(Vec(obj#47))": "cpu:5381821, mem:4520", - " 53 ret vec_len -> Ok(U32(3))": "cpu:5381943", - " 54 ret bls12_381_g2_msm -> Ok(Bytes(obj#49))": "cpu:20786867, mem:232870, objs:-/25@b3e2fb94", - " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:20790520, mem:233142, objs:-/26@36256f36", - " 56 ret obj_cmp -> Ok(0)": "cpu:20790832", - " 57 call bytes_new_from_slice(192)": "cpu:20791493", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:20792502, mem:233414, objs:-/27@8ed979ac", - " 59 call bytes_new_from_slice(192)": "cpu:20793163", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:20794172, mem:233686, objs:-/28@a3eb6aea", - " 61 call bytes_new_from_slice(192)": "cpu:20794833", - " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:20795842, mem:233958, objs:-/29@9bc29a7f", + " 50 call vec_len(Vec(obj#39))": "cpu:2181866", + " 51 ret vec_len -> Ok(U32(3))": "cpu:2181988", + " 52 call vec_len(Vec(obj#47))": "cpu:5385787, mem:4520", + " 53 ret vec_len -> Ok(U32(3))": "cpu:5385909", + " 54 ret bls12_381_g2_msm -> Ok(Bytes(obj#49))": "cpu:20790833, mem:232870, objs:-/25@b3e2fb94", + " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:20794486, mem:233142, objs:-/26@36256f36", + " 56 ret obj_cmp -> Ok(0)": "cpu:20794798", + " 57 call bytes_new_from_slice(192)": "cpu:20797442", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:20798451, mem:233414, objs:-/27@8ed979ac", + " 59 call bytes_new_from_slice(192)": "cpu:20801095", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:20802104, mem:233686, objs:-/28@a3eb6aea", + " 61 call bytes_new_from_slice(192)": "cpu:20804748", + " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:20805757, mem:233958, objs:-/29@9bc29a7f", " 63 call vec_new_from_slice(3)": "", - " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:20796992, mem:234062, objs:-/30@379dffd4", + " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:20806907, mem:234062, objs:-/30@379dffd4", " 65 call vec_new_from_slice(3)": "", - " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:20797959, mem:234166, objs:-/31@f3d911e6", + " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:20807874, mem:234166, objs:-/31@f3d911e6", " 67 call bls12_381_g2_msm(Vec(obj#59), Vec(obj#61))": "", - " 68 call vec_len(Vec(obj#59))": "cpu:20798203", - " 69 ret vec_len -> Ok(U32(3))": "cpu:20798325", - " 70 call vec_len(Vec(obj#61))": "cpu:24002124, mem:234758", - " 71 ret vec_len -> Ok(U32(3))": "cpu:24002246", - " 72 ret bls12_381_g2_msm -> Ok(Bytes(obj#63))": "cpu:39406987, mem:463108, objs:-/32@99e86db8", - " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:39410640, mem:463380, objs:-/33@d5a55acc", - " 74 ret obj_cmp -> Ok(0)": "cpu:39410952", - " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:39418258, mem:463924, objs:-/35@52d12591", - " 76 ret obj_cmp -> Ok(-1)": "cpu:39418570", - " 77 call vec_new_from_slice(2)": "cpu:40489967, mem:464196, objs:-/36@f4b12971", - " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:40491054, mem:464292, objs:-/37@43b753fc", + " 68 call vec_len(Vec(obj#59))": "cpu:20808118", + " 69 ret vec_len -> Ok(U32(3))": "cpu:20808240", + " 70 call vec_len(Vec(obj#61))": "cpu:24012039, mem:234758", + " 71 ret vec_len -> Ok(U32(3))": "cpu:24012161", + " 72 ret bls12_381_g2_msm -> Ok(Bytes(obj#63))": "cpu:39416902, mem:463108, objs:-/32@99e86db8", + " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:39420555, mem:463380, objs:-/33@d5a55acc", + " 74 ret obj_cmp -> Ok(0)": "cpu:39420867", + " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:39428173, mem:463924, objs:-/35@52d12591", + " 76 ret obj_cmp -> Ok(-1)": "cpu:39428485", + " 77 call vec_new_from_slice(2)": "cpu:40499882, mem:464196, objs:-/36@f4b12971", + " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:40500969, mem:464292, objs:-/37@43b753fc", " 79 call vec_new_from_slice(2)": "", - " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:40492019, mem:464388, objs:-/38@d88a608d", + " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:40501934, mem:464388, objs:-/38@d88a608d", " 81 call bls12_381_g2_msm(Vec(obj#73), Vec(obj#75))": "", - " 82 call vec_len(Vec(obj#73))": "cpu:40492263", - " 83 ret vec_len -> Ok(U32(2))": "cpu:40492385", - " 84 call vec_len(Vec(obj#75))": "cpu:42628416, mem:464788", - " 85 ret vec_len -> Ok(U32(2))": "cpu:42628538", - " 86 ret bls12_381_g2_msm -> Ok(Bytes(obj#77))": "cpu:55612005, mem:690335, objs:-/39@308f505c", - " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:55615658, mem:690607, objs:-/40@9dfbcd24", - " 88 ret obj_cmp -> Ok(0)": "cpu:55615970", - " 89 call obj_from_u256_pieces(576349249354864704, 6205532040440579369, 13730557568579417905, 2677733454007168321)": "cpu:55630582, mem:691695, objs:-/44@cd73d980", - " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:55631083, mem:691759, objs:-/45@d173b8e8", + " 82 call vec_len(Vec(obj#73))": "cpu:40502178", + " 83 ret vec_len -> Ok(U32(2))": "cpu:40502300", + " 84 call vec_len(Vec(obj#75))": "cpu:42638331, mem:464788", + " 85 ret vec_len -> Ok(U32(2))": "cpu:42638453", + " 86 ret bls12_381_g2_msm -> Ok(Bytes(obj#77))": "cpu:55621920, mem:690335, objs:-/39@308f505c", + " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:55625573, mem:690607, objs:-/40@9dfbcd24", + " 88 ret obj_cmp -> Ok(0)": "cpu:55625885", + " 89 call obj_from_u256_pieces(576349249354864704, 6205532040440579369, 13730557568579417905, 2677733454007168321)": "cpu:55640497, mem:691695, objs:-/44@cd73d980", + " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:55640998, mem:691759, objs:-/45@d173b8e8", " 91 call obj_from_u256_pieces(15107729625736847273, 3736362233123338213, 1310693883286457402, 15587527586950209119)": "", - " 92 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:55631584, mem:691823, objs:-/46@8a8ce1f3", + " 92 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:55641499, mem:691823, objs:-/46@8a8ce1f3", " 93 call obj_from_u256_pieces(7130333837602304766, 15809650852848135414, 16809337653702689547, 14300891233011973695)": "", - " 94 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:55632085, mem:691887, objs:-/47@eacff4b8", + " 94 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:55642000, mem:691887, objs:-/47@eacff4b8", " 95 call obj_from_u256_pieces(5531006726045309341, 889630097820975985, 16583573122393188327, 9061467097759417586)": "", - " 96 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:55632586, mem:691951, objs:-/48@42874a94", + " 96 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:55642501, mem:691951, objs:-/48@42874a94", " 97 call vec_new_from_slice(4)": "", - " 98 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:55633799, mem:692063, objs:-/49@239aaa14", + " 98 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:55643714, mem:692063, objs:-/49@239aaa14", " 99 call vec_new_from_slice(4)": "", - " 100 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:55635012, mem:692175, objs:-/50@60ff6572", + " 100 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:55644927, mem:692175, objs:-/50@60ff6572", " 101 call bls12_381_g2_msm(Vec(obj#97), Vec(obj#99))": "", - " 102 call vec_len(Vec(obj#97))": "cpu:55635256", - " 103 ret vec_len -> Ok(U32(4))": "cpu:55635378", - " 104 call vec_len(Vec(obj#99))": "cpu:59906945, mem:692959", - " 105 ret vec_len -> Ok(U32(4))": "cpu:59907067", - " 106 ret bls12_381_g2_msm -> Ok(Bytes(obj#101))": "cpu:77733326, mem:924112, objs:-/51@6bf9c3f3", + " 102 call vec_len(Vec(obj#97))": "cpu:55645171", + " 103 ret vec_len -> Ok(U32(4))": "cpu:55645293", + " 104 call vec_len(Vec(obj#99))": "cpu:59916860, mem:692959", + " 105 ret vec_len -> Ok(U32(4))": "cpu:59916982", + " 106 ret bls12_381_g2_msm -> Ok(Bytes(obj#101))": "cpu:77743241, mem:924112, objs:-/51@6bf9c3f3", " 107 call vec_new_from_slice(4)": "cpu:0, mem:0", " 108 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:1213, mem:112, objs:-/52@c42f87dd", " 109 call vec_new_from_slice(4)": "", @@ -226,77 +226,77 @@ " 224 ret bls12_381_g2_msm -> Ok(Bytes(obj#161))": "cpu:22100740, mem:232161, objs:-/81@151aaaa4", " 225 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", " 226 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 227 call bytes_new_from_slice(192)": "cpu:661, mem:0", - " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:1670, mem:272, objs:-/82@526b5995", - " 229 call bytes_new_from_slice(192)": "cpu:2331", - " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:3340, mem:544, objs:-/83@6efe8bf2", - " 231 call bytes_new_from_slice(192)": "cpu:4001", - " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:5010, mem:816, objs:-/84@d65370d1", - " 233 call bytes_new_from_slice(192)": "cpu:5671", - " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:6680, mem:1088, objs:-/85@768353f3", - " 235 call bytes_new_from_slice(192)": "cpu:7341", - " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:8350, mem:1360, objs:-/86@d38309a4", + " 227 call bytes_new_from_slice(192)": "cpu:2644, mem:0", + " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:3653, mem:272, objs:-/82@526b5995", + " 229 call bytes_new_from_slice(192)": "cpu:6297", + " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:7306, mem:544, objs:-/83@6efe8bf2", + " 231 call bytes_new_from_slice(192)": "cpu:9950", + " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:10959, mem:816, objs:-/84@d65370d1", + " 233 call bytes_new_from_slice(192)": "cpu:13603", + " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:14612, mem:1088, objs:-/85@768353f3", + " 235 call bytes_new_from_slice(192)": "cpu:17256", + " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:18265, mem:1360, objs:-/86@d38309a4", " 237 call vec_new_from_slice(5)": "", - " 238 ret vec_new_from_slice -> Ok(Vec(obj#173))": "cpu:9626, mem:1480, objs:-/87@3939bbac", + " 238 ret vec_new_from_slice -> Ok(Vec(obj#173))": "cpu:19541, mem:1480, objs:-/87@3939bbac", " 239 call obj_from_u256_pieces(17073613341124213686, 9800153404225276109, 6607116724722439497, 842746758976683084)": "", - " 240 ret obj_from_u256_pieces -> Ok(U256(obj#175))": "cpu:10127, mem:1544, objs:-/88@a1c554a1", + " 240 ret obj_from_u256_pieces -> Ok(U256(obj#175))": "cpu:20042, mem:1544, objs:-/88@a1c554a1", " 241 call obj_from_u256_pieces(16040841695964229797, 5061605267848115623, 14000740750614834722, 13904863006945675968)": "", - " 242 ret obj_from_u256_pieces -> Ok(U256(obj#177))": "cpu:10628, mem:1608, objs:-/89@5dbca5f2", + " 242 ret obj_from_u256_pieces -> Ok(U256(obj#177))": "cpu:20543, mem:1608, objs:-/89@5dbca5f2", " 243 call obj_from_u256_pieces(5830218664442262694, 4114147737062195718, 16434537214804972826, 1396935906550304884)": "", - " 244 ret obj_from_u256_pieces -> Ok(U256(obj#179))": "cpu:11129, mem:1672, objs:-/90@329f03eb", + " 244 ret obj_from_u256_pieces -> Ok(U256(obj#179))": "cpu:21044, mem:1672, objs:-/90@329f03eb", " 245 call obj_from_u256_pieces(8756542147870587062, 2334579494105318157, 3880849428716171604, 577514052903835922)": "", - " 246 ret obj_from_u256_pieces -> Ok(U256(obj#181))": "cpu:11630, mem:1736, objs:-/91@8451f38d", + " 246 ret obj_from_u256_pieces -> Ok(U256(obj#181))": "cpu:21545, mem:1736, objs:-/91@8451f38d", " 247 call obj_from_u256_pieces(5259919734814292314, 1486637374753912723, 9060486243487422013, 18066450239200677051)": "", - " 248 ret obj_from_u256_pieces -> Ok(U256(obj#183))": "cpu:12131, mem:1800, objs:-/92@c5a670c", + " 248 ret obj_from_u256_pieces -> Ok(U256(obj#183))": "cpu:22046, mem:1800, objs:-/92@c5a670c", " 249 call vec_new_from_slice(5)": "", - " 250 ret vec_new_from_slice -> Ok(Vec(obj#185))": "cpu:13407, mem:1920, objs:-/93@80ddd82c", + " 250 ret vec_new_from_slice -> Ok(Vec(obj#185))": "cpu:23322, mem:1920, objs:-/93@80ddd82c", " 251 call bls12_381_g2_msm(Vec(obj#173), Vec(obj#185))": "", - " 252 call vec_len(Vec(obj#173))": "cpu:13651", - " 253 ret vec_len -> Ok(U32(5))": "cpu:13773", - " 254 call vec_len(Vec(obj#185))": "cpu:5353108, mem:2896", - " 255 ret vec_len -> Ok(U32(5))": "cpu:5353230", - " 256 ret bls12_381_g2_msm -> Ok(Bytes(obj#187))": "cpu:25600824, mem:236852, objs:-/94@37bd5b7d", - " 257 call vec_get(Vec(obj#173), U32(0))": "cpu:25604477, mem:237124, objs:-/95@47f3520c", - " 258 ret vec_get -> Ok(Bytes(obj#163))": "cpu:25604703", + " 252 call vec_len(Vec(obj#173))": "cpu:23566", + " 253 ret vec_len -> Ok(U32(5))": "cpu:23688", + " 254 call vec_len(Vec(obj#185))": "cpu:5363023, mem:2896", + " 255 ret vec_len -> Ok(U32(5))": "cpu:5363145", + " 256 ret bls12_381_g2_msm -> Ok(Bytes(obj#187))": "cpu:25610739, mem:236852, objs:-/94@37bd5b7d", + " 257 call vec_get(Vec(obj#173), U32(0))": "cpu:25614392, mem:237124, objs:-/95@47f3520c", + " 258 ret vec_get -> Ok(Bytes(obj#163))": "cpu:25614618", " 259 call vec_get(Vec(obj#185), U32(0))": "", - " 260 ret vec_get -> Ok(U256(obj#175))": "cpu:25604929", + " 260 ret vec_get -> Ok(U256(obj#175))": "cpu:25614844", " 261 call bls12_381_g2_mul(Bytes(obj#163), U256(obj#175))": "", - " 262 ret bls12_381_g2_mul -> Ok(Bytes(obj#191))": "cpu:34652525, mem:237396, objs:-/96@8cc676a4", + " 262 ret bls12_381_g2_mul -> Ok(Bytes(obj#191))": "cpu:34662440, mem:237396, objs:-/96@8cc676a4", " 263 call bls12_381_g2_add(Bytes(obj#189), Bytes(obj#191))": "", - " 264 ret bls12_381_g2_add -> Ok(Bytes(obj#193))": "cpu:34802154, mem:237668, objs:-/97@fd5accef", + " 264 ret bls12_381_g2_add -> Ok(Bytes(obj#193))": "cpu:34812069, mem:237668, objs:-/97@fd5accef", " 265 call vec_get(Vec(obj#173), U32(1))": "", - " 266 ret vec_get -> Ok(Bytes(obj#165))": "cpu:34802380", + " 266 ret vec_get -> Ok(Bytes(obj#165))": "cpu:34812295", " 267 call vec_get(Vec(obj#185), U32(1))": "", - " 268 ret vec_get -> Ok(U256(obj#177))": "cpu:34802606", + " 268 ret vec_get -> Ok(U256(obj#177))": "cpu:34812521", " 269 call bls12_381_g2_mul(Bytes(obj#165), U256(obj#177))": "", - " 270 ret bls12_381_g2_mul -> Ok(Bytes(obj#195))": "cpu:43850202, mem:237940, objs:-/98@287ee088", + " 270 ret bls12_381_g2_mul -> Ok(Bytes(obj#195))": "cpu:43860117, mem:237940, objs:-/98@287ee088", " 271 call bls12_381_g2_add(Bytes(obj#193), Bytes(obj#195))": "", - " 272 ret bls12_381_g2_add -> Ok(Bytes(obj#197))": "cpu:43999831, mem:238212, objs:-/99@85bfd7f9", + " 272 ret bls12_381_g2_add -> Ok(Bytes(obj#197))": "cpu:44009746, mem:238212, objs:-/99@85bfd7f9", " 273 call vec_get(Vec(obj#173), U32(2))": "", - " 274 ret vec_get -> Ok(Bytes(obj#167))": "cpu:44000057", + " 274 ret vec_get -> Ok(Bytes(obj#167))": "cpu:44009972", " 275 call vec_get(Vec(obj#185), U32(2))": "", - " 276 ret vec_get -> Ok(U256(obj#179))": "cpu:44000283", + " 276 ret vec_get -> Ok(U256(obj#179))": "cpu:44010198", " 277 call bls12_381_g2_mul(Bytes(obj#167), U256(obj#179))": "", - " 278 ret bls12_381_g2_mul -> Ok(Bytes(obj#199))": "cpu:53047879, mem:238484, objs:-/100@83eb557e", + " 278 ret bls12_381_g2_mul -> Ok(Bytes(obj#199))": "cpu:53057794, mem:238484, objs:-/100@83eb557e", " 279 call bls12_381_g2_add(Bytes(obj#197), Bytes(obj#199))": "", - " 280 ret bls12_381_g2_add -> Ok(Bytes(obj#201))": "cpu:53197508, mem:238756, objs:-/101@356eda48", + " 280 ret bls12_381_g2_add -> Ok(Bytes(obj#201))": "cpu:53207423, mem:238756, objs:-/101@356eda48", " 281 call vec_get(Vec(obj#173), U32(3))": "", - " 282 ret vec_get -> Ok(Bytes(obj#169))": "cpu:53197734", + " 282 ret vec_get -> Ok(Bytes(obj#169))": "cpu:53207649", " 283 call vec_get(Vec(obj#185), U32(3))": "", - " 284 ret vec_get -> Ok(U256(obj#181))": "cpu:53197960", + " 284 ret vec_get -> Ok(U256(obj#181))": "cpu:53207875", " 285 call bls12_381_g2_mul(Bytes(obj#169), U256(obj#181))": "", - " 286 ret bls12_381_g2_mul -> Ok(Bytes(obj#203))": "cpu:62245556, mem:239028, objs:-/102@633754c7", + " 286 ret bls12_381_g2_mul -> Ok(Bytes(obj#203))": "cpu:62255471, mem:239028, objs:-/102@633754c7", " 287 call bls12_381_g2_add(Bytes(obj#201), Bytes(obj#203))": "", - " 288 ret bls12_381_g2_add -> Ok(Bytes(obj#205))": "cpu:62395185, mem:239300, objs:-/103@d51e3c43", + " 288 ret bls12_381_g2_add -> Ok(Bytes(obj#205))": "cpu:62405100, mem:239300, objs:-/103@d51e3c43", " 289 call vec_get(Vec(obj#173), U32(4))": "", - " 290 ret vec_get -> Ok(Bytes(obj#171))": "cpu:62395411", + " 290 ret vec_get -> Ok(Bytes(obj#171))": "cpu:62405326", " 291 call vec_get(Vec(obj#185), U32(4))": "", - " 292 ret vec_get -> Ok(U256(obj#183))": "cpu:62395637", + " 292 ret vec_get -> Ok(U256(obj#183))": "cpu:62405552", " 293 call bls12_381_g2_mul(Bytes(obj#171), U256(obj#183))": "", - " 294 ret bls12_381_g2_mul -> Ok(Bytes(obj#207))": "cpu:71443233, mem:239572, objs:-/104@e5da1eed", + " 294 ret bls12_381_g2_mul -> Ok(Bytes(obj#207))": "cpu:71453148, mem:239572, objs:-/104@e5da1eed", " 295 call bls12_381_g2_add(Bytes(obj#205), Bytes(obj#207))": "", - " 296 ret bls12_381_g2_add -> Ok(Bytes(obj#209))": "cpu:71592862, mem:239844, objs:-/105@395f149e", + " 296 ret bls12_381_g2_add -> Ok(Bytes(obj#209))": "cpu:71602777, mem:239844, objs:-/105@395f149e", " 297 call obj_cmp(Bytes(obj#209), Bytes(obj#187))": "", - " 298 ret obj_cmp -> Ok(0)": "cpu:71593174", - " 299 end": "cpu:71593174, mem:239844, prngs:-/-, objs:-/105@395f149e, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 298 ret obj_cmp -> Ok(0)": "cpu:71603089", + " 299 end": "cpu:71603089, mem:239844, prngs:-/-, objs:-/105@395f149e, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json b/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json index e8225f15a..858be58a0 100644 --- a/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json +++ b/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json @@ -1,13 +1,13 @@ { " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", - " 1 call bytes_new_from_slice(95)": "cpu:661", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1644, mem:175, objs:-/1@14742518", + " 1 call bytes_new_from_slice(95)": "cpu:1322", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:2305, mem:175, objs:-/1@14742518", " 3 call bls12_381_map_fp2_to_g2(Bytes(obj#1))": "", - " 4 ret bls12_381_map_fp2_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:1766", - " 5 call bytes_new_from_slice(97)": "cpu:2427", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:3412, mem:352, objs:-/2@b8cae411", + " 4 ret bls12_381_map_fp2_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:2427", + " 5 call bytes_new_from_slice(97)": "cpu:4410", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:5395, mem:352, objs:-/2@b8cae411", " 7 call bls12_381_map_fp2_to_g2(Bytes(obj#3))": "", - " 8 ret bls12_381_map_fp2_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:3534", + " 8 ret bls12_381_map_fp2_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:5517", " 9 call bytes_new_from_slice(192)": "cpu:0, mem:0", " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:1009, mem:272, objs:-/3@84cbabcf", " 11 call bytes_new_from_slice(96)": "", diff --git a/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json b/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json index 6c4e39cd5..69440959a 100644 --- a/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json +++ b/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json @@ -4,10 +4,10 @@ " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1632, mem:127, objs:-/1@705fbc72", " 3 call bls12_381_map_fp_to_g1(Bytes(obj#1))": "", " 4 ret bls12_381_map_fp_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:1754", - " 5 call bytes_new_from_slice(49)": "cpu:2415", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:3388, mem:256, objs:-/2@7385e39e", + " 5 call bytes_new_from_slice(49)": "cpu:3076", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:4049, mem:256, objs:-/2@7385e39e", " 7 call bls12_381_map_fp_to_g1(Bytes(obj#3))": "", - " 8 ret bls12_381_map_fp_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:3510", + " 8 ret bls12_381_map_fp_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:4171", " 9 call bytes_new_from_slice(96)": "cpu:0, mem:0", " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:985, mem:176, objs:-/3@cdeaaaab", " 11 call bytes_new_from_slice(48)": "", diff --git a/soroban-env-host/observations/22/test__bls12_381__pairing.json b/soroban-env-host/observations/22/test__bls12_381__pairing.json index 67bad5244..3ea23e46d 100644 --- a/soroban-env-host/observations/22/test__bls12_381__pairing.json +++ b/soroban-env-host/observations/22/test__bls12_381__pairing.json @@ -1,69 +1,69 @@ { " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", - " 1 call bytes_new_from_slice(96)": "cpu:661", - " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:1646, mem:176, objs:-/1@2142c5f5", - " 3 call bytes_new_from_slice(96)": "cpu:2307", - " 4 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:3292, mem:352, objs:-/2@a5d3f802", - " 5 call bytes_new_from_slice(96)": "cpu:3953", - " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:4938, mem:528, objs:-/3@d1e19abc", + " 1 call bytes_new_from_slice(96)": "cpu:1322", + " 2 ret bytes_new_from_slice -> Ok(Bytes(obj#1))": "cpu:2307, mem:176, objs:-/1@2142c5f5", + " 3 call bytes_new_from_slice(96)": "cpu:3629", + " 4 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:4614, mem:352, objs:-/2@a5d3f802", + " 5 call bytes_new_from_slice(96)": "cpu:5936", + " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:6921, mem:528, objs:-/3@d1e19abc", " 7 call vec_new_from_slice(3)": "", - " 8 ret vec_new_from_slice -> Ok(Vec(obj#7))": "cpu:6088, mem:632, objs:-/4@8244fa30", - " 9 call bytes_new_from_slice(192)": "cpu:6749", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:7758, mem:904, objs:-/5@7db97cd4", - " 11 call bytes_new_from_slice(192)": "cpu:8419", - " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:9428, mem:1176, objs:-/6@2f986967", + " 8 ret vec_new_from_slice -> Ok(Vec(obj#7))": "cpu:8071, mem:632, objs:-/4@8244fa30", + " 9 call bytes_new_from_slice(192)": "cpu:10715", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:11724, mem:904, objs:-/5@7db97cd4", + " 11 call bytes_new_from_slice(192)": "cpu:14368", + " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:15377, mem:1176, objs:-/6@2f986967", " 13 call vec_new_from_slice(2)": "", - " 14 ret vec_new_from_slice -> Ok(Vec(obj#13))": "cpu:10515, mem:1272, objs:-/7@e86d844b", + " 14 ret vec_new_from_slice -> Ok(Vec(obj#13))": "cpu:16464, mem:1272, objs:-/7@e86d844b", " 15 call bls12_381_multi_pairing_check(Vec(obj#7), Vec(obj#13))": "", - " 16 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:10759", + " 16 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:16708", " 17 call vec_new_from_slice(0)": "", - " 18 ret vec_new_from_slice -> Ok(Vec(obj#15))": "cpu:11720, mem:1352, objs:-/8@aefe5995", + " 18 ret vec_new_from_slice -> Ok(Vec(obj#15))": "cpu:17669, mem:1352, objs:-/8@aefe5995", " 19 call vec_new_from_slice(0)": "", - " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:12681, mem:1432, objs:-/9@e19454cb", + " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:18630, mem:1432, objs:-/9@e19454cb", " 21 call bls12_381_multi_pairing_check(Vec(obj#15), Vec(obj#17))": "", - " 22 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:12925", - " 23 call bytes_new_from_slice(96)": "cpu:13586", - " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:14571, mem:1608, objs:-/10@d5c411e9", - " 25 call bytes_new_from_slice(96)": "cpu:15232", - " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:16217, mem:1784, objs:-/11@9371ef1d", - " 27 call bytes_new_from_slice(96)": "cpu:16878", - " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:17863, mem:1960, objs:-/12@3462be9a", + " 22 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:18874", + " 23 call bytes_new_from_slice(96)": "cpu:20196", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:21181, mem:1608, objs:-/10@d5c411e9", + " 25 call bytes_new_from_slice(96)": "cpu:22503", + " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:23488, mem:1784, objs:-/11@9371ef1d", + " 27 call bytes_new_from_slice(96)": "cpu:24810", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:25795, mem:1960, objs:-/12@3462be9a", " 29 call vec_new_from_slice(3)": "", - " 30 ret vec_new_from_slice -> Ok(Vec(obj#25))": "cpu:19013, mem:2064, objs:-/13@21b206a8", - " 31 call vec_put(Vec(obj#25), U32(1), Bytes(obj#27))": "cpu:21320, mem:2240, objs:-/14@211e7ae", - " 32 ret vec_put -> Ok(Vec(obj#29))": "cpu:22574, mem:2344, objs:-/15@d6218c40", - " 33 call bytes_new_from_slice(192)": "cpu:23235", - " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:24244, mem:2616, objs:-/16@1fbd75b9", - " 35 call bytes_new_from_slice(192)": "cpu:24905", - " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:25914, mem:2888, objs:-/17@eb01b50b", + " 30 ret vec_new_from_slice -> Ok(Vec(obj#25))": "cpu:26945, mem:2064, objs:-/13@21b206a8", + " 31 call vec_put(Vec(obj#25), U32(1), Bytes(obj#27))": "cpu:29252, mem:2240, objs:-/14@211e7ae", + " 32 ret vec_put -> Ok(Vec(obj#29))": "cpu:30506, mem:2344, objs:-/15@d6218c40", + " 33 call bytes_new_from_slice(192)": "cpu:33150", + " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:34159, mem:2616, objs:-/16@1fbd75b9", + " 35 call bytes_new_from_slice(192)": "cpu:36803", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:37812, mem:2888, objs:-/17@eb01b50b", " 37 call vec_new_from_slice(2)": "", - " 38 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:27001, mem:2984, objs:-/18@88878336", + " 38 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:38899, mem:2984, objs:-/18@88878336", " 39 call bls12_381_multi_pairing_check(Vec(obj#29), Vec(obj#35))": "", - " 40 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:27245", - " 41 call bytes_new_from_slice(96)": "cpu:27906", - " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:28891, mem:3160, objs:-/19@bef467b3", - " 43 call bytes_new_from_slice(96)": "cpu:29552", - " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:30537, mem:3336, objs:-/20@7711af03", - " 45 call bytes_new_from_slice(96)": "cpu:31198", - " 46 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:32183, mem:3512, objs:-/21@bd0eaa67", + " 40 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:39143", + " 41 call bytes_new_from_slice(96)": "cpu:40465", + " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:41450, mem:3160, objs:-/19@bef467b3", + " 43 call bytes_new_from_slice(96)": "cpu:42772", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:43757, mem:3336, objs:-/20@7711af03", + " 45 call bytes_new_from_slice(96)": "cpu:45079", + " 46 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:46064, mem:3512, objs:-/21@bd0eaa67", " 47 call vec_new_from_slice(3)": "", - " 48 ret vec_new_from_slice -> Ok(Vec(obj#43))": "cpu:33333, mem:3616, objs:-/22@4745d9cc", - " 49 call bytes_new_from_slice(192)": "cpu:33994", - " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#45))": "cpu:35003, mem:3888, objs:-/23@2ac90b2", - " 51 call bytes_new_from_slice(192)": "cpu:35664", - " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:36673, mem:4160, objs:-/24@d104dc23", - " 53 call bytes_new_from_slice(192)": "cpu:37334", - " 54 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:38343, mem:4432, objs:-/25@11f7750c", + " 48 ret vec_new_from_slice -> Ok(Vec(obj#43))": "cpu:47214, mem:3616, objs:-/22@4745d9cc", + " 49 call bytes_new_from_slice(192)": "cpu:49858", + " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#45))": "cpu:50867, mem:3888, objs:-/23@2ac90b2", + " 51 call bytes_new_from_slice(192)": "cpu:53511", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:54520, mem:4160, objs:-/24@d104dc23", + " 53 call bytes_new_from_slice(192)": "cpu:57164", + " 54 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:58173, mem:4432, objs:-/25@11f7750c", " 55 call vec_new_from_slice(3)": "", - " 56 ret vec_new_from_slice -> Ok(Vec(obj#51))": "cpu:39493, mem:4536, objs:-/26@ada08c01", - " 57 call vec_put(Vec(obj#51), U32(1), Bytes(obj#53))": "cpu:43146, mem:4808, objs:-/27@f2ac27ac", - " 58 ret vec_put -> Ok(Vec(obj#55))": "cpu:44400, mem:4912, objs:-/28@6d6b0a1", + " 56 ret vec_new_from_slice -> Ok(Vec(obj#51))": "cpu:59323, mem:4536, objs:-/26@ada08c01", + " 57 call vec_put(Vec(obj#51), U32(1), Bytes(obj#53))": "cpu:62976, mem:4808, objs:-/27@f2ac27ac", + " 58 ret vec_put -> Ok(Vec(obj#55))": "cpu:64230, mem:4912, objs:-/28@6d6b0a1", " 59 call bls12_381_multi_pairing_check(Vec(obj#43), Vec(obj#55))": "", - " 60 call vec_len(Vec(obj#43))": "cpu:44644", - " 61 ret vec_len -> Ok(U32(3))": "cpu:44766", - " 62 call vec_len(Vec(obj#55))": "cpu:2248722, mem:5216", - " 63 ret vec_len -> Ok(U32(3))": "cpu:2248844", - " 64 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:3327077, mem:5808", + " 60 call vec_len(Vec(obj#43))": "cpu:64474", + " 61 ret vec_len -> Ok(U32(3))": "cpu:64596", + " 62 call vec_len(Vec(obj#55))": "cpu:2268552, mem:5216", + " 63 ret vec_len -> Ok(U32(3))": "cpu:2268674", + " 64 ret bls12_381_multi_pairing_check -> Err(Error(Crypto, InvalidInput))": "cpu:3346907, mem:5808", " 65 call bls12_381_g2_add(Bytes(obj#61), Bytes(obj#63))": "cpu:746395, mem:896, objs:-/32@be1f7a8e", " 66 ret bls12_381_g2_add -> Ok(Bytes(obj#65))": "cpu:896024, mem:1168, objs:-/33@9d890a7b", " 67 call vec_new_from_slice(3)": "", @@ -118,54 +118,54 @@ " 116 call vec_len(Vec(obj#113))": "cpu:41777386, mem:3304", " 117 ret vec_len -> Ok(U32(4))": "cpu:41777508", " 118 ret bls12_381_multi_pairing_check -> Ok(True)": "cpu:76385043, mem:298181", - " 119 call bytes_new_from_slice(96)": "cpu:661, mem:0", - " 120 ret bytes_new_from_slice -> Ok(Bytes(obj#115))": "cpu:1646, mem:176, objs:-/58@ac299a82", - " 121 call bytes_new_from_slice(96)": "cpu:2307", - " 122 ret bytes_new_from_slice -> Ok(Bytes(obj#117))": "cpu:3292, mem:352, objs:-/59@113198f9", - " 123 call bytes_new_from_slice(96)": "cpu:3953", - " 124 ret bytes_new_from_slice -> Ok(Bytes(obj#119))": "cpu:4938, mem:528, objs:-/60@37eadd60", + " 119 call bytes_new_from_slice(96)": "cpu:1322, mem:0", + " 120 ret bytes_new_from_slice -> Ok(Bytes(obj#115))": "cpu:2307, mem:176, objs:-/58@ac299a82", + " 121 call bytes_new_from_slice(96)": "cpu:3629", + " 122 ret bytes_new_from_slice -> Ok(Bytes(obj#117))": "cpu:4614, mem:352, objs:-/59@113198f9", + " 123 call bytes_new_from_slice(96)": "cpu:5936", + " 124 ret bytes_new_from_slice -> Ok(Bytes(obj#119))": "cpu:6921, mem:528, objs:-/60@37eadd60", " 125 call vec_new_from_slice(3)": "", - " 126 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:6088, mem:632, objs:-/61@b3526a16", - " 127 call vec_put(Vec(obj#121), U32(1), Bytes(obj#123))": "cpu:8395, mem:808, objs:-/62@e4a76af5", - " 128 ret vec_put -> Ok(Vec(obj#125))": "cpu:9649, mem:912, objs:-/63@5b689763", - " 129 call bytes_new_from_slice(192)": "cpu:10310", - " 130 ret bytes_new_from_slice -> Ok(Bytes(obj#127))": "cpu:11319, mem:1184, objs:-/64@8aa5fc15", - " 131 call bytes_new_from_slice(192)": "cpu:11980", - " 132 ret bytes_new_from_slice -> Ok(Bytes(obj#129))": "cpu:12989, mem:1456, objs:-/65@b4fc63e0", - " 133 call bytes_new_from_slice(192)": "cpu:13650", - " 134 ret bytes_new_from_slice -> Ok(Bytes(obj#131))": "cpu:14659, mem:1728, objs:-/66@5c98ecb1", + " 126 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:8071, mem:632, objs:-/61@b3526a16", + " 127 call vec_put(Vec(obj#121), U32(1), Bytes(obj#123))": "cpu:10378, mem:808, objs:-/62@e4a76af5", + " 128 ret vec_put -> Ok(Vec(obj#125))": "cpu:11632, mem:912, objs:-/63@5b689763", + " 129 call bytes_new_from_slice(192)": "cpu:14276", + " 130 ret bytes_new_from_slice -> Ok(Bytes(obj#127))": "cpu:15285, mem:1184, objs:-/64@8aa5fc15", + " 131 call bytes_new_from_slice(192)": "cpu:17929", + " 132 ret bytes_new_from_slice -> Ok(Bytes(obj#129))": "cpu:18938, mem:1456, objs:-/65@b4fc63e0", + " 133 call bytes_new_from_slice(192)": "cpu:21582", + " 134 ret bytes_new_from_slice -> Ok(Bytes(obj#131))": "cpu:22591, mem:1728, objs:-/66@5c98ecb1", " 135 call vec_new_from_slice(3)": "", - " 136 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:15809, mem:1832, objs:-/67@3f3912a7", + " 136 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:23741, mem:1832, objs:-/67@3f3912a7", " 137 call bls12_381_multi_pairing_check(Vec(obj#125), Vec(obj#133))": "", - " 138 call vec_len(Vec(obj#125))": "cpu:16053", - " 139 ret vec_len -> Ok(U32(3))": "cpu:16175", - " 140 call vec_len(Vec(obj#133))": "cpu:2220131, mem:2136", - " 141 ret vec_len -> Ok(U32(3))": "cpu:2220253", - " 142 ret bls12_381_multi_pairing_check -> Ok(False)": "cpu:30815794, mem:223849", - " 143 call bytes_new_from_slice(96)": "cpu:661, mem:0", - " 144 ret bytes_new_from_slice -> Ok(Bytes(obj#135))": "cpu:1646, mem:176, objs:-/68@47cc533a", - " 145 call bytes_new_from_slice(96)": "cpu:2307", - " 146 ret bytes_new_from_slice -> Ok(Bytes(obj#137))": "cpu:3292, mem:352, objs:-/69@9420de5f", - " 147 call bytes_new_from_slice(96)": "cpu:3953", - " 148 ret bytes_new_from_slice -> Ok(Bytes(obj#139))": "cpu:4938, mem:528, objs:-/70@f09a5b7a", + " 138 call vec_len(Vec(obj#125))": "cpu:23985", + " 139 ret vec_len -> Ok(U32(3))": "cpu:24107", + " 140 call vec_len(Vec(obj#133))": "cpu:2228063, mem:2136", + " 141 ret vec_len -> Ok(U32(3))": "cpu:2228185", + " 142 ret bls12_381_multi_pairing_check -> Ok(False)": "cpu:30823726, mem:223849", + " 143 call bytes_new_from_slice(96)": "cpu:1322, mem:0", + " 144 ret bytes_new_from_slice -> Ok(Bytes(obj#135))": "cpu:2307, mem:176, objs:-/68@47cc533a", + " 145 call bytes_new_from_slice(96)": "cpu:3629", + " 146 ret bytes_new_from_slice -> Ok(Bytes(obj#137))": "cpu:4614, mem:352, objs:-/69@9420de5f", + " 147 call bytes_new_from_slice(96)": "cpu:5936", + " 148 ret bytes_new_from_slice -> Ok(Bytes(obj#139))": "cpu:6921, mem:528, objs:-/70@f09a5b7a", " 149 call vec_new_from_slice(3)": "", - " 150 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:6088, mem:632, objs:-/71@71e61918", - " 151 call bytes_new_from_slice(192)": "cpu:6749", - " 152 ret bytes_new_from_slice -> Ok(Bytes(obj#143))": "cpu:7758, mem:904, objs:-/72@b2c885b9", - " 153 call bytes_new_from_slice(192)": "cpu:8419", - " 154 ret bytes_new_from_slice -> Ok(Bytes(obj#145))": "cpu:9428, mem:1176, objs:-/73@890ee9f4", - " 155 call bytes_new_from_slice(192)": "cpu:10089", - " 156 ret bytes_new_from_slice -> Ok(Bytes(obj#147))": "cpu:11098, mem:1448, objs:-/74@c894f888", + " 150 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:8071, mem:632, objs:-/71@71e61918", + " 151 call bytes_new_from_slice(192)": "cpu:10715", + " 152 ret bytes_new_from_slice -> Ok(Bytes(obj#143))": "cpu:11724, mem:904, objs:-/72@b2c885b9", + " 153 call bytes_new_from_slice(192)": "cpu:14368", + " 154 ret bytes_new_from_slice -> Ok(Bytes(obj#145))": "cpu:15377, mem:1176, objs:-/73@890ee9f4", + " 155 call bytes_new_from_slice(192)": "cpu:18021", + " 156 ret bytes_new_from_slice -> Ok(Bytes(obj#147))": "cpu:19030, mem:1448, objs:-/74@c894f888", " 157 call vec_new_from_slice(3)": "", - " 158 ret vec_new_from_slice -> Ok(Vec(obj#149))": "cpu:12248, mem:1552, objs:-/75@6f0bc56a", - " 159 call vec_put(Vec(obj#149), U32(2), Bytes(obj#151))": "cpu:15901, mem:1824, objs:-/76@85e20168", - " 160 ret vec_put -> Ok(Vec(obj#153))": "cpu:17155, mem:1928, objs:-/77@35e77666", + " 158 ret vec_new_from_slice -> Ok(Vec(obj#149))": "cpu:20180, mem:1552, objs:-/75@6f0bc56a", + " 159 call vec_put(Vec(obj#149), U32(2), Bytes(obj#151))": "cpu:23833, mem:1824, objs:-/76@85e20168", + " 160 ret vec_put -> Ok(Vec(obj#153))": "cpu:25087, mem:1928, objs:-/77@35e77666", " 161 call bls12_381_multi_pairing_check(Vec(obj#141), Vec(obj#153))": "", - " 162 call vec_len(Vec(obj#141))": "cpu:17399", - " 163 ret vec_len -> Ok(U32(3))": "cpu:17521", - " 164 call vec_len(Vec(obj#153))": "cpu:2221477, mem:2232", - " 165 ret vec_len -> Ok(U32(3))": "cpu:2221599", - " 166 ret bls12_381_multi_pairing_check -> Ok(False)": "cpu:30817140, mem:223945", + " 162 call vec_len(Vec(obj#141))": "cpu:25331", + " 163 ret vec_len -> Ok(U32(3))": "cpu:25453", + " 164 call vec_len(Vec(obj#153))": "cpu:2229409, mem:2232", + " 165 ret vec_len -> Ok(U32(3))": "cpu:2229531", + " 166 ret bls12_381_multi_pairing_check -> Ok(False)": "cpu:30825072, mem:223945", " 167 call vec_new_from_slice(5)": "cpu:11535, mem:880, objs:-/82@40297403", " 168 ret vec_new_from_slice -> Ok(Vec(obj#165))": "cpu:12811, mem:1000, objs:-/83@2d838f8e", " 169 call vec_new_from_slice(5)": "cpu:31076, mem:2360, objs:-/88@c33dc4c0", diff --git a/soroban-env-host/observations/22/test__bls12_381__test_serialization_roundtrip.json b/soroban-env-host/observations/22/test__bls12_381__test_serialization_roundtrip.json new file mode 100644 index 000000000..c726bf0d3 --- /dev/null +++ b/soroban-env-host/observations/22/test__bls12_381__test_serialization_roundtrip.json @@ -0,0 +1,44 @@ +{ + " 0 begin": "cpu:0, mem:0, prngs:-/-, objs:-/-, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-", + " 1 call obj_from_u256_pieces(2395589458197215953, 3306305587277880961, 1302117398068482837, 1091207826991875146)": "cpu:50772796, mem:28008, objs:-/137@d07a46d8", + " 2 ret obj_from_u256_pieces -> Ok(U256(obj#275))": "cpu:50773297, mem:28072, objs:-/138@99d5e5d2", + " 3 call obj_from_u256_pieces(4030740013859617607, 13817590489558995017, 443594582117458576, 245589856645029399)": "cpu:50776507, mem:28320", + " 4 ret obj_from_u256_pieces -> Ok(U256(obj#277))": "cpu:50777008, mem:28384, objs:-/139@ce81e5d9", + " 5 call obj_from_u256_pieces(2309403286221278731, 240231957602763745, 18358523006851037387, 13739599435256500115)": "cpu:50780218, mem:28632", + " 6 ret obj_from_u256_pieces -> Ok(U256(obj#279))": "cpu:50780719, mem:28696, objs:-/140@279a975", + " 7 call obj_from_u256_pieces(5744460099082395691, 11679559040025848215, 5800079206407269482, 14330949528024819573)": "cpu:50783929, mem:28944", + " 8 ret obj_from_u256_pieces -> Ok(U256(obj#281))": "cpu:50784430, mem:29008, objs:-/141@3f854b89", + " 9 call obj_from_u256_pieces(912784256554815413, 7739630991749586382, 11693624627592045674, 9648884353269389255)": "cpu:50787640, mem:29256", + " 10 ret obj_from_u256_pieces -> Ok(U256(obj#283))": "cpu:50788141, mem:29320, objs:-/142@24879da6", + " 11 call obj_from_u256_pieces(1298169624505566978, 11840534902383509259, 10489044078202748843, 10046771591107357601)": "cpu:50791351, mem:29568", + " 12 ret obj_from_u256_pieces -> Ok(U256(obj#285))": "cpu:50791852, mem:29632, objs:-/143@765f0703", + " 13 call obj_from_u256_pieces(4462537922610993750, 5476907946140276402, 15301198056592352265, 8829090581031049060)": "cpu:50795062, mem:29880", + " 14 ret obj_from_u256_pieces -> Ok(U256(obj#287))": "cpu:50795563, mem:29944, objs:-/144@fc5d4293", + " 15 call obj_from_u256_pieces(1483814255270150809, 2240693107019974066, 11035480608488985609, 5591664456856301659)": "cpu:50798773, mem:30192", + " 16 ret obj_from_u256_pieces -> Ok(U256(obj#289))": "cpu:50799274, mem:30256, objs:-/145@3c777c38", + " 17 call obj_from_u256_pieces(2823066946149997955, 4017845098771023863, 2091132495329236295, 4382883068235871617)": "cpu:50802484, mem:30504", + " 18 ret obj_from_u256_pieces -> Ok(U256(obj#291))": "cpu:50802985, mem:30568, objs:-/146@5fdd6fd7", + " 19 call obj_from_u256_pieces(8147738635046659263, 10838147310065800303, 9456691195047663294, 4156381095270017721)": "cpu:50806195, mem:30816", + " 20 ret obj_from_u256_pieces -> Ok(U256(obj#293))": "cpu:50806696, mem:30880, objs:-/147@d2116a6", + " 21 call obj_from_u256_pieces(4759692657470168240, 3248115619405505989, 1935398248938956755, 17870100943070610895)": "cpu:50809906, mem:31128", + " 22 ret obj_from_u256_pieces -> Ok(U256(obj#295))": "cpu:50810407, mem:31192, objs:-/148@d3aca663", + " 23 call obj_from_u256_pieces(6299505550503794325, 934313480772554357, 9575559878597866574, 13968606194827052782)": "cpu:50813617, mem:31440", + " 24 ret obj_from_u256_pieces -> Ok(U256(obj#297))": "cpu:50814118, mem:31504, objs:-/149@49b852dc", + " 25 call obj_from_u256_pieces(5154620316501156786, 16487987160575941779, 7214314208877781085, 7991574812575765638)": "cpu:50817328, mem:31752", + " 26 ret obj_from_u256_pieces -> Ok(U256(obj#299))": "cpu:50817829, mem:31816, objs:-/150@9ae0887", + " 27 call obj_from_u256_pieces(532576566866806321, 10721499738797675969, 16215558025196189643, 12632335931862967898)": "cpu:50821039, mem:32064", + " 28 ret obj_from_u256_pieces -> Ok(U256(obj#301))": "cpu:50821540, mem:32128, objs:-/151@22cb95b8", + " 29 call obj_from_u256_pieces(8159131102163283424, 8923210778304361529, 1540766709305171743, 2989208879561351542)": "cpu:50824750, mem:32376", + " 30 ret obj_from_u256_pieces -> Ok(U256(obj#303))": "cpu:50825251, mem:32440, objs:-/152@ed27ba1d", + " 31 call obj_from_u256_pieces(5698022951443837324, 16779749181027918978, 6902233456353033725, 10646855747138121935)": "cpu:50828461, mem:32688", + " 32 ret obj_from_u256_pieces -> Ok(U256(obj#305))": "cpu:50828962, mem:32752, objs:-/153@7d1f6066", + " 33 call obj_from_u256_pieces(3849184316064635501, 8312667462643589578, 14602721145082682090, 4963389936466161700)": "cpu:50832172, mem:33000", + " 34 ret obj_from_u256_pieces -> Ok(U256(obj#307))": "cpu:50832673, mem:33064, objs:-/154@610bedde", + " 35 call obj_from_u256_pieces(6428876429662729984, 1159517746365042179, 5484564165453778753, 15411623082197541403)": "cpu:50835883, mem:33312", + " 36 ret obj_from_u256_pieces -> Ok(U256(obj#309))": "cpu:50836384, mem:33376, objs:-/155@40c4136a", + " 37 call obj_from_u256_pieces(801460342213299702, 9908357551484169280, 1024931740778734376, 6858226285216280857)": "cpu:50839594, mem:33624", + " 38 ret obj_from_u256_pieces -> Ok(U256(obj#311))": "cpu:50840095, mem:33688, objs:-/156@794e1c81", + " 39 call obj_from_u256_pieces(3249626194219012092, 12917896548134785039, 10675741979518937446, 3611643771666195033)": "cpu:50843305, mem:33936", + " 40 ret obj_from_u256_pieces -> Ok(U256(obj#313))": "cpu:50843806, mem:34000, objs:-/157@1912f2a7", + " 41 end": "cpu:50845861, mem:34000, prngs:-/-, objs:-/157@1912f2a7, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" +} \ No newline at end of file diff --git a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs index 301791037..a50dc891f 100644 --- a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs +++ b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs @@ -3,6 +3,7 @@ use ark_ec::pairing::PairingOutput; use crate::{ cost_runner::{CostRunner, CostType}, + crypto::bls12_381::FP_SERIALIZED_SIZE, impl_const_cost_runner_for_bls_consume_sample, impl_const_cost_runner_for_bls_deref_sample, impl_lin_cost_runner_for_bls_deref_sample, xdr::ContractCostType::{ @@ -251,7 +252,7 @@ impl CostRunner for Bls12381EncodeFpRun { ) -> Self::RecycledType { let Bls12381EncodeFpSample(buf, fp) = &mut sample; let _ = host - .serialize_uncompressed_into_slice(fp, buf, 1, "test") + .serialize_uncompressed_into_slice::(fp, buf, "test") .unwrap(); black_box(Some(sample)) } @@ -282,7 +283,7 @@ impl CostRunner for Bls12381DecodeFpRun { ) -> Self::RecycledType { let Bls12381DecodeFpSample(buf) = &sample; let res = host - .deserialize_uncompessed_no_validate(buf, 1, "test") + .deserialize_uncompessed_no_validate::(buf, "test") .unwrap(); black_box((Some(sample), Some(res))) } diff --git a/soroban-env-host/src/crypto/bls12_381.rs b/soroban-env-host/src/crypto/bls12_381.rs index c6554c698..8b8a26708 100644 --- a/soroban-env-host/src/crypto/bls12_381.rs +++ b/soroban-env-host/src/crypto/bls12_381.rs @@ -6,14 +6,19 @@ use crate::{ U256Small, U256Val, Val, VecObject, U256, }; use ark_bls12_381::{ - Bls12_381, Fq, Fq12, Fq2, Fr, G1Affine, G1Projective, G2Affine, G2Projective, + g1::Config as G1Config, g2::Config as G2Config, Bls12_381, Fq, Fq12, Fq2, Fr, G1Affine, + G1Projective, G2Affine, G2Projective, }; use ark_ec::{ hashing::{ curve_maps::wb::{WBConfig, WBMap}, map_to_curve_hasher::{MapToCurve, MapToCurveBasedHasher}, HashToCurve, - }, pairing::{Pairing, PairingOutput}, scalar_mul::variable_base::VariableBaseMSM, short_weierstrass::{Affine, Projective, SWCurveConfig}, AffineRepr, CurveGroup + }, + pairing::{Pairing, PairingOutput}, + scalar_mul::variable_base::VariableBaseMSM, + short_weierstrass::{Affine, Projective, SWCurveConfig}, + AffineRepr, CurveGroup, }; use ark_ff::{field_hashers::DefaultFieldHasher, BigInteger, Field, PrimeField}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Validate}; @@ -29,20 +34,41 @@ pub(crate) const G1_SERIALIZED_SIZE: usize = FP_SERIALIZED_SIZE * 2; pub(crate) const G2_SERIALIZED_SIZE: usize = FP2_SERIALIZED_SIZE * 2; pub(crate) const FR_SERIALIZED_SIZE: usize = 32; +#[inline(always)] +fn units_of_fp() -> u64 { + ((EXPECTED_SIZE + FP_SERIALIZED_SIZE - 1) / FP_SERIALIZED_SIZE) as u64 +} + impl Host { // This is the internal routine performing deserialization on various // element types, which can be conceptually decomposed into units of Fp // (the base field element), and will be charged accordingly. // Validation of the deserialized entity must be performed outside of this // function, to keep budget charging isolated. - pub(crate) fn deserialize_uncompessed_no_validate( + pub(crate) fn deserialize_uncompessed_no_validate< + const EXPECTED_SIZE: usize, + T: CanonicalDeserialize, + >( &self, slice: &[u8], - units_of_fp: u64, msg: &str, ) -> Result { - self.as_budget() - .bulk_charge(ContractCostType::Bls12381DecodeFp, units_of_fp, None)?; + if EXPECTED_SIZE == 0 || slice.len() != EXPECTED_SIZE { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!("bls12-381 {msg}: invalid input length to deserialize").as_str(), + &[ + Val::from_u32(slice.len() as u32).into(), + Val::from_u32(EXPECTED_SIZE as u32).into(), + ], + )); + } + self.as_budget().bulk_charge( + ContractCostType::Bls12381DecodeFp, + units_of_fp::(), + None, + )?; // validation turned off here to isolate the cost of serialization. // proper validation has to be performed outside of this function T::deserialize_with_mode(slice, Compress::No, Validate::No).map_err(|_e| { @@ -58,15 +84,31 @@ impl Host { // This is the internal routine performing serialization on various // element types, which can be conceptually decomposed into units of Fp // (the base field element), and will be charged accordingly. - pub(crate) fn serialize_uncompressed_into_slice( + pub(crate) fn serialize_uncompressed_into_slice< + const EXPECTED_SIZE: usize, + T: CanonicalSerialize, + >( &self, element: &T, buf: &mut [u8], - units_of_fp: u64, msg: &str, ) -> Result<(), HostError> { - self.as_budget() - .bulk_charge(ContractCostType::Bls12381EncodeFp, units_of_fp, None)?; + if EXPECTED_SIZE == 0 || buf.len() != EXPECTED_SIZE { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!("bls12-381 {msg}: invalid buffer length to serialize into").as_str(), + &[ + Val::from_u32(buf.len() as u32).into(), + Val::from_u32(EXPECTED_SIZE as u32).into(), + ], + )); + } + self.as_budget().bulk_charge( + ContractCostType::Bls12381EncodeFp, + units_of_fp::(), + None, + )?; element.serialize_uncompressed(buf).map_err(|_e| { self.err( ScErrorType::Crypto, @@ -136,34 +178,19 @@ impl Host { Ok(pt.is_in_correct_subgroup_assuming_on_curve()) } - pub(crate) fn g1_affine_deserialize_from_bytesobj( + pub(crate) fn affine_deserialize( &self, bo: BytesObject, + ct_curve: ContractCostType, subgroup_check: bool, - ) -> Result { - let msg: &str = "G1"; - let pt: G1Affine = self.visit_obj(bo, |bytes: &ScBytes| { - self.validate_point_encoding::(&bytes, msg)?; - // `CanonicalDeserialize` of `Affine

` calls into - // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::g1::Config`, the - // core logic is in `arc_bls12_381::curves::util::read_g1_uncompressed`. - // - // The `arc_bls12_381` lib already expects the input to be serialized in - // big-endian order (aligning with the common standard and contrary - // to ark::serialize's convention), - // - // i.e. `input = be_bytes(X) || be_bytes(Y)` and the - // most-significant three bits of X are flags: - // - // `bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` - // - // internally when deserializing `Fp`, the flag bits are masked off - // to get `X: Fp`. The Y however, does not have the top bits masked off - // so it is possible for Y to exceed 381 bits. I've checked all over and - // didn't find that being an invalid condition, so we will leave them as is. - self.deserialize_uncompessed_no_validate(&bytes, 2, msg) + ct_subgroup: ContractCostType, + msg: &str, + ) -> Result, HostError> { + let pt: Affine

= self.visit_obj(bo, |bytes: &ScBytes| { + self.validate_point_encoding::(&bytes, msg)?; + self.deserialize_uncompessed_no_validate::(bytes.as_slice(), msg) })?; - if !self.check_point_is_on_curve(&pt, &ContractCostType::Bls12381G1CheckPointOnCurve)? { + if !self.check_point_is_on_curve(&pt, &ct_curve)? { return Err(self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, @@ -171,12 +198,7 @@ impl Host { &[], )); } - if subgroup_check - && !self.check_point_is_in_subgroup( - &pt, - &ContractCostType::Bls12381G1CheckPointInSubgroup, - )? - { + if subgroup_check && !self.check_point_is_in_subgroup(&pt, &ct_subgroup)? { return Err(self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, @@ -187,55 +209,66 @@ impl Host { Ok(pt) } + pub(crate) fn g1_affine_deserialize_from_bytesobj( + &self, + bo: BytesObject, + subgroup_check: bool, + ) -> Result { + // `CanonicalDeserialize` of `Affine

` calls into + // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::g1::Config`, the + // core logic is in `arc_bls12_381::curves::util::read_g1_uncompressed`. + // + // The `arc_bls12_381` lib already expects the input to be serialized in + // big-endian order (aligning with the common standard and contrary + // to ark::serialize's convention), + // + // i.e. `input = be_bytes(X) || be_bytes(Y)` and the + // most-significant three bits of X are flags: + // + // `bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` + // + // internally when deserializing `Fp`, the flag bits are masked off + // to get `X: Fp`. The Y however, does not have the top bits masked off + // so it is possible for Y to exceed 381 bits. I've checked all over and + // didn't find that being an invalid condition, so we will leave them as is. + self.affine_deserialize::( + bo, + ContractCostType::Bls12381G1CheckPointOnCurve, + subgroup_check, + ContractCostType::Bls12381G1CheckPointInSubgroup, + "G1", + ) + } + pub(crate) fn g2_affine_deserialize_from_bytesobj( &self, bo: BytesObject, subgroup_check: bool, ) -> Result { - let msg: &str = "G2"; - let pt: G2Affine = self.visit_obj(bo, |bytes: &ScBytes| { - self.validate_point_encoding::(&bytes, msg)?; - // `CanonicalDeserialize` of `Affine

` calls into - // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::g2::Config`, the - // core logic is in `arc_bls12_381::curves::util::read_g2_uncompressed`. - // - // The `arc_bls12_381` lib already expects the input to be serialized in - // big-endian order (aligning with the common standard and contrary - // to ark::serialize's convention), - // - // i.e. `input = be_bytes(X) || be_bytes(Y)` and the - // most-significant three bits of X are flags: - // - // `bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` - // - // internally when deserializing `Fp`, the flag bits are masked off - // to get `X: Fp`. The Y however, does not have the top bits masked off - // so it is possible for Y to exceed 381 bits. I've checked all over and - // didn't find that being an invalid condition, so we will leave them as is. - self.deserialize_uncompessed_no_validate(&bytes, 4, msg) - })?; - if !self.check_point_is_on_curve(&pt, &ContractCostType::Bls12381G2CheckPointOnCurve)? { - return Err(self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - format!("bls12-381 {}: point not on curve", msg).as_str(), - &[], - )); - } - if subgroup_check - && !self.check_point_is_in_subgroup( - &pt, - &ContractCostType::Bls12381G2CheckPointInSubgroup, - )? - { - return Err(self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - format!("bls12-381 {}: point not in the correct subgroup", msg).as_str(), - &[], - )); - } - Ok(pt) + // `CanonicalDeserialize` of `Affine

` calls into + // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::g2::Config`, the + // core logic is in `arc_bls12_381::curves::util::read_g2_uncompressed`. + // + // The `arc_bls12_381` lib already expects the input to be serialized in + // big-endian order (aligning with the common standard and contrary + // to ark::serialize's convention), + // + // i.e. `input = be_bytes(X) || be_bytes(Y)` and the + // most-significant three bits of X are flags: + // + // `bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` + // + // internally when deserializing `Fp`, the flag bits are masked off + // to get `X: Fp`. The Y however, does not have the top bits masked off + // so it is possible for Y to exceed 381 bits. I've checked all over and + // didn't find that being an invalid condition, so we will leave them as is. + self.affine_deserialize::( + bo, + ContractCostType::Bls12381G2CheckPointOnCurve, + subgroup_check, + ContractCostType::Bls12381G2CheckPointInSubgroup, + "G2", + ) } pub(crate) fn g1_projective_into_affine( @@ -248,7 +281,7 @@ impl Host { pub(crate) fn g1_affine_serialize_uncompressed( &self, - g1: G1Affine, + g1: &G1Affine, ) -> Result { let mut buf = [0; G1_SERIALIZED_SIZE]; // `CanonicalSerialize of Affine

` calls into @@ -260,7 +293,7 @@ impl Host { // // This aligns with our chosen standard // (https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) - self.serialize_uncompressed_into_slice(&g1, &mut buf, 2, "G1")?; + self.serialize_uncompressed_into_slice::(g1, &mut buf, "G1")?; self.add_host_object(self.scbytes_from_slice(&buf)?) } @@ -269,7 +302,7 @@ impl Host { g1: G1Projective, ) -> Result { let g1_affine = self.g1_projective_into_affine(g1)?; - self.g1_affine_serialize_uncompressed(g1_affine) + self.g1_affine_serialize_uncompressed(&g1_affine) } pub(crate) fn g2_projective_into_affine( @@ -282,7 +315,7 @@ impl Host { pub(crate) fn g2_affine_serialize_uncompressed( &self, - g2: G2Affine, + g2: &G2Affine, ) -> Result { let mut buf = [0; G2_SERIALIZED_SIZE]; // `CanonicalSerialization of Affine

` where `P` is `ark_bls12_381::curves::g2::Config`, @@ -295,7 +328,7 @@ impl Host { // `bits(X_c1) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` // // This aligns with the standard we've picked https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization - self.serialize_uncompressed_into_slice(&g2, &mut buf, 4, "G2")?; + self.serialize_uncompressed_into_slice::(g2, &mut buf, "G2")?; self.add_host_object(self.scbytes_from_slice(&buf)?) } @@ -304,7 +337,7 @@ impl Host { g2: G2Projective, ) -> Result { let g2_affine = self.g2_projective_into_affine(g2)?; - self.g2_affine_serialize_uncompressed(g2_affine) + self.g2_affine_serialize_uncompressed(&g2_affine) } pub(crate) fn fr_from_u256val(&self, sv: U256Val) -> Result { @@ -336,64 +369,57 @@ impl Host { self.map_err(U256Val::try_from_val(self, &u)) } - pub(crate) fn fp_deserialize_from_bytesobj(&self, bo: BytesObject) -> Result { - let expected_size = FP_SERIALIZED_SIZE; + pub(crate) fn field_element_deserialize( + &self, + bo: BytesObject, + msg: &str, + ) -> Result { self.visit_obj(bo, |bytes: &ScBytes| { - if bytes.len() != expected_size { + if bytes.len() != EXPECTED_SIZE { return Err(self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, - "bls12-381 field element (Fp): invalid input length to deserialize", + format!( + "bls12-381 field element {}: invalid input length to deserialize", + msg + ) + .as_str(), &[ Val::from_u32(bytes.len() as u32).into(), - Val::from_u32(expected_size as u32).into(), + Val::from_u32(EXPECTED_SIZE as u32).into(), ], )); } - // `CanonicalDeserialize for Fp` assumes input bytes in - // little-endian order, with the highest bits being empty flags. - // thus we must first reverse the bytes before passing them in. - // there is no other check for Fp besides the length check. - self.charge_budget(ContractCostType::MemCpy, Some(FP_SERIALIZED_SIZE as u64))?; - let mut buf = [0u8; FP_SERIALIZED_SIZE]; + self.charge_budget(ContractCostType::MemCpy, Some(EXPECTED_SIZE as u64))?; + let mut buf = [0u8; EXPECTED_SIZE]; buf.copy_from_slice(bytes); buf.reverse(); - self.deserialize_uncompessed_no_validate(&buf, 1, "Fp") + self.deserialize_uncompessed_no_validate::(&buf, msg) }) } + pub(crate) fn fp_deserialize_from_bytesobj(&self, bo: BytesObject) -> Result { + // `CanonicalDeserialize for Fp` assumes input bytes in + // little-endian order, with the highest bits being empty flags. + // thus we must first reverse the bytes before passing them in. + // there is no other check for Fp besides the length check. + self.field_element_deserialize::(bo, "Fp") + } + pub(crate) fn fp2_deserialize_from_bytesobj(&self, bo: BytesObject) -> Result { - let expected_size = FP2_SERIALIZED_SIZE; - self.visit_obj(bo, |bytes: &ScBytes| { - if bytes.len() != expected_size { - return Err(self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "bls12-381 quadradic extension field element (Fp2): invalid input length to deserialize", - &[ - Val::from_u32(bytes.len() as u32).into(), - Val::from_u32(expected_size as u32).into(), - ], - )); - } - // `CanonicalDeserialize for QuadExtField

` reads the first chunk, - // deserialize it into `Fp` as c0. Then repeat for c1. The - // deserialization for `Fp` follows same rules as above, where the - // bytes are expected in little-endian, with the highest bits being - // empty flags. There is no check involved. - // - // This is entirely reversed from the [standard](https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) - // we have adopted. This is the input format we provide: - // - // `input = be_bytes(c1) || be_bytes(c0)` - // - // So we just need to reverse our input. - self.charge_budget(ContractCostType::MemCpy, Some(FP2_SERIALIZED_SIZE as u64))?; - let mut buf = [0u8; FP2_SERIALIZED_SIZE]; - buf.copy_from_slice(&bytes); - buf.reverse(); - self.deserialize_uncompessed_no_validate(&buf, 2, "Fp2") - }) + // `CanonicalDeserialize for QuadExtField

` reads the first chunk, + // deserialize it into `Fp` as c0. Then repeat for c1. The + // deserialization for `Fp` follows same rules as above, where the + // bytes are expected in little-endian, with the highest bits being + // empty flags. There is no check involved. + // + // This is entirely reversed from the [standard](https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) + // we have adopted. This is the input format we provide: + // + // `input = be_bytes(c1) || be_bytes(c0)` + // + // So we just need to reverse our input. + self.field_element_deserialize::(bo, "Fp2") } pub(crate) fn g1_vec_from_vecobj(&self, vp: VecObject) -> Result, HostError> { @@ -527,7 +553,11 @@ impl Host { Ok(G2Projective::msm_unchecked(points, scalars)) } - pub(crate) fn map_to_curve(&self, fp: as AffineRepr>::BaseField, ty: ContractCostType) -> Result, HostError> { + pub(crate) fn map_to_curve( + &self, + fp: as AffineRepr>::BaseField, + ty: ContractCostType, + ) -> Result, HostError> { self.charge_budget(ty, None)?; // The `WBMap::new()` first calls @@ -583,7 +613,7 @@ impl Host { &self, domain: &[u8], msg: &[u8], - ty: &ContractCostType + ty: &ContractCostType, ) -> Result, HostError> { self.charge_budget(*ty, Some(msg.len() as u64))?; @@ -593,19 +623,18 @@ impl Host { // - Construction of WBMap follows the exact same analysis as map_to_curve // function earlier. // This function cannot realistically produce an error or panic. - let mapper = MapToCurveBasedHasher::< - Projective

, - DefaultFieldHasher, - WBMap

, - >::new(domain) - .map_err(|e| { - self.err( - ScErrorType::Crypto, - ScErrorCode::InternalError, - format!("hash-to-curve error {e}").as_str(), - &[], + let mapper = + MapToCurveBasedHasher::, DefaultFieldHasher, WBMap

>::new( + domain, ) - })?; + .map_err(|e| { + self.err( + ScErrorType::Crypto, + ScErrorCode::InternalError, + format!("hash-to-curve error {e}").as_str(), + &[], + ) + })?; // `ark_ec::hashing::map_to_curve_hasher::MapToCurveBasedHasher::hash` // contains the following calls diff --git a/soroban-env-host/src/host.rs b/soroban-env-host/src/host.rs index a7be6f999..8cf050b97 100644 --- a/soroban-env-host/src/host.rs +++ b/soroban-env-host/src/host.rs @@ -2979,7 +2979,7 @@ impl VmCallerEnv for Host { ) -> Result { let fp = self.fp_deserialize_from_bytesobj(fp)?; let g1 = self.map_to_curve(fp, ContractCostType::Bls12381MapFpToG1)?; - self.g1_affine_serialize_uncompressed(g1) + self.g1_affine_serialize_uncompressed(&g1) } fn bls12_381_hash_to_g1( @@ -3002,10 +3002,14 @@ impl VmCallerEnv for Host { &[], )); } - self.hash_to_curve(dst.as_slice(), msg.as_slice(), &ContractCostType::Bls12381HashToG1) + self.hash_to_curve( + dst.as_slice(), + msg.as_slice(), + &ContractCostType::Bls12381HashToG1, + ) }) })?; - self.g1_affine_serialize_uncompressed(g1) + self.g1_affine_serialize_uncompressed(&g1) } fn bls12_381_check_g2_is_in_subgroup( @@ -3094,10 +3098,14 @@ impl VmCallerEnv for Host { &[], )); } - self.hash_to_curve(dst.as_slice(), msg.as_slice(), &ContractCostType::Bls12381HashToG2) + self.hash_to_curve( + dst.as_slice(), + msg.as_slice(), + &ContractCostType::Bls12381HashToG2, + ) }) })?; - self.g2_affine_serialize_uncompressed(g2) + self.g2_affine_serialize_uncompressed(&g2) } fn bls12_381_multi_pairing_check( diff --git a/soroban-env-host/src/test/bls12_381.rs b/soroban-env-host/src/test/bls12_381.rs index 51d7a8007..2666e3eaf 100644 --- a/soroban-env-host/src/test/bls12_381.rs +++ b/soroban-env-host/src/test/bls12_381.rs @@ -5,7 +5,7 @@ use crate::{ xdr::{ScErrorCode, ScErrorType}, BytesObject, Env, EnvBase, Host, HostError, U256Val, U32Val, Val, VecObject, }; -use ark_bls12_381::{Fq, Fq2, G1Affine, G2Affine}; +use ark_bls12_381::{Fq, Fq2, Fr, G1Affine, G2Affine, FQ_ONE, FQ_ZERO}; use ark_ec::AffineRepr; use ark_ff::UniformRand; use ark_serialize::CanonicalSerialize; @@ -14,6 +14,22 @@ use rand::{rngs::StdRng, SeedableRng}; use serde::Deserialize; use std::cmp::Ordering; +impl Host { + pub(crate) fn fp_serialize_into_bytesobj(&self, fp: &Fq) -> Result { + let mut buf = [0u8; FP_SERIALIZED_SIZE]; + self.serialize_uncompressed_into_slice::(&fp, &mut buf, "Fp")?; + buf.reverse(); + self.add_host_object(self.scbytes_from_slice(&buf)?) + } + + pub(crate) fn fp2_serialize_into_bytesobj(&self, fp2: &Fq2) -> Result { + let mut buf = [0u8; FP2_SERIALIZED_SIZE]; + self.serialize_uncompressed_into_slice::(&fp2, &mut buf, "Fp")?; + buf.reverse(); + self.add_host_object(self.scbytes_from_slice(&buf)?) + } +} + enum InvalidPointTypes { TooManyBytes, TooFewBytes, @@ -75,7 +91,7 @@ fn parse_hex(s: &str) -> Vec { } fn sample_g1(host: &Host, rng: &mut StdRng) -> Result { - host.g1_affine_serialize_uncompressed(G1Affine::rand(rng)) + host.g1_affine_serialize_uncompressed(&G1Affine::rand(rng)) } fn sample_g1_not_on_curve(host: &Host, rng: &mut StdRng) -> Result { @@ -84,7 +100,7 @@ fn sample_g1_not_on_curve(host: &Host, rng: &mut StdRng) -> Result Result Result { - host.g1_affine_serialize_uncompressed(G1Affine::zero()) + host.g1_affine_serialize_uncompressed(&G1Affine::zero()) } fn neg_g1(bo: BytesObject, host: &Host) -> Result { let g1 = host.g1_affine_deserialize_from_bytesobj(bo, true)?; - host.g1_affine_serialize_uncompressed(-g1) + host.g1_affine_serialize_uncompressed(&-g1) } fn invalid_g1( @@ -117,7 +133,7 @@ fn invalid_g1( ) -> Result { let affine = G1Affine::rand(rng); assert!(!affine.is_zero()); - let bo = host.g1_affine_serialize_uncompressed(affine)?; + let bo = host.g1_affine_serialize_uncompressed(&affine)?; match ty { InvalidPointTypes::TooManyBytes => { // insert an empty byte to the end @@ -148,7 +164,7 @@ fn invalid_g1( } fn sample_g2(host: &Host, rng: &mut StdRng) -> Result { - host.g2_affine_serialize_uncompressed(G2Affine::rand(rng)) + host.g2_affine_serialize_uncompressed(&G2Affine::rand(rng)) } fn sample_g2_not_on_curve(host: &Host, rng: &mut StdRng) -> Result { @@ -157,7 +173,7 @@ fn sample_g2_not_on_curve(host: &Host, rng: &mut StdRng) -> Result Result Result { - host.g2_affine_serialize_uncompressed(G2Affine::zero()) + host.g2_affine_serialize_uncompressed(&G2Affine::zero()) } fn neg_g2(bo: BytesObject, host: &Host) -> Result { let g2 = host.g2_affine_deserialize_from_bytesobj(bo, true)?; - host.g2_affine_serialize_uncompressed(-g2) + host.g2_affine_serialize_uncompressed(&-g2) } fn invalid_g2( @@ -190,7 +206,7 @@ fn invalid_g2( ) -> Result { let affine = G2Affine::rand(rng); assert!(!affine.is_zero()); - let bo = host.g2_affine_serialize_uncompressed(affine)?; + let bo = host.g2_affine_serialize_uncompressed(&affine)?; match ty { InvalidPointTypes::TooManyBytes => { // insert an empty byte to the end @@ -238,9 +254,7 @@ fn parse_g2_point_test_case(host: &Host, p: Point) -> Result Result { let fp = Fq::rand(rng); - let mut buf = [0u8; FP_SERIALIZED_SIZE]; - host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; - host.bytes_new_from_slice(&buf) + host.fp_serialize_into_bytesobj(&fp) } fn invalid_fp( @@ -252,12 +266,12 @@ fn invalid_fp( match ty { InvalidPointTypes::TooManyBytes => { let mut buf = [0u8; FP_SERIALIZED_SIZE + 1]; // one extra zero byte - host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; + host.serialize_uncompressed_into_slice::<49, _>(&fp, &mut buf, "test")?; host.bytes_new_from_slice(&buf) } InvalidPointTypes::TooFewBytes => { let mut buf = [0u8; FP_SERIALIZED_SIZE]; - host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; + host.serialize_uncompressed_into_slice::(&fp, &mut buf, "test")?; host.bytes_new_from_slice(&buf[0..FP_SERIALIZED_SIZE - 1]) // take one less byte } _ => panic!("not available"), @@ -266,10 +280,8 @@ fn invalid_fp( #[allow(unused)] fn sample_fp2(host: &Host, rng: &mut StdRng) -> Result { - let fp = Fq2::rand(rng); - let mut buf = [0u8; FP2_SERIALIZED_SIZE]; - host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; - host.bytes_new_from_slice(&buf) + let fp2 = Fq2::rand(rng); + host.fp2_serialize_into_bytesobj(&fp2) } fn invalid_fp2( @@ -281,12 +293,14 @@ fn invalid_fp2( match ty { InvalidPointTypes::TooManyBytes => { let mut buf = [0u8; FP2_SERIALIZED_SIZE + 1]; // one extra zero byte - host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; + host.serialize_uncompressed_into_slice::<97, _>(&fp, &mut buf, "test")?; host.bytes_new_from_slice(&buf) } InvalidPointTypes::TooFewBytes => { let mut buf = [0u8; FP2_SERIALIZED_SIZE]; - host.serialize_uncompressed_into_slice(&fp, &mut buf, 1, "test")?; + host.serialize_uncompressed_into_slice::( + &fp, &mut buf, "test", + )?; host.bytes_new_from_slice(&buf[0..FP2_SERIALIZED_SIZE - 1]) // take one less byte } _ => panic!("not available"), @@ -303,9 +317,8 @@ fn sample_fr(host: &Host, rng: &mut StdRng) -> Result { Ok(obj.into()) } -fn sample_host_vec( +fn sample_host_vec( host: &Host, - buf_size: usize, vec_len: usize, rng: &mut StdRng, ) -> Result { @@ -313,8 +326,8 @@ fn sample_host_vec( .into_iter() .map(|_| { let t = T::rand(rng); - let mut buf = vec![0; buf_size]; - host.serialize_uncompressed_into_slice(&t, &mut buf, 1, "test") + let mut buf = vec![0; EXPECTED_SIZE]; + host.serialize_uncompressed_into_slice::(&t, &mut buf, "test") .unwrap(); host.bytes_new_from_slice(&buf).unwrap().to_val() }) @@ -672,7 +685,7 @@ fn g1_msm() -> Result<(), HostError> { } // vector lengths not equal { - let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 2, &mut rng)?; + let vp = sample_host_vec::(&host, 2, &mut rng)?; let vs = sample_fr_vec(&host, 3, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_g1_msm(vp, vs), @@ -704,7 +717,7 @@ fn g1_msm() -> Result<(), HostError> { } // vector of zero scalars result in zero point { - let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; + let vp = sample_host_vec::(&host, 3, &mut rng)?; let vs = host.vec_new_from_slice(&[U256Val::from_u32(0).to_val(); 3])?; let res = host.bls12_381_g1_msm(vp, vs)?; assert_eq!( @@ -772,7 +785,7 @@ fn g1_msm() -> Result<(), HostError> { // 8. msm result is same as invidial mul and add { host.budget_ref().reset_default()?; - let vp = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 10, &mut rng)?; + let vp = sample_host_vec::(&host, 10, &mut rng)?; let vs = sample_fr_vec(&host, 10, &mut rng)?; let ref_res = host.bls12_381_g1_msm(vp, vs)?; let mut res = g1_zero(&host)?; @@ -1211,7 +1224,7 @@ fn g2_msm() -> Result<(), HostError> { } // vector lengths not equal { - let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2, &mut rng)?; + let vp = sample_host_vec::(&host, 2, &mut rng)?; let vs = sample_fr_vec(&host, 3, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_g2_msm(vp, vs), @@ -1243,7 +1256,7 @@ fn g2_msm() -> Result<(), HostError> { } // vector of zero scalars result in zero point { - let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3, &mut rng)?; + let vp = sample_host_vec::(&host, 3, &mut rng)?; let vs = host.vec_new_from_slice(&[U256Val::from_u32(0).to_val(); 3])?; let res = host.bls12_381_g2_msm(vp, vs)?; assert_eq!( @@ -1311,7 +1324,7 @@ fn g2_msm() -> Result<(), HostError> { // 8. msm result is same as invidial mul and add { host.budget_ref().reset_default()?; - let vp = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 5, &mut rng)?; + let vp = sample_host_vec::(&host, 5, &mut rng)?; let vs = sample_fr_vec(&host, 5, &mut rng)?; let ref_res = host.bls12_381_g2_msm(vp, vs)?; let mut res = g2_zero(&host)?; @@ -1432,8 +1445,8 @@ fn pairing() -> Result<(), HostError> { host.enable_debug()?; // 1. vector lengths don't match { - let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; - let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2, &mut rng)?; + let vp1 = sample_host_vec::(&host, 3, &mut rng)?; + let vp2 = sample_host_vec::(&host, 2, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_multi_pairing_check(vp1, vp2), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -1441,8 +1454,8 @@ fn pairing() -> Result<(), HostError> { } // 2. vector length is 0 { - let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 0, &mut rng)?; - let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 0, &mut rng)?; + let vp1 = sample_host_vec::(&host, 0, &mut rng)?; + let vp2 = sample_host_vec::(&host, 0, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_multi_pairing_check(vp1, vp2), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -1450,13 +1463,13 @@ fn pairing() -> Result<(), HostError> { } // 3. any g1 is invalid { - let mut vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; + let mut vp1 = sample_host_vec::(&host, 3, &mut rng)?; vp1 = host.vec_put( vp1, U32Val::from(1), sample_g1_not_in_subgroup(&host, &mut rng)?.to_val(), )?; - let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 2, &mut rng)?; + let vp2 = sample_host_vec::(&host, 2, &mut rng)?; assert!(HostError::result_matches_err( host.bls12_381_multi_pairing_check(vp1, vp2), (ScErrorType::Crypto, ScErrorCode::InvalidInput) @@ -1464,8 +1477,8 @@ fn pairing() -> Result<(), HostError> { } // 4. any g2 is invalid { - let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; - let mut vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3, &mut rng)?; + let vp1 = sample_host_vec::(&host, 3, &mut rng)?; + let mut vp2 = sample_host_vec::(&host, 3, &mut rng)?; vp2 = host.vec_put( vp2, U32Val::from(1), @@ -1533,16 +1546,16 @@ fn pairing() -> Result<(), HostError> { // 8. any of g1 point is infinity { host.budget_ref().reset_default()?; - let mut vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; + let mut vp1 = sample_host_vec::(&host, 3, &mut rng)?; vp1 = host.vec_put(vp1, U32Val::from(1), g1_zero(&host)?.to_val())?; - let vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3, &mut rng)?; + let vp2 = sample_host_vec::(&host, 3, &mut rng)?; assert!(host.bls12_381_multi_pairing_check(vp1, vp2).is_ok()); } // 9. any of g2 point is infinity { host.budget_ref().reset_default()?; - let vp1 = sample_host_vec::(&host, G1_SERIALIZED_SIZE, 3, &mut rng)?; - let mut vp2 = sample_host_vec::(&host, G2_SERIALIZED_SIZE, 3, &mut rng)?; + let vp1 = sample_host_vec::(&host, 3, &mut rng)?; + let mut vp2 = sample_host_vec::(&host, 3, &mut rng)?; vp2 = host.vec_put(vp2, U32Val::from(2), g2_zero(&host)?.to_val())?; assert!(host.bls12_381_multi_pairing_check(vp1, vp2).is_ok()); } @@ -1556,10 +1569,130 @@ fn pairing() -> Result<(), HostError> { Ok(()) } -// ethereum test - // fr arithmetics // serialization roundtrip - -// fuzzing tests +#[test] +fn test_serialization_roundtrip() -> Result<(), HostError> { + let mut rng = StdRng::from_seed([0xff; 32]); + let host = observe_host!(Host::test_host()); + host.enable_debug()?; + // g1 + { + let g1_roundtrip_check = |g1: &G1Affine, subgroup_check: bool| -> Result { + let bo = host.g1_affine_serialize_uncompressed(&g1)?; + let g1_back = host.g1_affine_deserialize_from_bytesobj(bo, subgroup_check)?; + Ok(g1.eq(&g1_back)) + }; + assert!(g1_roundtrip_check(&G1Affine::zero(), true)?); + assert!(g1_roundtrip_check(&G1Affine::generator(), true)?); + for _ in 0..20 { + // on curve and in subgroup + let g1 = G1Affine::rand(&mut rng); + assert!(g1_roundtrip_check(&g1, true)?) + } + for i in 0..10 { + // on curve and not in subgroup + let g1 = G1Affine::get_point_from_x_unchecked(Fq::rand(&mut rng), (i % 2) != 0) + .unwrap_or(G1Affine::zero()); + assert!(g1_roundtrip_check(&g1, false)?); + if !g1.is_in_correct_subgroup_assuming_on_curve() { + assert!(HostError::result_matches_err( + g1_roundtrip_check(&g1, true), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + } + for _ in 0..10 { + // not on curve + let g1 = G1Affine::new_unchecked(Fq::rand(&mut rng), Fq::rand(&mut rng)); + if g1.is_on_curve() { + continue; + } + assert!(HostError::result_matches_err( + g1_roundtrip_check(&g1, false), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + } + // g2 + { + let g2_roundtrip_check = |g2: &G2Affine, subgroup_check: bool| -> Result { + let bo = host.g2_affine_serialize_uncompressed(&g2)?; + let g2_back = host.g2_affine_deserialize_from_bytesobj(bo, subgroup_check)?; + Ok(g2.eq(&g2_back)) + }; + assert!(g2_roundtrip_check(&G2Affine::zero(), true)?); + assert!(g2_roundtrip_check(&G2Affine::generator(), true)?); + for _ in 0..20 { + // on curve and in subgroup + let g2 = G2Affine::rand(&mut rng); + assert!(g2_roundtrip_check(&g2, true)?) + } + for i in 0..10 { + // on curve and not in subgroup + let g2 = G2Affine::get_point_from_x_unchecked(Fq2::rand(&mut rng), (i % 2) != 0) + .unwrap_or(G2Affine::zero()); + assert!(g2_roundtrip_check(&g2, false)?); + if !g2.is_in_correct_subgroup_assuming_on_curve() { + assert!(HostError::result_matches_err( + g2_roundtrip_check(&g2, true), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + } + for _ in 0..10 { + // not on curve + let g2 = G2Affine::new_unchecked(Fq2::rand(&mut rng), Fq2::rand(&mut rng)); + if g2.is_on_curve() { + continue; + } + assert!(HostError::result_matches_err( + g2_roundtrip_check(&g2, false), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); + } + } + // fp + { + let fp_roundtrip_check = |fp: &Fq| -> Result { + let mut buf = [0; FP_SERIALIZED_SIZE]; + host.serialize_uncompressed_into_slice::(fp, &mut buf, "Fp")?; + buf.reverse(); + let bo = host.add_host_object(host.scbytes_from_slice(&buf)?)?; + let fp_back = host.fp_deserialize_from_bytesobj(bo)?; + Ok(fp.eq(&fp_back)) + }; + assert!(fp_roundtrip_check(&FQ_ZERO)?); + assert!(fp_roundtrip_check(&FQ_ONE)?); + for _ in 0..20 { + assert!(fp_roundtrip_check(&Fq::rand(&mut rng))?) + } + } + // fp2 + { + let fp2_roundtrip_check = |fp2: &Fq2| -> Result { + let mut buf = [0; FP2_SERIALIZED_SIZE]; + host.serialize_uncompressed_into_slice::(fp2, &mut buf, "Fp2")?; + buf.reverse(); + let bo = host.add_host_object(host.scbytes_from_slice(&buf)?)?; + let fp2_back = host.fp2_deserialize_from_bytesobj(bo)?; + Ok(fp2.eq(&fp2_back)) + }; + for _ in 0..20 { + assert!(fp2_roundtrip_check(&Fq2::rand(&mut rng))?) + } + } + // fr + { + let fr_roundtrip_check = |fr: Fr| -> Result { + let uv = host.fr_to_u256val(fr.clone())?; + let fr_back = host.fr_from_u256val(uv)?; + Ok(fr == fr_back) + }; + for _ in 0..20 { + assert!(fr_roundtrip_check(Fr::rand(&mut rng))?) + } + } + Ok(()) +} From 3f0018383615fd423255959b315b4eb3abacc068 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Mon, 16 Sep 2024 19:46:01 -0400 Subject: [PATCH 12/18] improve formating --- soroban-env-host/src/host.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/soroban-env-host/src/host.rs b/soroban-env-host/src/host.rs index 8cf050b97..e508c4ca0 100644 --- a/soroban-env-host/src/host.rs +++ b/soroban-env-host/src/host.rs @@ -3114,14 +3114,14 @@ impl VmCallerEnv for Host { vp1: VecObject, vp2: VecObject, ) -> Result { - let l1 = self.vec_len(vmcaller, vp1)?; - let l2 = self.vec_len(vmcaller, vp2)?; - if u32::from(l1) != u32::from(l2) || u32::from(l1) == 0 { + let l1: u32 = self.vec_len(vmcaller, vp1)?.into(); + let l2: u32 = self.vec_len(vmcaller, vp2)?.into(); + if l1 != l2 || l1 == 0 { return Err(self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, - "multi-pairing-check: invalid input vector lengths", - &[l1.to_val(), l2.to_val()], + format!("multi-pairing-check: invalid input vector lengths {l1} and {l2}").as_str(), + &[], )); } let vp1 = self.g1_vec_from_vecobj(vp1)?; From ad0b7b3a9896cfeeeeee7bc3a8d5d26829a0497d Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Tue, 17 Sep 2024 14:32:43 -0400 Subject: [PATCH 13/18] Add test for Fp out-of-range --- ...t__bls12_381__check_g1_is_in_subgroup.json | 90 +++++----- ...t__bls12_381__check_g2_is_in_subgroup.json | 90 +++++----- .../22/test__bls12_381__map_fp2_to_g2.json | 166 +++++++++--------- .../22/test__bls12_381__map_fp_to_g1.json | 166 +++++++++--------- soroban-env-host/src/crypto/bls12_381.rs | 8 +- soroban-env-host/src/test/bls12_381.rs | 51 ++++++ 6 files changed, 319 insertions(+), 252 deletions(-) diff --git a/soroban-env-host/observations/22/test__bls12_381__check_g1_is_in_subgroup.json b/soroban-env-host/observations/22/test__bls12_381__check_g1_is_in_subgroup.json index 6010b2502..1dd32fe3c 100644 --- a/soroban-env-host/observations/22/test__bls12_381__check_g1_is_in_subgroup.json +++ b/soroban-env-host/observations/22/test__bls12_381__check_g1_is_in_subgroup.json @@ -28,47 +28,51 @@ " 26 ret bls12_381_check_g1_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:18393", " 27 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#23))": "cpu:23007, mem:2113, objs:-/12@85f05c1a", " 28 ret bls12_381_check_g1_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:27033", - " 29 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#25))": "cpu:29340, mem:2289, objs:-/13@5aa03fef", - " 30 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:763876", - " 31 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#27))": "cpu:766183, mem:2465, objs:-/14@38656519", - " 32 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:1500719", - " 33 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#29))": "cpu:1503026, mem:2641, objs:-/15@c4a5e239", - " 34 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:2237562", - " 35 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#31))": "cpu:2239869, mem:2817, objs:-/16@8ba02515", - " 36 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:2974405", - " 37 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#33))": "cpu:2976712, mem:2993, objs:-/17@c29b4e55", - " 38 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:3711248", - " 39 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#35))": "cpu:3713555, mem:3169, objs:-/18@1641d2ec", - " 40 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:4448091", - " 41 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#37))": "cpu:4450398, mem:3345, objs:-/19@cc8d23ee", - " 42 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:5184934", - " 43 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#39))": "cpu:5187241, mem:3521, objs:-/20@797d6389", - " 44 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:5921777", - " 45 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#41))": "cpu:5924084, mem:3697, objs:-/21@1c345573", - " 46 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:6658620", - " 47 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#43))": "cpu:6660927, mem:3873, objs:-/22@54d1ee5f", - " 48 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:7395463", - " 49 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#45))": "cpu:7397770, mem:4049, objs:-/23@44d12712", - " 50 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:8132306", - " 51 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#49))": "cpu:8136920, mem:4401, objs:-/25@eadeeca2", - " 52 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:8871456", - " 53 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#53))": "cpu:8876070, mem:4753, objs:-/27@710f61db", - " 54 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:9610606", - " 55 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#57))": "cpu:9615220, mem:5105, objs:-/29@7508f59d", - " 56 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:10349756", - " 57 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#61))": "cpu:10354370, mem:5457, objs:-/31@8f31f30b", - " 58 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:11088906", - " 59 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#65))": "cpu:11093520, mem:5809, objs:-/33@c198683c", - " 60 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:11828056", - " 61 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#69))": "cpu:11832670, mem:6161, objs:-/35@324358fe", - " 62 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:12567206", - " 63 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#73))": "cpu:12571820, mem:6513, objs:-/37@c149e38f", - " 64 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:13306356", - " 65 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#77))": "cpu:13310970, mem:6865, objs:-/39@45c38f7f", - " 66 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:14045506", - " 67 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#81))": "cpu:14050120, mem:7217, objs:-/41@1aa8b119", - " 68 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:14784656", - " 69 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#85))": "cpu:14789270, mem:7569, objs:-/43@cb657d13", - " 70 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:15523806", - " 71 end": "cpu:15523806, mem:7569, prngs:-/-, objs:-/43@cb657d13, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 29 call bytes_copy_from_slice(Bytes(obj#27), U32(0), 98)": "cpu:31647, mem:2465, objs:-/14@38656519", + " 30 ret bytes_copy_from_slice -> Ok(Bytes(obj#29))": "cpu:33181, mem:2659, objs:-/15@a4950fe8", + " 31 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#29))": "", + " 32 ret bls12_381_check_g1_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:33303", + " 33 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#31))": "cpu:35610, mem:2835, objs:-/16@500e79a7", + " 34 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:770146", + " 35 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#33))": "cpu:772453, mem:3011, objs:-/17@8f4ffce", + " 36 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:1506989", + " 37 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#35))": "cpu:1509296, mem:3187, objs:-/18@2f9e8c61", + " 38 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:2243832", + " 39 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#37))": "cpu:2246139, mem:3363, objs:-/19@69985e40", + " 40 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:2980675", + " 41 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#39))": "cpu:2982982, mem:3539, objs:-/20@d096ebd0", + " 42 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:3717518", + " 43 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#41))": "cpu:3719825, mem:3715, objs:-/21@68ab7bd3", + " 44 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:4454361", + " 45 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#43))": "cpu:4456668, mem:3891, objs:-/22@7e3dc994", + " 46 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:5191204", + " 47 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#45))": "cpu:5193511, mem:4067, objs:-/23@a6f58142", + " 48 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:5928047", + " 49 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#47))": "cpu:5930354, mem:4243, objs:-/24@25b1a124", + " 50 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:6664890", + " 51 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#49))": "cpu:6667197, mem:4419, objs:-/25@ad6b88e5", + " 52 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:7401733", + " 53 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#51))": "cpu:7404040, mem:4595, objs:-/26@bde93363", + " 54 ret bls12_381_check_g1_is_in_subgroup -> Ok(True)": "cpu:8138576", + " 55 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#55))": "cpu:8143190, mem:4947, objs:-/28@200189b4", + " 56 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:8877726", + " 57 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#59))": "cpu:8882340, mem:5299, objs:-/30@9133038c", + " 58 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:9616876", + " 59 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#63))": "cpu:9621490, mem:5651, objs:-/32@db0fc406", + " 60 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:10356026", + " 61 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#67))": "cpu:10360640, mem:6003, objs:-/34@352a99fb", + " 62 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:11095176", + " 63 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#71))": "cpu:11099790, mem:6355, objs:-/36@fc80803a", + " 64 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:11834326", + " 65 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#75))": "cpu:11838940, mem:6707, objs:-/38@6e4b656f", + " 66 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:12573476", + " 67 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#79))": "cpu:12578090, mem:7059, objs:-/40@874192c8", + " 68 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:13312626", + " 69 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#83))": "cpu:13317240, mem:7411, objs:-/42@c24e82e7", + " 70 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:14051776", + " 71 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#87))": "cpu:14056390, mem:7763, objs:-/44@bf8f3db5", + " 72 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:14790926", + " 73 call bls12_381_check_g1_is_in_subgroup(Bytes(obj#91))": "cpu:14795540, mem:8115, objs:-/46@4de2e45d", + " 74 ret bls12_381_check_g1_is_in_subgroup -> Ok(False)": "cpu:15530076", + " 75 end": "cpu:15530076, mem:8115, prngs:-/-, objs:-/46@4de2e45d, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__check_g2_is_in_subgroup.json b/soroban-env-host/observations/22/test__bls12_381__check_g2_is_in_subgroup.json index c3d937a23..4b68ffe31 100644 --- a/soroban-env-host/observations/22/test__bls12_381__check_g2_is_in_subgroup.json +++ b/soroban-env-host/observations/22/test__bls12_381__check_g2_is_in_subgroup.json @@ -28,47 +28,51 @@ " 26 ret bls12_381_check_g2_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:25243", " 27 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#23))": "cpu:32549, mem:3265, objs:-/12@345f9e87", " 28 ret bls12_381_check_g2_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:42532", - " 29 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#25))": "cpu:46185, mem:3537, objs:-/13@376ef5fd", - " 30 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:1113990", - " 31 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#27))": "cpu:1117643, mem:3809, objs:-/14@5bbf9054", - " 32 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:2185448", - " 33 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#29))": "cpu:2189101, mem:4081, objs:-/15@416695be", - " 34 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:3256906", - " 35 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#31))": "cpu:3260559, mem:4353, objs:-/16@8e09b5f", - " 36 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:4328364", - " 37 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#33))": "cpu:4332017, mem:4625, objs:-/17@f009aea2", - " 38 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:5399822", - " 39 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#35))": "cpu:5403475, mem:4897, objs:-/18@9ae14428", - " 40 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:6471280", - " 41 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#37))": "cpu:6474933, mem:5169, objs:-/19@bd9dfac1", - " 42 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:7542738", - " 43 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#39))": "cpu:7546391, mem:5441, objs:-/20@dcc1270c", - " 44 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:8614196", - " 45 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#41))": "cpu:8617849, mem:5713, objs:-/21@a6b0db9", - " 46 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:9685654", - " 47 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#43))": "cpu:9689307, mem:5985, objs:-/22@4a3f6fb7", - " 48 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:10757112", - " 49 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#45))": "cpu:10760765, mem:6257, objs:-/23@d4c84a78", - " 50 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:11828570", - " 51 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#49))": "cpu:11835876, mem:6801, objs:-/25@430fa4aa", - " 52 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:12903681", - " 53 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#53))": "cpu:12910987, mem:7345, objs:-/27@9e31a04c", - " 54 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:13978792", - " 55 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#57))": "cpu:13986098, mem:7889, objs:-/29@6047ea8d", - " 56 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:15053903", - " 57 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#61))": "cpu:15061209, mem:8433, objs:-/31@3deb0a32", - " 58 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:16129014", - " 59 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#65))": "cpu:16136320, mem:8977, objs:-/33@6c658f19", - " 60 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:17204125", - " 61 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#69))": "cpu:17211431, mem:9521, objs:-/35@1eca5ef7", - " 62 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:18279236", - " 63 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#73))": "cpu:18286542, mem:10065, objs:-/37@65689e4f", - " 64 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:19354347", - " 65 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#77))": "cpu:19361653, mem:10609, objs:-/39@a28f171b", - " 66 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:20429458", - " 67 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#81))": "cpu:20436764, mem:11153, objs:-/41@25bfb586", - " 68 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:21504569", - " 69 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#85))": "cpu:21511875, mem:11697, objs:-/43@268e18bf", - " 70 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:22579680", - " 71 end": "cpu:22579680, mem:11697, prngs:-/-, objs:-/43@268e18bf, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 29 call bytes_copy_from_slice(Bytes(obj#27), U32(0), 98)": "cpu:49838, mem:3809, objs:-/14@5bbf9054", + " 30 ret bytes_copy_from_slice -> Ok(Bytes(obj#29))": "cpu:50962, mem:4081, objs:-/15@59d72b9d", + " 31 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#29))": "", + " 32 ret bls12_381_check_g2_is_in_subgroup -> Err(Error(Crypto, InvalidInput))": "cpu:51084", + " 33 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#31))": "cpu:54737, mem:4353, objs:-/16@383aa473", + " 34 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:1122542", + " 35 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#33))": "cpu:1126195, mem:4625, objs:-/17@10e08142", + " 36 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:2194000", + " 37 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#35))": "cpu:2197653, mem:4897, objs:-/18@257c5aed", + " 38 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:3265458", + " 39 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#37))": "cpu:3269111, mem:5169, objs:-/19@bd25c348", + " 40 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:4336916", + " 41 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#39))": "cpu:4340569, mem:5441, objs:-/20@aac1ed33", + " 42 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:5408374", + " 43 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#41))": "cpu:5412027, mem:5713, objs:-/21@485881be", + " 44 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:6479832", + " 45 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#43))": "cpu:6483485, mem:5985, objs:-/22@f6c251d8", + " 46 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:7551290", + " 47 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#45))": "cpu:7554943, mem:6257, objs:-/23@28f2277a", + " 48 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:8622748", + " 49 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#47))": "cpu:8626401, mem:6529, objs:-/24@b60b70c0", + " 50 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:9694206", + " 51 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#49))": "cpu:9697859, mem:6801, objs:-/25@b1831620", + " 52 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:10765664", + " 53 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#51))": "cpu:10769317, mem:7073, objs:-/26@12a73c61", + " 54 ret bls12_381_check_g2_is_in_subgroup -> Ok(True)": "cpu:11837122", + " 55 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#55))": "cpu:11844428, mem:7617, objs:-/28@b222759", + " 56 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:12912233", + " 57 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#59))": "cpu:12919539, mem:8161, objs:-/30@d53d3525", + " 58 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:13987344", + " 59 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#63))": "cpu:13994650, mem:8705, objs:-/32@f338c504", + " 60 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:15062455", + " 61 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#67))": "cpu:15069761, mem:9249, objs:-/34@355470cc", + " 62 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:16137566", + " 63 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#71))": "cpu:16144872, mem:9793, objs:-/36@c13ff257", + " 64 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:17212677", + " 65 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#75))": "cpu:17219983, mem:10337, objs:-/38@89aa31a3", + " 66 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:18287788", + " 67 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#79))": "cpu:18295094, mem:10881, objs:-/40@6af1f9a8", + " 68 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:19362899", + " 69 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#83))": "cpu:19370205, mem:11425, objs:-/42@563d3e28", + " 70 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:20438010", + " 71 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#87))": "cpu:20445316, mem:11969, objs:-/44@3997f663", + " 72 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:21513121", + " 73 call bls12_381_check_g2_is_in_subgroup(Bytes(obj#91))": "cpu:21520427, mem:12513, objs:-/46@ca7e6ad6", + " 74 ret bls12_381_check_g2_is_in_subgroup -> Ok(False)": "cpu:22588232", + " 75 end": "cpu:22588232, mem:12513, prngs:-/-, objs:-/46@ca7e6ad6, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json b/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json index 858be58a0..36bf7e5b6 100644 --- a/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json +++ b/soroban-env-host/observations/22/test__bls12_381__map_fp2_to_g2.json @@ -8,85 +8,89 @@ " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:5395, mem:352, objs:-/2@b8cae411", " 7 call bls12_381_map_fp2_to_g2(Bytes(obj#3))": "", " 8 ret bls12_381_map_fp2_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:5517", - " 9 call bytes_new_from_slice(192)": "cpu:0, mem:0", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:1009, mem:272, objs:-/3@84cbabcf", - " 11 call bytes_new_from_slice(96)": "", - " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:1994, mem:448, objs:-/4@de01dc4a", - " 13 call bls12_381_map_fp2_to_g2(Bytes(obj#7))": "", - " 14 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#9))": "cpu:2428056, mem:4064, objs:-/5@c92c817b", - " 15 call obj_cmp(Bytes(obj#9), Bytes(obj#5))": "", - " 16 ret obj_cmp -> Ok(0)": "cpu:2428368", - " 17 call bytes_new_from_slice(192)": "", - " 18 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:2429377, mem:4336, objs:-/6@aab5467f", - " 19 call bytes_new_from_slice(96)": "", - " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#13))": "cpu:2430362, mem:4512, objs:-/7@45b33a3f", - " 21 call bls12_381_map_fp2_to_g2(Bytes(obj#13))": "", - " 22 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#15))": "cpu:4856424, mem:8128, objs:-/8@dc781659", - " 23 call obj_cmp(Bytes(obj#15), Bytes(obj#11))": "", - " 24 ret obj_cmp -> Ok(0)": "cpu:4856736", - " 25 call bytes_new_from_slice(192)": "", - " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:4857745, mem:8400, objs:-/9@4596be6d", - " 27 call bytes_new_from_slice(96)": "", - " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:4858730, mem:8576, objs:-/10@465cd103", - " 29 call bls12_381_map_fp2_to_g2(Bytes(obj#19))": "", - " 30 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#21))": "cpu:7284792, mem:12192, objs:-/11@3f31c853", - " 31 call obj_cmp(Bytes(obj#21), Bytes(obj#17))": "", - " 32 ret obj_cmp -> Ok(0)": "cpu:7285104", - " 33 call bytes_new_from_slice(192)": "", - " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:7286113, mem:12464, objs:-/12@9e7dcbde", - " 35 call bytes_new_from_slice(96)": "", - " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#25))": "cpu:7287098, mem:12640, objs:-/13@e33cf4c0", - " 37 call bls12_381_map_fp2_to_g2(Bytes(obj#25))": "", - " 38 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#27))": "cpu:9713160, mem:16256, objs:-/14@4d072f7e", - " 39 call obj_cmp(Bytes(obj#27), Bytes(obj#23))": "", - " 40 ret obj_cmp -> Ok(0)": "cpu:9713472", - " 41 call bytes_new_from_slice(192)": "", - " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:9714481, mem:16528, objs:-/15@b619650", - " 43 call bytes_new_from_slice(96)": "", - " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:9715466, mem:16704, objs:-/16@3251749c", - " 45 call bls12_381_map_fp2_to_g2(Bytes(obj#31))": "", - " 46 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#33))": "cpu:12141528, mem:20320, objs:-/17@4d90808a", - " 47 call obj_cmp(Bytes(obj#33), Bytes(obj#29))": "", - " 48 ret obj_cmp -> Ok(0)": "cpu:12141840", - " 49 call bytes_new_from_slice(192)": "", - " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:12142849, mem:20592, objs:-/18@a14b9884", - " 51 call bytes_new_from_slice(96)": "", - " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:12143834, mem:20768, objs:-/19@2081cb8", - " 53 call bls12_381_map_fp2_to_g2(Bytes(obj#37))": "", - " 54 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#39))": "cpu:14569896, mem:24384, objs:-/20@ded0041a", - " 55 call obj_cmp(Bytes(obj#39), Bytes(obj#35))": "", - " 56 ret obj_cmp -> Ok(0)": "cpu:14570208", - " 57 call bytes_new_from_slice(192)": "", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:14571217, mem:24656, objs:-/21@efcbe3c4", - " 59 call bytes_new_from_slice(96)": "", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#43))": "cpu:14572202, mem:24832, objs:-/22@a0f062d2", - " 61 call bls12_381_map_fp2_to_g2(Bytes(obj#43))": "", - " 62 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#45))": "cpu:16998264, mem:28448, objs:-/23@b60831ac", - " 63 call obj_cmp(Bytes(obj#45), Bytes(obj#41))": "", - " 64 ret obj_cmp -> Ok(0)": "cpu:16998576", - " 65 call bytes_new_from_slice(192)": "", - " 66 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:16999585, mem:28720, objs:-/24@1a0db4f9", - " 67 call bytes_new_from_slice(96)": "", - " 68 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:17000570, mem:28896, objs:-/25@23f3cdc6", - " 69 call bls12_381_map_fp2_to_g2(Bytes(obj#49))": "", - " 70 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#51))": "cpu:19426632, mem:32512, objs:-/26@1efe0c89", - " 71 call obj_cmp(Bytes(obj#51), Bytes(obj#47))": "", - " 72 ret obj_cmp -> Ok(0)": "cpu:19426944", - " 73 call bytes_new_from_slice(192)": "", - " 74 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:19427953, mem:32784, objs:-/27@29589445", - " 75 call bytes_new_from_slice(96)": "", - " 76 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:19428938, mem:32960, objs:-/28@3f0c9a15", - " 77 call bls12_381_map_fp2_to_g2(Bytes(obj#55))": "", - " 78 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#57))": "cpu:21855000, mem:36576, objs:-/29@51b6b995", - " 79 call obj_cmp(Bytes(obj#57), Bytes(obj#53))": "", - " 80 ret obj_cmp -> Ok(0)": "cpu:21855312", - " 81 call bytes_new_from_slice(192)": "", - " 82 ret bytes_new_from_slice -> Ok(Bytes(obj#59))": "cpu:21856321, mem:36848, objs:-/30@9e658476", - " 83 call bytes_new_from_slice(96)": "", - " 84 ret bytes_new_from_slice -> Ok(Bytes(obj#61))": "cpu:21857306, mem:37024, objs:-/31@5b51107", - " 85 call bls12_381_map_fp2_to_g2(Bytes(obj#61))": "", - " 86 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#63))": "cpu:24283368, mem:40640, objs:-/32@8da36b92", - " 87 call obj_cmp(Bytes(obj#63), Bytes(obj#59))": "", - " 88 ret obj_cmp -> Ok(0)": "cpu:24283680", - " 89 end": "cpu:24283680, mem:40640, prngs:-/-, objs:-/32@8da36b92, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 9 call bytes_new_from_slice(48)": "", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:6490, mem:480, objs:-/3@7baf5e49", + " 11 call bls12_381_map_fp2_to_g2(Bytes(obj#5))": "", + " 12 ret bls12_381_map_fp2_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:6612", + " 13 call bytes_new_from_slice(192)": "cpu:0, mem:0", + " 14 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:1009, mem:272, objs:-/4@b4677fca", + " 15 call bytes_new_from_slice(96)": "", + " 16 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:1994, mem:448, objs:-/5@51dc820f", + " 17 call bls12_381_map_fp2_to_g2(Bytes(obj#9))": "", + " 18 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#11))": "cpu:2428056, mem:4064, objs:-/6@79529ee5", + " 19 call obj_cmp(Bytes(obj#11), Bytes(obj#7))": "", + " 20 ret obj_cmp -> Ok(0)": "cpu:2428368", + " 21 call bytes_new_from_slice(192)": "", + " 22 ret bytes_new_from_slice -> Ok(Bytes(obj#13))": "cpu:2429377, mem:4336, objs:-/7@63a0b212", + " 23 call bytes_new_from_slice(96)": "", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:2430362, mem:4512, objs:-/8@cc13af37", + " 25 call bls12_381_map_fp2_to_g2(Bytes(obj#15))": "", + " 26 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#17))": "cpu:4856424, mem:8128, objs:-/9@5b6d0aa0", + " 27 call obj_cmp(Bytes(obj#17), Bytes(obj#13))": "", + " 28 ret obj_cmp -> Ok(0)": "cpu:4856736", + " 29 call bytes_new_from_slice(192)": "", + " 30 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:4857745, mem:8400, objs:-/10@82ed820f", + " 31 call bytes_new_from_slice(96)": "", + " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:4858730, mem:8576, objs:-/11@b92a252b", + " 33 call bls12_381_map_fp2_to_g2(Bytes(obj#21))": "", + " 34 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#23))": "cpu:7284792, mem:12192, objs:-/12@ece25005", + " 35 call obj_cmp(Bytes(obj#23), Bytes(obj#19))": "", + " 36 ret obj_cmp -> Ok(0)": "cpu:7285104", + " 37 call bytes_new_from_slice(192)": "", + " 38 ret bytes_new_from_slice -> Ok(Bytes(obj#25))": "cpu:7286113, mem:12464, objs:-/13@bc2389f1", + " 39 call bytes_new_from_slice(96)": "", + " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:7287098, mem:12640, objs:-/14@c5da4223", + " 41 call bls12_381_map_fp2_to_g2(Bytes(obj#27))": "", + " 42 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#29))": "cpu:9713160, mem:16256, objs:-/15@fd857683", + " 43 call obj_cmp(Bytes(obj#29), Bytes(obj#25))": "", + " 44 ret obj_cmp -> Ok(0)": "cpu:9713472", + " 45 call bytes_new_from_slice(192)": "", + " 46 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:9714481, mem:16528, objs:-/16@6fb0f894", + " 47 call bytes_new_from_slice(96)": "", + " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:9715466, mem:16704, objs:-/17@2a325ae4", + " 49 call bls12_381_map_fp2_to_g2(Bytes(obj#33))": "", + " 50 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#35))": "cpu:12141528, mem:20320, objs:-/18@7c6c7549", + " 51 call obj_cmp(Bytes(obj#35), Bytes(obj#31))": "", + " 52 ret obj_cmp -> Ok(0)": "cpu:12141840", + " 53 call bytes_new_from_slice(192)": "", + " 54 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:12142849, mem:20592, objs:-/19@1fce6840", + " 55 call bytes_new_from_slice(96)": "", + " 56 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:12143834, mem:20768, objs:-/20@be9137c1", + " 57 call bls12_381_map_fp2_to_g2(Bytes(obj#39))": "", + " 58 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#41))": "cpu:14569896, mem:24384, objs:-/21@9c7995a", + " 59 call obj_cmp(Bytes(obj#41), Bytes(obj#37))": "", + " 60 ret obj_cmp -> Ok(0)": "cpu:14570208", + " 61 call bytes_new_from_slice(192)": "", + " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#43))": "cpu:14571217, mem:24656, objs:-/22@78f3899d", + " 63 call bytes_new_from_slice(96)": "", + " 64 ret bytes_new_from_slice -> Ok(Bytes(obj#45))": "cpu:14572202, mem:24832, objs:-/23@e72573e0", + " 65 call bls12_381_map_fp2_to_g2(Bytes(obj#45))": "", + " 66 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#47))": "cpu:16998264, mem:28448, objs:-/24@f38a60c9", + " 67 call obj_cmp(Bytes(obj#47), Bytes(obj#43))": "", + " 68 ret obj_cmp -> Ok(0)": "cpu:16998576", + " 69 call bytes_new_from_slice(192)": "", + " 70 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:16999585, mem:28720, objs:-/25@14f7400d", + " 71 call bytes_new_from_slice(96)": "", + " 72 ret bytes_new_from_slice -> Ok(Bytes(obj#51))": "cpu:17000570, mem:28896, objs:-/26@2203764c", + " 73 call bls12_381_map_fp2_to_g2(Bytes(obj#51))": "", + " 74 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#53))": "cpu:19426632, mem:32512, objs:-/27@d5d727e5", + " 75 call obj_cmp(Bytes(obj#53), Bytes(obj#49))": "", + " 76 ret obj_cmp -> Ok(0)": "cpu:19426944", + " 77 call bytes_new_from_slice(192)": "", + " 78 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:19427953, mem:32784, objs:-/28@ef906b0", + " 79 call bytes_new_from_slice(96)": "", + " 80 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:19428938, mem:32960, objs:-/29@851a81a4", + " 81 call bls12_381_map_fp2_to_g2(Bytes(obj#57))": "", + " 82 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#59))": "cpu:21855000, mem:36576, objs:-/30@18e42593", + " 83 call obj_cmp(Bytes(obj#59), Bytes(obj#55))": "", + " 84 ret obj_cmp -> Ok(0)": "cpu:21855312", + " 85 call bytes_new_from_slice(192)": "", + " 86 ret bytes_new_from_slice -> Ok(Bytes(obj#61))": "cpu:21856321, mem:36848, objs:-/31@3b459b2e", + " 87 call bytes_new_from_slice(96)": "", + " 88 ret bytes_new_from_slice -> Ok(Bytes(obj#63))": "cpu:21857306, mem:37024, objs:-/32@9d03f4e3", + " 89 call bls12_381_map_fp2_to_g2(Bytes(obj#63))": "", + " 90 ret bls12_381_map_fp2_to_g2 -> Ok(Bytes(obj#65))": "cpu:24283368, mem:40640, objs:-/33@102db400", + " 91 call obj_cmp(Bytes(obj#65), Bytes(obj#61))": "", + " 92 ret obj_cmp -> Ok(0)": "cpu:24283680", + " 93 end": "cpu:24283680, mem:40640, prngs:-/-, objs:-/33@102db400, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json b/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json index 69440959a..5fd970a29 100644 --- a/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json +++ b/soroban-env-host/observations/22/test__bls12_381__map_fp_to_g1.json @@ -8,85 +8,89 @@ " 6 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:4049, mem:256, objs:-/2@7385e39e", " 7 call bls12_381_map_fp_to_g1(Bytes(obj#3))": "", " 8 ret bls12_381_map_fp_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:4171", - " 9 call bytes_new_from_slice(96)": "cpu:0, mem:0", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:985, mem:176, objs:-/3@cdeaaaab", - " 11 call bytes_new_from_slice(48)": "", - " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:1958, mem:304, objs:-/4@2e0f3b17", - " 13 call bls12_381_map_fp_to_g1(Bytes(obj#7))": "", - " 14 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#9))": "cpu:1547035, mem:6032, objs:-/5@29aed6cc", - " 15 call obj_cmp(Bytes(obj#9), Bytes(obj#5))": "", - " 16 ret obj_cmp -> Ok(0)": "cpu:1547335", - " 17 call bytes_new_from_slice(96)": "", - " 18 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:1548320, mem:6208, objs:-/6@821b5c9e", - " 19 call bytes_new_from_slice(48)": "", - " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#13))": "cpu:1549293, mem:6336, objs:-/7@71870e60", - " 21 call bls12_381_map_fp_to_g1(Bytes(obj#13))": "", - " 22 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#15))": "cpu:3094370, mem:12064, objs:-/8@fd3d495a", - " 23 call obj_cmp(Bytes(obj#15), Bytes(obj#11))": "", - " 24 ret obj_cmp -> Ok(0)": "cpu:3094670", - " 25 call bytes_new_from_slice(96)": "", - " 26 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:3095655, mem:12240, objs:-/9@e01f72c2", - " 27 call bytes_new_from_slice(48)": "", - " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:3096628, mem:12368, objs:-/10@c37ded65", - " 29 call bls12_381_map_fp_to_g1(Bytes(obj#19))": "", - " 30 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#21))": "cpu:4641705, mem:18096, objs:-/11@74ec3770", - " 31 call obj_cmp(Bytes(obj#21), Bytes(obj#17))": "", - " 32 ret obj_cmp -> Ok(0)": "cpu:4642005", - " 33 call bytes_new_from_slice(96)": "", - " 34 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:4642990, mem:18272, objs:-/12@bc8549c8", - " 35 call bytes_new_from_slice(48)": "", - " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#25))": "cpu:4643963, mem:18400, objs:-/13@79cc3259", - " 37 call bls12_381_map_fp_to_g1(Bytes(obj#25))": "", - " 38 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#27))": "cpu:6189040, mem:24128, objs:-/14@97e7f723", - " 39 call obj_cmp(Bytes(obj#27), Bytes(obj#23))": "", - " 40 ret obj_cmp -> Ok(0)": "cpu:6189340", - " 41 call bytes_new_from_slice(96)": "", - " 42 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:6190325, mem:24304, objs:-/15@3746f16a", - " 43 call bytes_new_from_slice(48)": "", - " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:6191298, mem:24432, objs:-/16@114ed45b", - " 45 call bls12_381_map_fp_to_g1(Bytes(obj#31))": "", - " 46 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#33))": "cpu:7736375, mem:30160, objs:-/17@448a6b86", - " 47 call obj_cmp(Bytes(obj#33), Bytes(obj#29))": "", - " 48 ret obj_cmp -> Ok(0)": "cpu:7736675", - " 49 call bytes_new_from_slice(96)": "", - " 50 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:7737660, mem:30336, objs:-/18@1b5f524f", - " 51 call bytes_new_from_slice(48)": "", - " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:7738633, mem:30464, objs:-/19@fe79161", - " 53 call bls12_381_map_fp_to_g1(Bytes(obj#37))": "", - " 54 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#39))": "cpu:9283710, mem:36192, objs:-/20@af30d655", - " 55 call obj_cmp(Bytes(obj#39), Bytes(obj#35))": "", - " 56 ret obj_cmp -> Ok(0)": "cpu:9284010", - " 57 call bytes_new_from_slice(96)": "", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#41))": "cpu:9284995, mem:36368, objs:-/21@8f40a475", - " 59 call bytes_new_from_slice(48)": "", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#43))": "cpu:9285968, mem:36496, objs:-/22@37d82db9", - " 61 call bls12_381_map_fp_to_g1(Bytes(obj#43))": "", - " 62 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#45))": "cpu:10831045, mem:42224, objs:-/23@de5cb3dc", - " 63 call obj_cmp(Bytes(obj#45), Bytes(obj#41))": "", - " 64 ret obj_cmp -> Ok(0)": "cpu:10831345", - " 65 call bytes_new_from_slice(96)": "", - " 66 ret bytes_new_from_slice -> Ok(Bytes(obj#47))": "cpu:10832330, mem:42400, objs:-/24@613b7c76", - " 67 call bytes_new_from_slice(48)": "", - " 68 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:10833303, mem:42528, objs:-/25@fac3e5c0", - " 69 call bls12_381_map_fp_to_g1(Bytes(obj#49))": "", - " 70 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#51))": "cpu:12378380, mem:48256, objs:-/26@e7334e35", - " 71 call obj_cmp(Bytes(obj#51), Bytes(obj#47))": "", - " 72 ret obj_cmp -> Ok(0)": "cpu:12378680", - " 73 call bytes_new_from_slice(96)": "", - " 74 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:12379665, mem:48432, objs:-/27@a70654db", - " 75 call bytes_new_from_slice(48)": "", - " 76 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:12380638, mem:48560, objs:-/28@4f2c81bb", - " 77 call bls12_381_map_fp_to_g1(Bytes(obj#55))": "", - " 78 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#57))": "cpu:13925715, mem:54288, objs:-/29@6049ec79", - " 79 call obj_cmp(Bytes(obj#57), Bytes(obj#53))": "", - " 80 ret obj_cmp -> Ok(0)": "cpu:13926015", - " 81 call bytes_new_from_slice(96)": "", - " 82 ret bytes_new_from_slice -> Ok(Bytes(obj#59))": "cpu:13927000, mem:54464, objs:-/30@6a6fdc1d", - " 83 call bytes_new_from_slice(48)": "", - " 84 ret bytes_new_from_slice -> Ok(Bytes(obj#61))": "cpu:13927973, mem:54592, objs:-/31@c8870a0b", - " 85 call bls12_381_map_fp_to_g1(Bytes(obj#61))": "", - " 86 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#63))": "cpu:15473050, mem:60320, objs:-/32@15761a", - " 87 call obj_cmp(Bytes(obj#63), Bytes(obj#59))": "", - " 88 ret obj_cmp -> Ok(0)": "cpu:15473350", - " 89 end": "cpu:15473350, mem:60320, prngs:-/-, objs:-/32@15761a, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 9 call bytes_new_from_slice(48)": "", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:5144, mem:384, objs:-/3@80e43591", + " 11 call bls12_381_map_fp_to_g1(Bytes(obj#5))": "", + " 12 ret bls12_381_map_fp_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:6299", + " 13 call bytes_new_from_slice(96)": "cpu:0, mem:0", + " 14 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:985, mem:176, objs:-/4@6bc2aad1", + " 15 call bytes_new_from_slice(48)": "", + " 16 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:1958, mem:304, objs:-/5@5c1201b8", + " 17 call bls12_381_map_fp_to_g1(Bytes(obj#9))": "", + " 18 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#11))": "cpu:1547035, mem:6032, objs:-/6@efa8720b", + " 19 call obj_cmp(Bytes(obj#11), Bytes(obj#7))": "", + " 20 ret obj_cmp -> Ok(0)": "cpu:1547335", + " 21 call bytes_new_from_slice(96)": "", + " 22 ret bytes_new_from_slice -> Ok(Bytes(obj#13))": "cpu:1548320, mem:6208, objs:-/7@a344b20f", + " 23 call bytes_new_from_slice(48)": "", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:1549293, mem:6336, objs:-/8@cebe8368", + " 25 call bls12_381_map_fp_to_g1(Bytes(obj#15))": "", + " 26 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#17))": "cpu:3094370, mem:12064, objs:-/9@60d4b257", + " 27 call obj_cmp(Bytes(obj#17), Bytes(obj#13))": "", + " 28 ret obj_cmp -> Ok(0)": "cpu:3094670", + " 29 call bytes_new_from_slice(96)": "", + " 30 ret bytes_new_from_slice -> Ok(Bytes(obj#19))": "cpu:3095655, mem:12240, objs:-/10@c8dd0777", + " 31 call bytes_new_from_slice(48)": "", + " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:3096628, mem:12368, objs:-/11@7ded6720", + " 33 call bls12_381_map_fp_to_g1(Bytes(obj#21))": "", + " 34 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#23))": "cpu:4641705, mem:18096, objs:-/12@b43943ab", + " 35 call obj_cmp(Bytes(obj#23), Bytes(obj#19))": "", + " 36 ret obj_cmp -> Ok(0)": "cpu:4642005", + " 37 call bytes_new_from_slice(96)": "", + " 38 ret bytes_new_from_slice -> Ok(Bytes(obj#25))": "cpu:4642990, mem:18272, objs:-/13@a2684387", + " 39 call bytes_new_from_slice(48)": "", + " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:4643963, mem:18400, objs:-/14@715274dc", + " 41 call bls12_381_map_fp_to_g1(Bytes(obj#27))": "", + " 42 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#29))": "cpu:6189040, mem:24128, objs:-/15@10993226", + " 43 call obj_cmp(Bytes(obj#29), Bytes(obj#25))": "", + " 44 ret obj_cmp -> Ok(0)": "cpu:6189340", + " 45 call bytes_new_from_slice(96)": "", + " 46 ret bytes_new_from_slice -> Ok(Bytes(obj#31))": "cpu:6190325, mem:24304, objs:-/16@6b210d16", + " 47 call bytes_new_from_slice(48)": "", + " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:6191298, mem:24432, objs:-/17@200edbf", + " 49 call bls12_381_map_fp_to_g1(Bytes(obj#33))": "", + " 50 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#35))": "cpu:7736375, mem:30160, objs:-/18@b70ee9ef", + " 51 call obj_cmp(Bytes(obj#35), Bytes(obj#31))": "", + " 52 ret obj_cmp -> Ok(0)": "cpu:7736675", + " 53 call bytes_new_from_slice(96)": "", + " 54 ret bytes_new_from_slice -> Ok(Bytes(obj#37))": "cpu:7737660, mem:30336, objs:-/19@3870175b", + " 55 call bytes_new_from_slice(48)": "", + " 56 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:7738633, mem:30464, objs:-/20@d86aad53", + " 57 call bls12_381_map_fp_to_g1(Bytes(obj#39))": "", + " 58 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#41))": "cpu:9283710, mem:36192, objs:-/21@30c9e1a4", + " 59 call obj_cmp(Bytes(obj#41), Bytes(obj#37))": "", + " 60 ret obj_cmp -> Ok(0)": "cpu:9284010", + " 61 call bytes_new_from_slice(96)": "", + " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#43))": "cpu:9284995, mem:36368, objs:-/22@90cc3e60", + " 63 call bytes_new_from_slice(48)": "", + " 64 ret bytes_new_from_slice -> Ok(Bytes(obj#45))": "cpu:9285968, mem:36496, objs:-/23@e85d1d60", + " 65 call bls12_381_map_fp_to_g1(Bytes(obj#45))": "", + " 66 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#47))": "cpu:10831045, mem:42224, objs:-/24@c6fa6f0c", + " 67 call obj_cmp(Bytes(obj#47), Bytes(obj#43))": "", + " 68 ret obj_cmp -> Ok(0)": "cpu:10831345", + " 69 call bytes_new_from_slice(96)": "", + " 70 ret bytes_new_from_slice -> Ok(Bytes(obj#49))": "cpu:10832330, mem:42400, objs:-/25@53450af3", + " 71 call bytes_new_from_slice(48)": "", + " 72 ret bytes_new_from_slice -> Ok(Bytes(obj#51))": "cpu:10833303, mem:42528, objs:-/26@f5960012", + " 73 call bls12_381_map_fp_to_g1(Bytes(obj#51))": "", + " 74 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#53))": "cpu:12378380, mem:48256, objs:-/27@9d2fb1f6", + " 75 call obj_cmp(Bytes(obj#53), Bytes(obj#49))": "", + " 76 ret obj_cmp -> Ok(0)": "cpu:12378680", + " 77 call bytes_new_from_slice(96)": "", + " 78 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:12379665, mem:48432, objs:-/28@a13fa1a3", + " 79 call bytes_new_from_slice(48)": "", + " 80 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:12380638, mem:48560, objs:-/29@2816bcaf", + " 81 call bls12_381_map_fp_to_g1(Bytes(obj#57))": "", + " 82 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#59))": "cpu:13925715, mem:54288, objs:-/30@7be5db06", + " 83 call obj_cmp(Bytes(obj#59), Bytes(obj#55))": "", + " 84 ret obj_cmp -> Ok(0)": "cpu:13926015", + " 85 call bytes_new_from_slice(96)": "", + " 86 ret bytes_new_from_slice -> Ok(Bytes(obj#61))": "cpu:13927000, mem:54464, objs:-/31@37bc8fe", + " 87 call bytes_new_from_slice(48)": "", + " 88 ret bytes_new_from_slice -> Ok(Bytes(obj#63))": "cpu:13927973, mem:54592, objs:-/32@73973499", + " 89 call bls12_381_map_fp_to_g1(Bytes(obj#63))": "", + " 90 ret bls12_381_map_fp_to_g1 -> Ok(Bytes(obj#65))": "cpu:15473050, mem:60320, objs:-/33@8a8027cd", + " 91 call obj_cmp(Bytes(obj#65), Bytes(obj#61))": "", + " 92 ret obj_cmp -> Ok(0)": "cpu:15473350", + " 93 end": "cpu:15473350, mem:60320, prngs:-/-, objs:-/33@8a8027cd, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/src/crypto/bls12_381.rs b/soroban-env-host/src/crypto/bls12_381.rs index 8b8a26708..6178c8074 100644 --- a/soroban-env-host/src/crypto/bls12_381.rs +++ b/soroban-env-host/src/crypto/bls12_381.rs @@ -229,8 +229,8 @@ impl Host { // // internally when deserializing `Fp`, the flag bits are masked off // to get `X: Fp`. The Y however, does not have the top bits masked off - // so it is possible for Y to exceed 381 bits. I've checked all over and - // didn't find that being an invalid condition, so we will leave them as is. + // so it is possible for Y to exceed 381 bits. Internally Fp deserialization + // makes sure any value >= prime modulus results in an error. self.affine_deserialize::( bo, ContractCostType::Bls12381G1CheckPointOnCurve, @@ -260,8 +260,8 @@ impl Host { // // internally when deserializing `Fp`, the flag bits are masked off // to get `X: Fp`. The Y however, does not have the top bits masked off - // so it is possible for Y to exceed 381 bits. I've checked all over and - // didn't find that being an invalid condition, so we will leave them as is. + // so it is possible for Y to exceed 381 bits. Internally Fp deserialization + // makes sure any value >= prime modulus results in an error. self.affine_deserialize::( bo, ContractCostType::Bls12381G2CheckPointOnCurve, diff --git a/soroban-env-host/src/test/bls12_381.rs b/soroban-env-host/src/test/bls12_381.rs index 2666e3eaf..051385dd1 100644 --- a/soroban-env-host/src/test/bls12_381.rs +++ b/soroban-env-host/src/test/bls12_381.rs @@ -14,6 +14,8 @@ use rand::{rngs::StdRng, SeedableRng}; use serde::Deserialize; use std::cmp::Ordering; +const MODULUS: &str = "0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab"; + impl Host { pub(crate) fn fp_serialize_into_bytesobj(&self, fp: &Fq) -> Result { let mut buf = [0u8; FP_SERIALIZED_SIZE]; @@ -38,6 +40,7 @@ enum InvalidPointTypes { SortFlagSet, PointNotOnCurve, PointNotInSubgroup, + OutOfRange, } #[allow(unused)] @@ -117,6 +120,11 @@ fn sample_g1_not_in_subgroup(host: &Host, rng: &mut StdRng) -> Result Result { + let g1 = sample_g1(host, rng)?; + host.bytes_copy_from_slice(g1, U32Val::from(0), MODULUS.as_bytes()) +} + fn g1_zero(host: &Host) -> Result { host.g1_affine_serialize_uncompressed(&G1Affine::zero()) } @@ -160,6 +168,7 @@ fn invalid_g1( } InvalidPointTypes::PointNotOnCurve => sample_g1_not_on_curve(host, rng), InvalidPointTypes::PointNotInSubgroup => sample_g1_not_in_subgroup(host, rng), + InvalidPointTypes::OutOfRange => sample_g1_out_of_range(host, rng), } } @@ -194,6 +203,11 @@ fn g2_zero(host: &Host) -> Result { host.g2_affine_serialize_uncompressed(&G2Affine::zero()) } +fn sample_g2_out_of_range(host: &Host, rng: &mut StdRng) -> Result { + let g2 = sample_g2(host, rng)?; + host.bytes_copy_from_slice(g2, U32Val::from(0), MODULUS.as_bytes()) +} + fn neg_g2(bo: BytesObject, host: &Host) -> Result { let g2 = host.g2_affine_deserialize_from_bytesobj(bo, true)?; host.g2_affine_serialize_uncompressed(&-g2) @@ -233,6 +247,7 @@ fn invalid_g2( } InvalidPointTypes::PointNotOnCurve => sample_g2_not_on_curve(host, rng), InvalidPointTypes::PointNotInSubgroup => sample_g2_not_in_subgroup(host, rng), + InvalidPointTypes::OutOfRange => sample_g2_out_of_range(host, rng), } } @@ -274,6 +289,11 @@ fn invalid_fp( host.serialize_uncompressed_into_slice::(&fp, &mut buf, "test")?; host.bytes_new_from_slice(&buf[0..FP_SERIALIZED_SIZE - 1]) // take one less byte } + InvalidPointTypes::OutOfRange => { + // Fp can only take the range of (0, MODULUS-1) + let bytes = parse_hex(&MODULUS); + host.bytes_new_from_slice(bytes.as_slice()) + } _ => panic!("not available"), } } @@ -303,6 +323,11 @@ fn invalid_fp2( )?; host.bytes_new_from_slice(&buf[0..FP2_SERIALIZED_SIZE - 1]) // take one less byte } + InvalidPointTypes::OutOfRange => { + // Each Fp can only take the range of (0, MODULUS-1) + let bytes = parse_hex(&MODULUS); + host.bytes_new_from_slice(bytes.as_slice()) + } _ => panic!("not available"), } } @@ -423,6 +448,14 @@ fn check_g1_is_in_subgroup() -> Result<(), HostError> { )?), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); + assert!(HostError::result_matches_err( + host.bls12_381_check_g1_is_in_subgroup(invalid_g1( + &host, + InvalidPointTypes::OutOfRange, + &mut rng + )?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); } // valid point in subgroup { @@ -820,6 +853,11 @@ fn map_fp_to_g1() -> Result<(), HostError> { host.bls12_381_map_fp_to_g1(p2), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); + let p3 = invalid_fp(&host, InvalidPointTypes::OutOfRange, &mut rng)?; + assert!(HostError::result_matches_err( + host.bls12_381_map_fp_to_g1(p3), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); } // Test cases from https://datatracker.ietf.org/doc/html/rfc9380#name-bls12381g1_xmdsha-256_sswu_ // To interpret the results, understand the steps it takes to hash a msg to curve @@ -962,6 +1000,14 @@ fn check_g2_is_in_subgroup() -> Result<(), HostError> { )?), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); + assert!(HostError::result_matches_err( + host.bls12_381_check_g2_is_in_subgroup(invalid_g2( + &host, + InvalidPointTypes::OutOfRange, + &mut rng + )?), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); } // valid point in subgroup { @@ -1359,6 +1405,11 @@ fn map_fp2_to_g2() -> Result<(), HostError> { host.bls12_381_map_fp2_to_g2(p2), (ScErrorType::Crypto, ScErrorCode::InvalidInput) )); + let p3 = invalid_fp2(&host, InvalidPointTypes::OutOfRange, &mut rng)?; + assert!(HostError::result_matches_err( + host.bls12_381_map_fp2_to_g2(p3), + (ScErrorType::Crypto, ScErrorCode::InvalidInput) + )); } // Test cases from https://datatracker.ietf.org/doc/html/rfc9380#name-bls12381g2_xmdsha-256_sswu_ // To interpret the results, understand the steps it takes to hash a msg to curve From 01aef550187db28b5594ce4e392ed2aa35fcd960 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Tue, 17 Sep 2024 18:40:50 -0400 Subject: [PATCH 14/18] add ethereum bls signature tests --- soroban-env-host/tests/bls.rs | 449 ++++++++++++++++++ .../data/ethereum-bls/aggregate/README.md | 19 + ...0000000000000000000000000000000000000.json | 1 + ...6565656565656565656565656565656565656.json | 1 + ...babababababababababababababababababab.json | 1 + .../aggregate_infinity_signature.json | 1 + .../aggregate/aggregate_single_signature.json | 1 + .../ethereum-bls/aggregate_verify/README.md | 17 + .../aggregate_verify_valid.json | 1 + .../data/ethereum-bls/batch_verify/README.md | 17 + ...h_verify_invalid_forged_signature_set.json | 1 + ...h_verify_valid_multiple_signature_set.json | 1 + ...tch_verify_valid_simple_signature_set.json | 1 + .../fast_aggregate_verify/README.md | 17 + ..._verify_extra_pubkey_4f079f946446fabf.json | 1 + ..._verify_extra_pubkey_5a38e6b4017fe4dd.json | 1 + ..._verify_extra_pubkey_a698ea45b109f303.json | 1 + ...gregate_verify_valid_3d7576f3c0e3570a.json | 1 + ...gregate_verify_valid_5e745ad0c6199a6c.json | 1 + ...gregate_verify_valid_652ce62f09290811.json | 1 + .../tests/data/ethereum-bls/sign/README.md | 21 + .../sign/sign_case_11b8c7cad5238946.json | 1 + .../sign/sign_case_142f678a8d05fcd1.json | 1 + .../sign/sign_case_37286e1a6d1f6eb3.json | 1 + .../sign/sign_case_7055381f640f2c1d.json | 1 + .../sign/sign_case_84d45c9c7cca6b92.json | 1 + .../sign/sign_case_8cd3d4d0d9a5b265.json | 1 + .../sign/sign_case_c82df61aa3ee60fb.json | 1 + .../sign/sign_case_d0e28d7e76eb6e9c.json | 1 + .../sign/sign_case_f2ae1097e7d0e18b.json | 1 + .../tests/data/ethereum-bls/verify/README.md | 17 + .../verify_valid_case_195246ee3bd3b6ec.json | 1 + .../verify_valid_case_2ea479adf8c40300.json | 1 + .../verify_valid_case_2f09d443ab8a3ac2.json | 1 + .../verify_valid_case_3208262581c8fc09.json | 1 + .../verify_valid_case_6b3b17f6962a490c.json | 1 + .../verify_valid_case_6eeb7c52dfd9baf0.json | 1 + .../verify_valid_case_8761a0b7e920c323.json | 1 + .../verify_valid_case_d34885d766d5f705.json | 1 + .../verify_valid_case_e8a50c445c855360.json | 1 + ...fy_wrong_pubkey_case_195246ee3bd3b6ec.json | 1 + ...fy_wrong_pubkey_case_2ea479adf8c40300.json | 1 + ...fy_wrong_pubkey_case_2f09d443ab8a3ac2.json | 1 + ...fy_wrong_pubkey_case_3208262581c8fc09.json | 1 + ...fy_wrong_pubkey_case_6b3b17f6962a490c.json | 1 + ...fy_wrong_pubkey_case_6eeb7c52dfd9baf0.json | 1 + ...fy_wrong_pubkey_case_8761a0b7e920c323.json | 1 + ...fy_wrong_pubkey_case_d34885d766d5f705.json | 1 + ...fy_wrong_pubkey_case_e8a50c445c855360.json | 1 + ...rifycase_one_privkey_47117849458281be.json | 1 + 50 files changed, 600 insertions(+) create mode 100644 soroban-env-host/tests/bls.rs create mode 100644 soroban-env-host/tests/data/ethereum-bls/aggregate/README.md create mode 100644 soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0xabababababababababababababababababababababababababababababababab.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_infinity_signature.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_single_signature.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/aggregate_verify/README.md create mode 100644 soroban-env-host/tests/data/ethereum-bls/aggregate_verify/aggregate_verify_valid.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/batch_verify/README.md create mode 100644 soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_invalid_forged_signature_set.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_valid_multiple_signature_set.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_valid_simple_signature_set.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/README.md create mode 100644 soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_4f079f946446fabf.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_a698ea45b109f303.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_3d7576f3c0e3570a.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_5e745ad0c6199a6c.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_652ce62f09290811.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/sign/README.md create mode 100644 soroban-env-host/tests/data/ethereum-bls/sign/sign_case_11b8c7cad5238946.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/sign/sign_case_142f678a8d05fcd1.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/sign/sign_case_37286e1a6d1f6eb3.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/sign/sign_case_7055381f640f2c1d.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/sign/sign_case_84d45c9c7cca6b92.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/sign/sign_case_8cd3d4d0d9a5b265.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/sign/sign_case_c82df61aa3ee60fb.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/sign/sign_case_d0e28d7e76eb6e9c.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/sign/sign_case_f2ae1097e7d0e18b.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/README.md create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_195246ee3bd3b6ec.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_2ea479adf8c40300.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_2f09d443ab8a3ac2.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_3208262581c8fc09.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_6b3b17f6962a490c.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_6eeb7c52dfd9baf0.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_8761a0b7e920c323.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_d34885d766d5f705.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_e8a50c445c855360.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_195246ee3bd3b6ec.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_2ea479adf8c40300.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_2f09d443ab8a3ac2.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_3208262581c8fc09.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_6b3b17f6962a490c.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_6eeb7c52dfd9baf0.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_8761a0b7e920c323.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_d34885d766d5f705.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_e8a50c445c855360.json create mode 100644 soroban-env-host/tests/data/ethereum-bls/verify/verifycase_one_privkey_47117849458281be.json diff --git a/soroban-env-host/tests/bls.rs b/soroban-env-host/tests/bls.rs new file mode 100644 index 000000000..23764fa0d --- /dev/null +++ b/soroban-env-host/tests/bls.rs @@ -0,0 +1,449 @@ +mod v22 { + use ark_bls12_381::{G1Affine, G2Affine}; + use ark_ec::AffineRepr; + use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Validate}; + use hex::FromHex; + use serde::Deserialize; + use soroban_env_host::{ + budget::AsBudget, + xdr::{ScErrorCode, ScErrorType}, + BytesObject, Env, EnvBase, Error, Host, HostError, Val, + }; + use std::cmp::Ordering; + + pub const DST_ETHEREUM: &str = "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_"; + + #[derive(Deserialize, Debug)] + struct Aggregate { + input: Vec, + output: String, + } + + #[derive(Deserialize, Debug)] + struct AggregateVerifyInput { + pubkeys: Vec, + messages: Vec, + signature: String, + } + + #[derive(Deserialize, Debug)] + struct AggregateVerify { + input: AggregateVerifyInput, + output: bool, + } + + #[derive(Deserialize, Debug)] + struct BatchVerifyInput { + pubkeys: Vec, + messages: Vec, + signatures: Vec, + } + + #[derive(Deserialize, Debug)] + struct BatchVerify { + input: BatchVerifyInput, + output: bool, + } + + #[derive(Debug, Deserialize)] + struct FastAggregateVerifyInput { + pubkeys: Vec, + message: String, + signature: String, + } + + #[derive(Debug, Deserialize)] + struct FastAggregateVerify { + input: FastAggregateVerifyInput, + output: bool, + } + + #[derive(Deserialize, Debug)] + struct VerifyInput { + pubkey: String, + message: String, + signature: String, + } + + #[derive(Debug, Deserialize)] + struct Verify { + input: VerifyInput, + output: bool, + } + + #[derive(Deserialize, Debug)] + struct SignInput { + privkey: String, + message: String, + } + + #[derive(Deserialize, Debug)] + struct Sign { + input: SignInput, + output: String, + } + + fn parse_hex(s: &str) -> Vec { + Vec::from_hex(s.trim_start_matches("0x")).unwrap() + } + + fn adapt_g1_point(host: &Host, p: &String) -> Result { + let p = parse_hex(p.as_str()); + assert_eq!(p.len(), 48); + let pt = + G1Affine::deserialize_with_mode(p.as_slice(), Compress::Yes, Validate::No).unwrap(); + let mut buf = vec![0u8; 96]; + pt.serialize_with_mode(buf.as_mut_slice(), Compress::No) + .unwrap(); + host.bytes_new_from_slice(&buf) + } + + fn neg_g1(host: &Host) -> Result { + let mut buf = [0u8; 96]; + let neg_g1 = -G1Affine::generator(); + neg_g1.serialize_uncompressed(buf.as_mut_slice()).unwrap(); + host.bytes_new_from_slice(&buf) + } + + fn adapt_g2_point(host: &Host, p: &String) -> Result { + let p = parse_hex(p.as_str()); + assert_eq!(p.len(), 96); + let pt = + G2Affine::deserialize_with_mode(p.as_slice(), Compress::Yes, Validate::No).unwrap(); + let mut buf = vec![0u8; 192]; + pt.serialize_with_mode(buf.as_mut_slice(), Compress::No) + .unwrap(); + host.bytes_new_from_slice(&buf) + } + + fn hash_msg_to_curve( + host: &Host, + msg: &String, + dst: BytesObject, + ) -> Result { + let msg = parse_hex(msg.as_str()); + let msg = host.bytes_new_from_slice(&msg)?; + host.bls12_381_hash_to_g2(msg, dst) + } + + fn aggregate_g1(host: &Host, inputs: &Vec) -> Result { + assert!(!inputs.is_empty()); + let mut agg = adapt_g1_point(&host, &inputs[0])?; + for i in 1..inputs.len() { + let pt = adapt_g1_point(&host, &inputs[i])?; + agg = host.bls12_381_g1_add(agg, pt)?; + } + match host.bls12_381_check_g1_is_in_subgroup(agg)?.into() { + true => Ok(agg), + false => Err(HostError::from(Error::from_type_and_code( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + ))), + } + } + + fn aggregate_g2(host: &Host, inputs: &Vec) -> Result { + assert!(!inputs.is_empty()); + let mut agg = adapt_g2_point(&host, &inputs[0])?; + for i in 1..inputs.len() { + let pt = adapt_g2_point(&host, &inputs[i])?; + agg = host.bls12_381_g2_add(agg, pt)?; + } + match host.bls12_381_check_g2_is_in_subgroup(agg)?.into() { + true => Ok(agg), + false => Err(HostError::from(Error::from_type_and_code( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + ))), + } + } + + fn verify_single_signature( + host: &Host, + pubkey: &String, + msg: &String, + sig: &String, + ) -> Result { + let dst = host.bytes_new_from_slice(DST_ETHEREUM.as_bytes())?; + let pk = adapt_g1_point(host, &pubkey).unwrap().to_val(); + let msg = hash_msg_to_curve(host, &msg, dst).unwrap().to_val(); + let sig = adapt_g2_point(host, &sig)?.to_val(); + let neg_g1 = neg_g1(host)?.to_val(); + let g1_vec = host.vec_new_from_slice(&[pk, neg_g1])?; + let g2_vec = host.vec_new_from_slice(&[msg, sig])?; + let res = host.bls12_381_multi_pairing_check(g1_vec, g2_vec)?; + if res.as_val().is_false() { + return Ok(false); + } + Ok(true) + } + + // implements the CoreAggregateVerify algorithm specified in + // https://www.ietf.org/archive/id/draft-irtf-cfrg-bls-signature-05.html#section-2.9 + fn aggregate_verify( + host: &Host, + pubkeys: &Vec, + msgs: &Vec, + sig: &String, + ) -> Result { + assert_eq!(pubkeys.len(), msgs.len()); + let dst = host.bytes_new_from_slice(DST_ETHEREUM.as_bytes())?; + let mut g1_vec: Vec = pubkeys + .iter() + .map(|pk| adapt_g1_point(host, pk).unwrap().to_val()) + .collect(); + let mut g2_vec: Vec = msgs + .iter() + .map(|msg| hash_msg_to_curve(host, msg, dst).unwrap().to_val()) + .collect(); + let neg_g1 = neg_g1(host)?.to_val(); + g1_vec.push(neg_g1); + let sig = adapt_g2_point(host, sig)?.to_val(); + g2_vec.push(sig); + + let g1_vec = host.vec_new_from_slice(&g1_vec)?; + let g2_vec = host.vec_new_from_slice(&g2_vec)?; + let res = host.bls12_381_multi_pairing_check(g1_vec, g2_vec)?; + if res.as_val().is_false() { + return Ok(false); + } + Ok(true) + } + + // we won't implement the batch verify logic for this test, we'll just verify individual signature + fn batch_verify( + host: &Host, + pubkeys: &Vec, + msgs: &Vec, + sigs: &Vec, + ) -> Result { + assert_eq!(pubkeys.len(), msgs.len()); + assert_eq!(pubkeys.len(), sigs.len()); + for i in 0..pubkeys.len() { + let res = verify_single_signature(host, &pubkeys[i], &msgs[i], &sigs[i])?; + if !res { + return Ok(false); + } + } + Ok(true) + } + + fn fast_aggregate_verify( + host: &Host, + pubkeys: &Vec, + msg: &String, + sig: &String, + ) -> Result { + assert!(!pubkeys.is_empty()); + let dst = host.bytes_new_from_slice(DST_ETHEREUM.as_bytes())?; + let agg_pk = aggregate_g1(host, &pubkeys)?.to_val(); + let msg = hash_msg_to_curve(host, msg, dst).unwrap().to_val(); + let sig = adapt_g2_point(host, &sig)?.to_val(); + let neg_g1 = neg_g1(host)?.to_val(); + let g1_vec = host.vec_new_from_slice(&[agg_pk, neg_g1])?; + let g2_vec = host.vec_new_from_slice(&[msg, sig])?; + let res = host.bls12_381_multi_pairing_check(g1_vec, g2_vec)?; + if res.as_val().is_false() { + return Ok(false); + } + Ok(true) + } + + fn sign(host: &Host, priv_key: &String, msg: &String) -> Result { + let dst = host.bytes_new_from_slice(DST_ETHEREUM.as_bytes())?; + let key_bytes = host.bytes_new_from_slice(parse_hex(&priv_key).as_slice())?; + let key_u256 = host.u256_val_from_be_bytes(key_bytes)?; + let msg = host.bytes_new_from_slice(&parse_hex(msg).as_slice())?; + let msg_g2 = host.bls12_381_hash_to_g2(msg, dst)?; + host.bls12_381_g2_mul(msg_g2, key_u256) + } + + #[test] + fn test_aggregate() -> Result<(), HostError> { + let test_files = [ + "aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json", + "aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json", + "aggregate_0xabababababababababababababababababababababababababababababababab.json", + "aggregate_infinity_signature.json", + "aggregate_single_signature.json", + ]; + let host = Host::test_host(); + for filename in test_files { + let test_suite: Aggregate = serde_json::from_slice( + &std::fs::read(format!("./tests/data/ethereum-bls/aggregate/{}", filename)) + .unwrap(), + ) + .unwrap(); + let agg = aggregate_g2(&host, &test_suite.input)?; + let res = adapt_g2_point(&host, &test_suite.output)?; + assert_eq!( + host.obj_cmp(agg.to_val(), res.to_val())?, + Ordering::Equal as i64 + ); + } + Ok(()) + } + + #[test] + fn test_aggregate_verify() -> Result<(), HostError> { + let test_files = ["aggregate_verify_valid.json"]; + + let host = Host::test_host(); + host.enable_debug()?; + for filename in test_files { + let test_suite: AggregateVerify = serde_json::from_slice( + &std::fs::read(format!( + "./tests/data/ethereum-bls/aggregate_verify/{}", + filename + )) + .unwrap(), + ) + .unwrap(); + let res = aggregate_verify( + &host, + &test_suite.input.pubkeys, + &test_suite.input.messages, + &test_suite.input.signature, + ); + assert_eq!(res?, test_suite.output) + } + Ok(()) + } + + #[test] + fn test_batch_verify() -> Result<(), HostError> { + let test_files = [ + "batch_verify_invalid_forged_signature_set.json", + "batch_verify_valid_multiple_signature_set.json", + "batch_verify_valid_simple_signature_set.json", + ]; + + let host = Host::test_host(); + host.enable_debug()?; + for filename in test_files { + host.as_budget().reset_default()?; + let test_suite: BatchVerify = serde_json::from_slice( + &std::fs::read(format!( + "./tests/data/ethereum-bls/batch_verify/{}", + filename + )) + .unwrap(), + ) + .unwrap(); + let res = batch_verify( + &host, + &test_suite.input.pubkeys, + &test_suite.input.messages, + &test_suite.input.signatures, + ); + assert_eq!(res?, test_suite.output) + } + Ok(()) + } + + #[test] + fn test_fast_aggregate_verify() -> Result<(), HostError> { + let test_files = [ + "fast_aggregate_verify_extra_pubkey_4f079f946446fabf.json", + "fast_aggregate_verify_valid_3d7576f3c0e3570a.json", + "fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd.json", + "fast_aggregate_verify_valid_5e745ad0c6199a6c.json", + "fast_aggregate_verify_extra_pubkey_a698ea45b109f303.json", + "fast_aggregate_verify_valid_652ce62f09290811.json", + ]; + let host = Host::test_host(); + host.enable_debug()?; + for filename in test_files { + host.as_budget().reset_default()?; + let test_suite: FastAggregateVerify = serde_json::from_slice( + &std::fs::read(format!( + "./tests/data/ethereum-bls/fast_aggregate_verify/{}", + filename + )) + .unwrap(), + ) + .unwrap(); + let res = fast_aggregate_verify( + &host, + &test_suite.input.pubkeys, + &test_suite.input.message, + &test_suite.input.signature, + ); + assert_eq!(res?, test_suite.output) + } + Ok(()) + } + + #[test] + fn test_verify() -> Result<(), HostError> { + let test_files = [ + "verify_valid_case_195246ee3bd3b6ec.json", + "verify_wrong_pubkey_case_2ea479adf8c40300.json", + "verify_valid_case_2ea479adf8c40300.json", + "verify_wrong_pubkey_case_2f09d443ab8a3ac2.json", + "verify_valid_case_2f09d443ab8a3ac2.json", + "verify_wrong_pubkey_case_3208262581c8fc09.json", + "verify_valid_case_3208262581c8fc09.json", + "verify_wrong_pubkey_case_6b3b17f6962a490c.json", + "verify_valid_case_6b3b17f6962a490c.json", + "verify_wrong_pubkey_case_6eeb7c52dfd9baf0.json", + "verify_valid_case_6eeb7c52dfd9baf0.json", + "verify_wrong_pubkey_case_8761a0b7e920c323.json", + "verify_valid_case_8761a0b7e920c323.json", + "verify_wrong_pubkey_case_d34885d766d5f705.json", + "verify_valid_case_d34885d766d5f705.json", + "verify_wrong_pubkey_case_e8a50c445c855360.json", + "verify_valid_case_e8a50c445c855360.json", + "verifycase_one_privkey_47117849458281be.json", + "verify_wrong_pubkey_case_195246ee3bd3b6ec.json", + ]; + let host = Host::test_host(); + host.enable_debug()?; + for filename in test_files { + host.as_budget().reset_default()?; + let test_suite: Verify = serde_json::from_slice( + &std::fs::read(format!("./tests/data/ethereum-bls/verify/{}", filename)).unwrap(), + ) + .unwrap(); + let res = verify_single_signature( + &host, + &test_suite.input.pubkey, + &test_suite.input.message, + &test_suite.input.signature, + ); + assert_eq!(res?, test_suite.output) + } + Ok(()) + } + + #[test] + fn test_sign() -> Result<(), HostError> { + let test_files = [ + "sign_case_11b8c7cad5238946.json", + "sign_case_37286e1a6d1f6eb3.json", + "sign_case_84d45c9c7cca6b92.json", + "sign_case_c82df61aa3ee60fb.json", + "sign_case_f2ae1097e7d0e18b.json", + "sign_case_142f678a8d05fcd1.json", + "sign_case_7055381f640f2c1d.json", + "sign_case_8cd3d4d0d9a5b265.json", + "sign_case_d0e28d7e76eb6e9c.json", + ]; + let host = Host::test_host(); + host.enable_debug()?; + for filename in test_files { + host.as_budget().reset_default()?; + let test_suite: Sign = serde_json::from_slice( + &std::fs::read(format!("./tests/data/ethereum-bls/sign/{}", filename)).unwrap(), + ) + .unwrap(); + let res = sign(&host, &test_suite.input.privkey, &test_suite.input.message)?; + let output = adapt_g2_point(&host, &test_suite.output)?; + assert_eq!( + host.obj_cmp(res.to_val(), output.to_val())?, + std::cmp::Ordering::Equal as i64 + ); + } + Ok(()) + } +} diff --git a/soroban-env-host/tests/data/ethereum-bls/aggregate/README.md b/soroban-env-host/tests/data/ethereum-bls/aggregate/README.md new file mode 100644 index 000000000..e87c5ecbb --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/aggregate/README.md @@ -0,0 +1,19 @@ +# Test format: BLS signature aggregation + +A BLS signature aggregation combines a series of signatures into a single signature. + +## Test case format + +The test data is declared in a `data.yaml` file: + +```yaml +input: List[BLS Signature] -- list of input BLS signatures +output: BLS Signature -- expected output, single BLS signature or `null`. +``` + +- `BLS Signature` here is encoded as a string: hexadecimal encoding of 96 bytes (192 nibbles), prefixed with `0x`. +- output value is `null` if the input is invalid. + +## Condition + +The `aggregate` handler should aggregate the signatures in the `input`, and the result should match the expected `output`. diff --git a/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json b/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json new file mode 100644 index 000000000..34f0e2381 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0x0000000000000000000000000000000000000000000000000000000000000000.json @@ -0,0 +1 @@ +{"input": ["0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55", "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9", "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115"], "output": "0x9683b3e6701f9a4b706709577963110043af78a5b41991b998475a3d3fd62abf35ce03b33908418efc95a058494a8ae504354b9f626231f6b3f3c849dfdeaf5017c4780e2aee1850ceaf4b4d9ce70971a3d2cfcd97b7e5ecf6759f8da5f76d31"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json b/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json new file mode 100644 index 000000000..719703866 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0x5656565656565656565656565656565656565656565656565656565656565656.json @@ -0,0 +1 @@ +{"input": ["0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb", "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe", "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6"], "output": "0xad38fc73846583b08d110d16ab1d026c6ea77ac2071e8ae832f56ac0cbcdeb9f5678ba5ce42bd8dce334cc47b5abcba40a58f7f1f80ab304193eb98836cc14d8183ec14cc77de0f80c4ffd49e168927a968b5cdaa4cf46b9805be84ad7efa77b"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0xabababababababababababababababababababababababababababababababab.json b/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0xabababababababababababababababababababababababababababababababab.json new file mode 100644 index 000000000..8b47fc8b4 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_0xabababababababababababababababababababababababababababababababab.json @@ -0,0 +1 @@ +{"input": ["0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121", "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df", "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9"], "output": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfc4ff1d930"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_infinity_signature.json b/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_infinity_signature.json new file mode 100644 index 000000000..487ed634f --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_infinity_signature.json @@ -0,0 +1 @@ +{"input": ["0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"], "output": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_single_signature.json b/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_single_signature.json new file mode 100644 index 000000000..d2b4f9cb2 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/aggregate/aggregate_single_signature.json @@ -0,0 +1 @@ +{"input": ["0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55"], "output": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/aggregate_verify/README.md b/soroban-env-host/tests/data/ethereum-bls/aggregate_verify/README.md new file mode 100644 index 000000000..112927c4a --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/aggregate_verify/README.md @@ -0,0 +1,17 @@ +# Test format: BLS aggregate signature verification + +Verify the signature against the given pubkeys and messages. + +## Test case format + +The test data is declared in a `data.yaml` file: + +```yaml +input: + pubkeys: List[bytes48] -- the pubkeys + messages: List[bytes32] -- the messages + signature: bytes96 -- the signature to verify against pubkeys and messages +output: bool -- VALID or INVALID +``` + +All byte(s) fields are encoded as strings, hexadecimal encoding, prefixed with `0x`. diff --git a/soroban-env-host/tests/data/ethereum-bls/aggregate_verify/aggregate_verify_valid.json b/soroban-env-host/tests/data/ethereum-bls/aggregate_verify/aggregate_verify_valid.json new file mode 100644 index 000000000..1592941da --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/aggregate_verify/aggregate_verify_valid.json @@ -0,0 +1 @@ +{"input": {"pubkeys": ["0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f"], "messages": ["0x0000000000000000000000000000000000000000000000000000000000000000", "0x5656565656565656565656565656565656565656565656565656565656565656", "0xabababababababababababababababababababababababababababababababab"], "signature": "0x9104e74b9dfd3ad502f25d6a5ef57db0ed7d9a0e00f3500586d8ce44231212542fcfaf87840539b398bf07626705cf1105d246ca1062c6c2e1a53029a0f790ed5e3cb1f52f8234dc5144c45fc847c0cd37a92d68e7c5ba7c648a8a339f171244"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/batch_verify/README.md b/soroban-env-host/tests/data/ethereum-bls/batch_verify/README.md new file mode 100644 index 000000000..94104bb50 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/batch_verify/README.md @@ -0,0 +1,17 @@ +# Test format: BLS batch signature verification + +[Batch verify](https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407) the signatures against the given pubkeys and messages. + +## Test case format + +The test data is declared in a `data.yaml` file: + +```yaml +input: + pubkeys: List[bytes48] -- the pubkeys + messages: List[bytes32] -- the messages + signatures: List[bytes96] -- the signatures to verify against pubkeys and messages +output: bool -- VALID or INVALID +``` + +All byte(s) fields are encoded as strings, hexadecimal encoding, prefixed with `0x`. diff --git a/soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_invalid_forged_signature_set.json b/soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_invalid_forged_signature_set.json new file mode 100644 index 000000000..567a4ac78 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_invalid_forged_signature_set.json @@ -0,0 +1 @@ +{"input": {"pubkeys": ["0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81"], "messages": ["0x0000000000000000000000000000000000000000000000000000000000000000", "0x5656565656565656565656565656565656565656565656565656565656565656"], "signatures": ["0xa70f1f1b4bd97d182ebb55d08be3f90b1dc232bb50b44e259381a642ef0bad3629ad3542f3e8ff6a84e451fc0b595e090fc4f0e860cfc5584715ef1b6cd717b9994378f7a51b815bbf5a0d95bc3402583ad2e95a229731e539906249a5e4355c", "0xb758eb7e15c101f53be2214d2a6b65e8fe7053146dbe3c73c9fe9b5efecdf63ca06a4d5d938dbf18fe6600529c0011a7013f45ae012b02904d5c7c33316e935a0e084abead4f43f84383c52cd3b3f14024437e251a2a7c0d5147954022873a58"]}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_valid_multiple_signature_set.json b/soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_valid_multiple_signature_set.json new file mode 100644 index 000000000..bdd7df17c --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_valid_multiple_signature_set.json @@ -0,0 +1 @@ +{"input": {"pubkeys": ["0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81"], "messages": ["0x0000000000000000000000000000000000000000000000000000000000000000", "0x5656565656565656565656565656565656565656565656565656565656565656"], "signatures": ["0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55", "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe"]}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_valid_simple_signature_set.json b/soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_valid_simple_signature_set.json new file mode 100644 index 000000000..e96384586 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/batch_verify/batch_verify_valid_simple_signature_set.json @@ -0,0 +1 @@ +{"input": {"pubkeys": ["0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f"], "messages": ["0x0000000000000000000000000000000000000000000000000000000000000000", "0x5656565656565656565656565656565656565656565656565656565656565656", "0xabababababababababababababababababababababababababababababababab"], "signatures": ["0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55", "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe", "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9"]}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/README.md b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/README.md new file mode 100644 index 000000000..eaf029bf7 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/README.md @@ -0,0 +1,17 @@ +# Test format: BLS fast aggregate signature verification + +Verify the signature against the given pubkeys and one message. + +## Test case format + +The test data is declared in a `data.yaml` file: + +```yaml +input: + pubkeys: List[bytes48] -- the pubkey + message: bytes32 -- the message + signature: bytes96 -- the signature to verify against pubkeys and message +output: bool -- VALID or INVALID +``` + +All byte(s) fields are encoded as strings, hexadecimal encoding, prefixed with `0x`. diff --git a/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_4f079f946446fabf.json b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_4f079f946446fabf.json new file mode 100644 index 000000000..d0753eb33 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_4f079f946446fabf.json @@ -0,0 +1 @@ +{"input": {"pubkeys": ["0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f"], "message": "0x5656565656565656565656565656565656565656565656565656565656565656", "signature": "0x912c3615f69575407db9392eb21fee18fff797eeb2fbe1816366ca2a08ae574d8824dbfafb4c9eaa1cf61b63c6f9b69911f269b664c42947dd1b53ef1081926c1e82bb2a465f927124b08391a5249036146d6f3f1e17ff5f162f779746d830d1"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd.json b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd.json new file mode 100644 index 000000000..0e9b4d5ef --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_5a38e6b4017fe4dd.json @@ -0,0 +1 @@ +{"input": {"pubkeys": ["0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f"], "message": "0xabababababababababababababababababababababababababababababababab", "signature": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfc4ff1d930"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_a698ea45b109f303.json b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_a698ea45b109f303.json new file mode 100644 index 000000000..ede402328 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_extra_pubkey_a698ea45b109f303.json @@ -0,0 +1 @@ +{"input": {"pubkeys": ["0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f"], "message": "0x0000000000000000000000000000000000000000000000000000000000000000", "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_3d7576f3c0e3570a.json b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_3d7576f3c0e3570a.json new file mode 100644 index 000000000..2470cb287 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_3d7576f3c0e3570a.json @@ -0,0 +1 @@ +{"input": {"pubkeys": ["0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f"], "message": "0xabababababababababababababababababababababababababababababababab", "signature": "0x9712c3edd73a209c742b8250759db12549b3eaf43b5ca61376d9f30e2747dbcf842d8b2ac0901d2a093713e20284a7670fcf6954e9ab93de991bb9b313e664785a075fc285806fa5224c82bde146561b446ccfc706a64b8579513cfc4ff1d930"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_5e745ad0c6199a6c.json b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_5e745ad0c6199a6c.json new file mode 100644 index 000000000..8ba653561 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_5e745ad0c6199a6c.json @@ -0,0 +1 @@ +{"input": {"pubkeys": ["0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a"], "message": "0x0000000000000000000000000000000000000000000000000000000000000000", "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_652ce62f09290811.json b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_652ce62f09290811.json new file mode 100644 index 000000000..25b0fdf2c --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/fast_aggregate_verify/fast_aggregate_verify_valid_652ce62f09290811.json @@ -0,0 +1 @@ +{"input": {"pubkeys": ["0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81"], "message": "0x5656565656565656565656565656565656565656565656565656565656565656", "signature": "0x912c3615f69575407db9392eb21fee18fff797eeb2fbe1816366ca2a08ae574d8824dbfafb4c9eaa1cf61b63c6f9b69911f269b664c42947dd1b53ef1081926c1e82bb2a465f927124b08391a5249036146d6f3f1e17ff5f162f779746d830d1"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/sign/README.md b/soroban-env-host/tests/data/ethereum-bls/sign/README.md new file mode 100644 index 000000000..299826554 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/sign/README.md @@ -0,0 +1,21 @@ +# Test format: BLS sign message + +Message signing with BLS should produce a signature. + +## Test case format + +The test data is declared in a `data.yaml` file: + +```yaml +input: + privkey: bytes32 -- the private key used for signing + message: bytes32 -- input message to sign (a hash) +output: BLS Signature -- expected output, single BLS signature or `null`. +``` + +All byte(s) fields are encoded as strings, hexadecimal encoding, prefixed with `0x`. +- output value is `null` if the input is invalid. + +## Condition + +The `sign` handler should sign `message` with `privkey`, and the resulting signature should match the expected `output`. diff --git a/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_11b8c7cad5238946.json b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_11b8c7cad5238946.json new file mode 100644 index 000000000..00b558b08 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_11b8c7cad5238946.json @@ -0,0 +1 @@ +{"input": {"privkey": "0x47b8192d77bf871b62e87859d653922725724a5c031afeabc60bcef5ff665138", "message": "0x0000000000000000000000000000000000000000000000000000000000000000"}, "output": "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_142f678a8d05fcd1.json b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_142f678a8d05fcd1.json new file mode 100644 index 000000000..29b1c4636 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_142f678a8d05fcd1.json @@ -0,0 +1 @@ +{"input": {"privkey": "0x47b8192d77bf871b62e87859d653922725724a5c031afeabc60bcef5ff665138", "message": "0x5656565656565656565656565656565656565656565656565656565656565656"}, "output": "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_37286e1a6d1f6eb3.json b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_37286e1a6d1f6eb3.json new file mode 100644 index 000000000..a62d5cfb9 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_37286e1a6d1f6eb3.json @@ -0,0 +1 @@ +{"input": {"privkey": "0x47b8192d77bf871b62e87859d653922725724a5c031afeabc60bcef5ff665138", "message": "0xabababababababababababababababababababababababababababababababab"}, "output": "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_7055381f640f2c1d.json b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_7055381f640f2c1d.json new file mode 100644 index 000000000..62d42df9e --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_7055381f640f2c1d.json @@ -0,0 +1 @@ +{"input": {"privkey": "0x328388aff0d4a5b7dc9205abd374e7e98f3cd9f3418edb4eafda5fb16473d216", "message": "0x0000000000000000000000000000000000000000000000000000000000000000"}, "output": "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_84d45c9c7cca6b92.json b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_84d45c9c7cca6b92.json new file mode 100644 index 000000000..3254f7fc8 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_84d45c9c7cca6b92.json @@ -0,0 +1 @@ +{"input": {"privkey": "0x328388aff0d4a5b7dc9205abd374e7e98f3cd9f3418edb4eafda5fb16473d216", "message": "0xabababababababababababababababababababababababababababababababab"}, "output": "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_8cd3d4d0d9a5b265.json b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_8cd3d4d0d9a5b265.json new file mode 100644 index 000000000..7ba74f09a --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_8cd3d4d0d9a5b265.json @@ -0,0 +1 @@ +{"input": {"privkey": "0x328388aff0d4a5b7dc9205abd374e7e98f3cd9f3418edb4eafda5fb16473d216", "message": "0x5656565656565656565656565656565656565656565656565656565656565656"}, "output": "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_c82df61aa3ee60fb.json b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_c82df61aa3ee60fb.json new file mode 100644 index 000000000..bc95a9185 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_c82df61aa3ee60fb.json @@ -0,0 +1 @@ +{"input": {"privkey": "0x263dbd792f5b1be47ed85f8938c0f29586af0d3ac7b977f21c278fe1462040e3", "message": "0x0000000000000000000000000000000000000000000000000000000000000000"}, "output": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_d0e28d7e76eb6e9c.json b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_d0e28d7e76eb6e9c.json new file mode 100644 index 000000000..d6d5683fc --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_d0e28d7e76eb6e9c.json @@ -0,0 +1 @@ +{"input": {"privkey": "0x263dbd792f5b1be47ed85f8938c0f29586af0d3ac7b977f21c278fe1462040e3", "message": "0x5656565656565656565656565656565656565656565656565656565656565656"}, "output": "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_f2ae1097e7d0e18b.json b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_f2ae1097e7d0e18b.json new file mode 100644 index 000000000..7def66932 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/sign/sign_case_f2ae1097e7d0e18b.json @@ -0,0 +1 @@ +{"input": {"privkey": "0x263dbd792f5b1be47ed85f8938c0f29586af0d3ac7b977f21c278fe1462040e3", "message": "0xabababababababababababababababababababababababababababababababab"}, "output": "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121"} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/README.md b/soroban-env-host/tests/data/ethereum-bls/verify/README.md new file mode 100644 index 000000000..40500d92b --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/README.md @@ -0,0 +1,17 @@ +# Test format: BLS signature verification + +Verify the signature against the given one pubkey and one message. + +## Test case format + +The test data is declared in a `data.yaml` file: + +```yaml +input: + pubkey: bytes48 -- the pubkey + message: bytes32 -- the message + signature: bytes96 -- the signature to verify against pubkey and message +output: bool -- VALID or INVALID +``` + +All byte(s) fields are encoded as strings, hexadecimal encoding, prefixed with `0x`. diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_195246ee3bd3b6ec.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_195246ee3bd3b6ec.json new file mode 100644 index 000000000..36515d84f --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_195246ee3bd3b6ec.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", "message": "0xabababababababababababababababababababababababababababababababab", "signature": "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_2ea479adf8c40300.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_2ea479adf8c40300.json new file mode 100644 index 000000000..a1a009f89 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_2ea479adf8c40300.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "message": "0x5656565656565656565656565656565656565656565656565656565656565656", "signature": "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_2f09d443ab8a3ac2.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_2f09d443ab8a3ac2.json new file mode 100644 index 000000000..e48e5cdfc --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_2f09d443ab8a3ac2.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "message": "0x0000000000000000000000000000000000000000000000000000000000000000", "signature": "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_3208262581c8fc09.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_3208262581c8fc09.json new file mode 100644 index 000000000..202923aeb --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_3208262581c8fc09.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "message": "0x5656565656565656565656565656565656565656565656565656565656565656", "signature": "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_6b3b17f6962a490c.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_6b3b17f6962a490c.json new file mode 100644 index 000000000..f904137e1 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_6b3b17f6962a490c.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", "message": "0x5656565656565656565656565656565656565656565656565656565656565656", "signature": "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_6eeb7c52dfd9baf0.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_6eeb7c52dfd9baf0.json new file mode 100644 index 000000000..b94b289cb --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_6eeb7c52dfd9baf0.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "message": "0xabababababababababababababababababababababababababababababababab", "signature": "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_8761a0b7e920c323.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_8761a0b7e920c323.json new file mode 100644 index 000000000..66cdc7f53 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_8761a0b7e920c323.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "message": "0xabababababababababababababababababababababababababababababababab", "signature": "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_d34885d766d5f705.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_d34885d766d5f705.json new file mode 100644 index 000000000..1ef2ea487 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_d34885d766d5f705.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", "message": "0x0000000000000000000000000000000000000000000000000000000000000000", "signature": "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_e8a50c445c855360.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_e8a50c445c855360.json new file mode 100644 index 000000000..d94718d39 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_valid_case_e8a50c445c855360.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "message": "0x0000000000000000000000000000000000000000000000000000000000000000", "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55"}, "output": true} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_195246ee3bd3b6ec.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_195246ee3bd3b6ec.json new file mode 100644 index 000000000..37c53ead9 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_195246ee3bd3b6ec.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", "message": "0xabababababababababababababababababababababababababababababababab", "signature": "0x9674e2228034527f4c083206032b020310face156d4a4685e2fcaec2f6f3665aa635d90347b6ce124eb879266b1e801d185de36a0a289b85e9039662634f2eea1e02e670bc7ab849d006a70b2f93b84597558a05b879c8d445f387a5d5b653df"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_2ea479adf8c40300.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_2ea479adf8c40300.json new file mode 100644 index 000000000..a8da83ab3 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_2ea479adf8c40300.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "message": "0x5656565656565656565656565656565656565656565656565656565656565656", "signature": "0xa4efa926610b8bd1c8330c918b7a5e9bf374e53435ef8b7ec186abf62e1b1f65aeaaeb365677ac1d1172a1f5b44b4e6d022c252c58486c0a759fbdc7de15a756acc4d343064035667a594b4c2a6f0b0b421975977f297dba63ee2f63ffe47bb6"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_2f09d443ab8a3ac2.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_2f09d443ab8a3ac2.json new file mode 100644 index 000000000..11e7e89c6 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_2f09d443ab8a3ac2.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "message": "0x0000000000000000000000000000000000000000000000000000000000000000", "signature": "0xb6ed936746e01f8ecf281f020953fbf1f01debd5657c4a383940b020b26507f6076334f91e2366c96e9ab279fb5158090352ea1c5b0c9274504f4f0e7053af24802e51e4568d164fe986834f41e55c8e850ce1f98458c0cfc9ab380b55285a55"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_3208262581c8fc09.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_3208262581c8fc09.json new file mode 100644 index 000000000..c73077460 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_3208262581c8fc09.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "message": "0x5656565656565656565656565656565656565656565656565656565656565656", "signature": "0x882730e5d03f6b42c3abc26d3372625034e1d871b65a8a6b900a56dae22da98abbe1b68f85e49fe7652a55ec3d0591c20767677e33e5cbb1207315c41a9ac03be39c2e7668edc043d6cb1d9fd93033caa8a1c5b0e84bedaeb6c64972503a43eb"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_6b3b17f6962a490c.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_6b3b17f6962a490c.json new file mode 100644 index 000000000..205a89fed --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_6b3b17f6962a490c.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", "message": "0x5656565656565656565656565656565656565656565656565656565656565656", "signature": "0xaf1390c3c47acdb37131a51216da683c509fce0e954328a59f93aebda7e4ff974ba208d9a4a2a2389f892a9d418d618418dd7f7a6bc7aa0da999a9d3a5b815bc085e14fd001f6a1948768a3f4afefc8b8240dda329f984cb345c6363272ba4fe"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_6eeb7c52dfd9baf0.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_6eeb7c52dfd9baf0.json new file mode 100644 index 000000000..a6b207c19 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_6eeb7c52dfd9baf0.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81", "message": "0xabababababababababababababababababababababababababababababababab", "signature": "0x91347bccf740d859038fcdcaf233eeceb2a436bcaaee9b2aa3bfb70efe29dfb2677562ccbea1c8e061fb9971b0753c240622fab78489ce96768259fc01360346da5b9f579e5da0d941e4c6ba18a0e64906082375394f337fa1af2b7127b0d121"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_8761a0b7e920c323.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_8761a0b7e920c323.json new file mode 100644 index 000000000..7ed97782c --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_8761a0b7e920c323.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "message": "0xabababababababababababababababababababababababababababababababab", "signature": "0xae82747ddeefe4fd64cf9cedb9b04ae3e8a43420cd255e3c7cd06a8d88b7c7f8638543719981c5d16fa3527c468c25f0026704a6951bde891360c7e8d12ddee0559004ccdbe6046b55bae1b257ee97f7cdb955773d7cf29adf3ccbb9975e4eb9"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_d34885d766d5f705.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_d34885d766d5f705.json new file mode 100644 index 000000000..a9c10e084 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_d34885d766d5f705.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xb53d21a4cfd562c469cc81514d4ce5a6b577d8403d32a394dc265dd190b47fa9f829fdd7963afdf972e5e77854051f6f", "message": "0x0000000000000000000000000000000000000000000000000000000000000000", "signature": "0xb23c46be3a001c63ca711f87a005c200cc550b9429d5f4eb38d74322144f1b63926da3388979e5321012fb1a0526bcd100b5ef5fe72628ce4cd5e904aeaa3279527843fae5ca9ca675f4f51ed8f83bbf7155da9ecc9663100a885d5dc6df96d9"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_e8a50c445c855360.json b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_e8a50c445c855360.json new file mode 100644 index 000000000..bf24f57b9 --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verify_wrong_pubkey_case_e8a50c445c855360.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0xa491d1b0ecd9bb917989f0e74f0dea0422eac4a873e5e2644f368dffb9a6e20fd6e10c1b77654d067c0618f6e5a7f79a", "message": "0x0000000000000000000000000000000000000000000000000000000000000000", "signature": "0x948a7cb99f76d616c2c564ce9bf4a519f1bea6b0a624a02276443c245854219fabb8d4ce061d255af5330b078d5380681751aa7053da2c98bae898edc218c75f07e24d8802a17cd1f6833b71e58f5eb5b94208b4d0bb3848cecb075ea21be115"}, "output": false} \ No newline at end of file diff --git a/soroban-env-host/tests/data/ethereum-bls/verify/verifycase_one_privkey_47117849458281be.json b/soroban-env-host/tests/data/ethereum-bls/verify/verifycase_one_privkey_47117849458281be.json new file mode 100644 index 000000000..11c9373eb --- /dev/null +++ b/soroban-env-host/tests/data/ethereum-bls/verify/verifycase_one_privkey_47117849458281be.json @@ -0,0 +1 @@ +{"input": {"pubkey": "0x97f1d3a73197d7942695638c4fa9ac0fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb", "message": "0x1212121212121212121212121212121212121212121212121212121212121212", "signature": "0xa42ae16f1c2a5fa69c04cb5998d2add790764ce8dd45bf25b29b4700829232052b52352dcff1cf255b3a7810ad7269601810f03b2bc8b68cf289cf295b206770605a190b6842583e47c3d1c0f73c54907bfb2a602157d46a4353a20283018763"}, "output": true} \ No newline at end of file From 21e940d0de75af6eca5ad3306fcfc4a44bae7e2c Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Tue, 17 Sep 2024 18:58:52 -0400 Subject: [PATCH 15/18] fix typo on function name --- soroban-env-host/src/cost_runner/cost_types/bls12_381.rs | 2 +- soroban-env-host/src/cost_runner/experimental/bls12_381.rs | 2 +- soroban-env-host/src/crypto/bls12_381.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs index a50dc891f..865aa9046 100644 --- a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs +++ b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs @@ -283,7 +283,7 @@ impl CostRunner for Bls12381DecodeFpRun { ) -> Self::RecycledType { let Bls12381DecodeFpSample(buf) = &sample; let res = host - .deserialize_uncompessed_no_validate::(buf, "test") + .deserialize_uncompressed_no_validate::(buf, "test") .unwrap(); black_box((Some(sample), Some(res))) } diff --git a/soroban-env-host/src/cost_runner/experimental/bls12_381.rs b/soroban-env-host/src/cost_runner/experimental/bls12_381.rs index 58467c44f..3261bb704 100644 --- a/soroban-env-host/src/cost_runner/experimental/bls12_381.rs +++ b/soroban-env-host/src/cost_runner/experimental/bls12_381.rs @@ -84,7 +84,7 @@ macro_rules! impl_deser_runner_for_bls { fn run_iter(host: &Host, _iter: u64, sample: Self::SampleType) -> Self::RecycledType { let res = host - .deserialize_uncompessed_no_validate::<$expected_size, _>(&sample, "test") + .deserialize_uncompressed_no_validate::<$expected_size, _>(&sample, "test") .unwrap(); black_box((None, Some(res))) } diff --git a/soroban-env-host/src/crypto/bls12_381.rs b/soroban-env-host/src/crypto/bls12_381.rs index 6178c8074..68fab8af2 100644 --- a/soroban-env-host/src/crypto/bls12_381.rs +++ b/soroban-env-host/src/crypto/bls12_381.rs @@ -45,7 +45,7 @@ impl Host { // (the base field element), and will be charged accordingly. // Validation of the deserialized entity must be performed outside of this // function, to keep budget charging isolated. - pub(crate) fn deserialize_uncompessed_no_validate< + pub(crate) fn deserialize_uncompressed_no_validate< const EXPECTED_SIZE: usize, T: CanonicalDeserialize, >( @@ -188,7 +188,7 @@ impl Host { ) -> Result, HostError> { let pt: Affine

= self.visit_obj(bo, |bytes: &ScBytes| { self.validate_point_encoding::(&bytes, msg)?; - self.deserialize_uncompessed_no_validate::(bytes.as_slice(), msg) + self.deserialize_uncompressed_no_validate::(bytes.as_slice(), msg) })?; if !self.check_point_is_on_curve(&pt, &ct_curve)? { return Err(self.err( @@ -394,7 +394,7 @@ impl Host { let mut buf = [0u8; EXPECTED_SIZE]; buf.copy_from_slice(bytes); buf.reverse(); - self.deserialize_uncompessed_no_validate::(&buf, msg) + self.deserialize_uncompressed_no_validate::(&buf, msg) }) } From 9af1f8890c2cd0461734fef03c269ff11e0fa367 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Tue, 17 Sep 2024 18:59:56 -0400 Subject: [PATCH 16/18] fixup! add ethereum bls signature tests --- soroban-env-host/Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/soroban-env-host/Cargo.toml b/soroban-env-host/Cargo.toml index 4b1f51ff3..3dc247a2d 100644 --- a/soroban-env-host/Cargo.toml +++ b/soroban-env-host/Cargo.toml @@ -145,6 +145,10 @@ name = "secp256r1_sig_ver" path = "tests/secp256r1_sig_ver.rs" required-features = ["testutils"] +[[test]] +name = "bls-signature" +path = "tests/bls.rs" +required-features = ["testutils"] [package.metadata.docs.rs] features = ["recording_mode", "tracy", "testutils"] From 20646da4b7c02e96903c13bc3a8582a07a89f21e Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Wed, 18 Sep 2024 14:04:52 -0400 Subject: [PATCH 17/18] consolidate comments, more cleanup into templates --- .../benches/common/cost_types/bls12_381.rs | 4 + .../22/test__bls12_381__g1_msm.json | 622 +++++++++--------- .../22/test__bls12_381__g2_msm.json | 522 ++++++++------- .../src/cost_runner/cost_types/bls12_381.rs | 26 +- soroban-env-host/src/crypto/bls12_381.rs | 282 ++++---- soroban-env-host/src/host.rs | 16 +- 6 files changed, 752 insertions(+), 720 deletions(-) diff --git a/soroban-env-host/benches/common/cost_types/bls12_381.rs b/soroban-env-host/benches/common/cost_types/bls12_381.rs index f4c07a20b..918070cad 100644 --- a/soroban-env-host/benches/common/cost_types/bls12_381.rs +++ b/soroban-env-host/benches/common/cost_types/bls12_381.rs @@ -214,6 +214,8 @@ impl HostCostMeasurement for Bls12381G1MsmMeasure { .map(|_| G1Affine::rand(rng)) .collect(), (0..input).into_iter().map(|_| Fr::rand(rng)).collect(), + Bls12381G1Msm, + "G1".to_string(), ) } } @@ -297,6 +299,8 @@ impl HostCostMeasurement for Bls12381G2MsmMeasure { .map(|_| G2Affine::rand(rng)) .collect(), (0..input).into_iter().map(|_| Fr::rand(rng)).collect(), + Bls12381G2Msm, + "G2".to_string(), ) } } diff --git a/soroban-env-host/observations/22/test__bls12_381__g1_msm.json b/soroban-env-host/observations/22/test__bls12_381__g1_msm.json index 6cf77e292..7ab97c1e9 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g1_msm.json +++ b/soroban-env-host/observations/22/test__bls12_381__g1_msm.json @@ -35,328 +35,326 @@ " 33 call bls12_381_g1_msm(Vec(obj#27), Vec(obj#35))": "", " 34 call vec_len(Vec(obj#27))": "cpu:23119", " 35 ret vec_len -> Ok(U32(3))": "cpu:23241", - " 36 call vec_len(Vec(obj#35))": "cpu:1492722, mem:2280", - " 37 ret vec_len -> Ok(U32(3))": "cpu:1492844", - " 38 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1499516, mem:2392", - " 39 call vec_new_from_slice(3)": "cpu:1501823, mem:2568, objs:-/19@42952458", - " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:1502973, mem:2672, objs:-/20@a0bd3ff", - " 41 call obj_from_u256_pieces(9030446305465662626, 6854247188031249140, 3026823929057343686, 5018424221301027056)": "", - " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:1503474, mem:2736, objs:-/21@5d27dd7c", - " 43 call obj_from_u256_pieces(17540322581155608940, 9042723259083353182, 9336846948556567215, 15266620357577816939)": "", - " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:1503975, mem:2800, objs:-/22@32305aea", - " 45 call obj_from_u256_pieces(2273584195287690476, 203274327658109228, 545101579437905274, 9593152778203258958)": "", - " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:1504476, mem:2864, objs:-/23@d5672c27", - " 47 call vec_new_from_slice(3)": "", - " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:1505626, mem:2968, objs:-/24@f299ae2e", - " 49 call bls12_381_g1_msm(Vec(obj#39), Vec(obj#47))": "", - " 50 call vec_len(Vec(obj#39))": "cpu:1505870", - " 51 ret vec_len -> Ok(U32(3))": "cpu:1505992", - " 52 call vec_len(Vec(obj#47))": "cpu:3709948, mem:3272", - " 53 ret vec_len -> Ok(U32(3))": "cpu:3710070", - " 54 ret bls12_381_g1_msm -> Ok(Bytes(obj#49))": "cpu:8497794, mem:121366, objs:-/25@e3c1a53", - " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:8500101, mem:121542, objs:-/26@f6f4e327", - " 56 ret obj_cmp -> Ok(0)": "cpu:8500401", - " 57 call bytes_new_from_slice(96)": "cpu:8501723", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:8502708, mem:121718, objs:-/27@de36fc43", - " 59 call bytes_new_from_slice(96)": "cpu:8504030", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:8505015, mem:121894, objs:-/28@d5575135", - " 61 call bytes_new_from_slice(96)": "cpu:8506337", - " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:8507322, mem:122070, objs:-/29@75b6bfd6", + " 36 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1492722, mem:2280", + " 37 call vec_new_from_slice(3)": "cpu:1495029, mem:2456, objs:-/19@42952458", + " 38 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:1496179, mem:2560, objs:-/20@a0bd3ff", + " 39 call obj_from_u256_pieces(9030446305465662626, 6854247188031249140, 3026823929057343686, 5018424221301027056)": "", + " 40 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:1496680, mem:2624, objs:-/21@5d27dd7c", + " 41 call obj_from_u256_pieces(17540322581155608940, 9042723259083353182, 9336846948556567215, 15266620357577816939)": "", + " 42 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:1497181, mem:2688, objs:-/22@32305aea", + " 43 call obj_from_u256_pieces(2273584195287690476, 203274327658109228, 545101579437905274, 9593152778203258958)": "", + " 44 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:1497682, mem:2752, objs:-/23@d5672c27", + " 45 call vec_new_from_slice(3)": "", + " 46 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:1498832, mem:2856, objs:-/24@f299ae2e", + " 47 call bls12_381_g1_msm(Vec(obj#39), Vec(obj#47))": "", + " 48 call vec_len(Vec(obj#39))": "cpu:1499076", + " 49 ret vec_len -> Ok(U32(3))": "cpu:1499198", + " 50 call vec_len(Vec(obj#47))": "cpu:3703154, mem:3160", + " 51 ret vec_len -> Ok(U32(3))": "cpu:3703276", + " 52 ret bls12_381_g1_msm -> Ok(Bytes(obj#49))": "cpu:8491000, mem:121254, objs:-/25@e3c1a53", + " 53 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:8493307, mem:121430, objs:-/26@f6f4e327", + " 54 ret obj_cmp -> Ok(0)": "cpu:8493607", + " 55 call bytes_new_from_slice(96)": "cpu:8494929", + " 56 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:8495914, mem:121606, objs:-/27@de36fc43", + " 57 call bytes_new_from_slice(96)": "cpu:8497236", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:8498221, mem:121782, objs:-/28@d5575135", + " 59 call bytes_new_from_slice(96)": "cpu:8499543", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:8500528, mem:121958, objs:-/29@75b6bfd6", + " 61 call vec_new_from_slice(3)": "", + " 62 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:8501678, mem:122062, objs:-/30@a0da8ba2", " 63 call vec_new_from_slice(3)": "", - " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:8508472, mem:122174, objs:-/30@a0da8ba2", - " 65 call vec_new_from_slice(3)": "", - " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:8509439, mem:122278, objs:-/31@3969541b", - " 67 call bls12_381_g1_msm(Vec(obj#59), Vec(obj#61))": "", - " 68 call vec_len(Vec(obj#59))": "cpu:8509683", - " 69 ret vec_len -> Ok(U32(3))": "cpu:8509805", - " 70 call vec_len(Vec(obj#61))": "cpu:10713761, mem:122582", - " 71 ret vec_len -> Ok(U32(3))": "cpu:10713883", - " 72 ret bls12_381_g1_msm -> Ok(Bytes(obj#63))": "cpu:15501424, mem:240676, objs:-/32@4cf72b63", - " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:15503731, mem:240852, objs:-/33@2b1e328c", - " 74 ret obj_cmp -> Ok(0)": "cpu:15504031", - " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:15508645, mem:241204, objs:-/35@c5e3864a", - " 76 ret obj_cmp -> Ok(-1)": "cpu:15508945", - " 77 call vec_new_from_slice(2)": "cpu:16245727, mem:241380, objs:-/36@48960b91", - " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:16246814, mem:241476, objs:-/37@9fba2a30", - " 79 call vec_new_from_slice(2)": "", - " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:16247779, mem:241572, objs:-/38@417ebf06", - " 81 call bls12_381_g1_msm(Vec(obj#73), Vec(obj#75))": "", - " 82 call vec_len(Vec(obj#73))": "cpu:16248023", - " 83 ret vec_len -> Ok(U32(2))": "cpu:16248145", - " 84 call vec_len(Vec(obj#75))": "cpu:17717614, mem:241780", - " 85 ret vec_len -> Ok(U32(2))": "cpu:17717736", - " 86 ret bls12_381_g1_msm -> Ok(Bytes(obj#77))": "cpu:21750172, mem:357071, objs:-/39@d2932e3e", - " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:21752479, mem:357247, objs:-/40@3b58e936", - " 88 ret obj_cmp -> Ok(0)": "cpu:21752779", - " 89 call obj_from_u256_pieces(2137869300824195577, 2408943964792666977, 4119820914549582912, 10689500621133072587)": "cpu:9228, mem:704, objs:-/44@bdf24bea", - " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:9729, mem:768, objs:-/45@ff9db193", - " 91 call obj_from_u256_pieces(1962485755387024656, 9106496787558144827, 9789057793268231909, 16221084701331329973)": "", - " 92 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:10230, mem:832, objs:-/46@c719630e", - " 93 call obj_from_u256_pieces(1296515190507321084, 10989324616177374759, 8226479548446315792, 5867014538613133674)": "", - " 94 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:10731, mem:896, objs:-/47@a3ded57a", - " 95 call obj_from_u256_pieces(15796377402950621781, 1952675446632466581, 13889210310322241459, 7969271833534144739)": "", - " 96 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:11232, mem:960, objs:-/48@d367c748", + " 64 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:8502645, mem:122166, objs:-/31@3969541b", + " 65 call bls12_381_g1_msm(Vec(obj#59), Vec(obj#61))": "", + " 66 call vec_len(Vec(obj#59))": "cpu:8502889", + " 67 ret vec_len -> Ok(U32(3))": "cpu:8503011", + " 68 call vec_len(Vec(obj#61))": "cpu:10706967, mem:122470", + " 69 ret vec_len -> Ok(U32(3))": "cpu:10707089", + " 70 ret bls12_381_g1_msm -> Ok(Bytes(obj#63))": "cpu:15494630, mem:240564, objs:-/32@4cf72b63", + " 71 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:15496937, mem:240740, objs:-/33@2b1e328c", + " 72 ret obj_cmp -> Ok(0)": "cpu:15497237", + " 73 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:15501851, mem:241092, objs:-/35@c5e3864a", + " 74 ret obj_cmp -> Ok(-1)": "cpu:15502151", + " 75 call vec_new_from_slice(2)": "cpu:16238933, mem:241268, objs:-/36@48960b91", + " 76 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:16240020, mem:241364, objs:-/37@9fba2a30", + " 77 call vec_new_from_slice(2)": "", + " 78 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:16240985, mem:241460, objs:-/38@417ebf06", + " 79 call bls12_381_g1_msm(Vec(obj#73), Vec(obj#75))": "", + " 80 call vec_len(Vec(obj#73))": "cpu:16241229", + " 81 ret vec_len -> Ok(U32(2))": "cpu:16241351", + " 82 call vec_len(Vec(obj#75))": "cpu:17710820, mem:241668", + " 83 ret vec_len -> Ok(U32(2))": "cpu:17710942", + " 84 ret bls12_381_g1_msm -> Ok(Bytes(obj#77))": "cpu:21743378, mem:356959, objs:-/39@d2932e3e", + " 85 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:21745685, mem:357135, objs:-/40@3b58e936", + " 86 ret obj_cmp -> Ok(0)": "cpu:21745985", + " 87 call obj_from_u256_pieces(2137869300824195577, 2408943964792666977, 4119820914549582912, 10689500621133072587)": "cpu:9228, mem:704, objs:-/44@bdf24bea", + " 88 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:9729, mem:768, objs:-/45@ff9db193", + " 89 call obj_from_u256_pieces(1962485755387024656, 9106496787558144827, 9789057793268231909, 16221084701331329973)": "", + " 90 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:10230, mem:832, objs:-/46@c719630e", + " 91 call obj_from_u256_pieces(1296515190507321084, 10989324616177374759, 8226479548446315792, 5867014538613133674)": "", + " 92 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:10731, mem:896, objs:-/47@a3ded57a", + " 93 call obj_from_u256_pieces(15796377402950621781, 1952675446632466581, 13889210310322241459, 7969271833534144739)": "", + " 94 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:11232, mem:960, objs:-/48@d367c748", + " 95 call vec_new_from_slice(4)": "", + " 96 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:12445, mem:1072, objs:-/49@4aa6caa5", " 97 call vec_new_from_slice(4)": "", - " 98 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:12445, mem:1072, objs:-/49@4aa6caa5", - " 99 call vec_new_from_slice(4)": "", - " 100 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:13658, mem:1184, objs:-/50@d6716ebc", - " 101 call bls12_381_g1_msm(Vec(obj#97), Vec(obj#99))": "", - " 102 call vec_len(Vec(obj#97))": "cpu:13902", - " 103 ret vec_len -> Ok(U32(4))": "cpu:14024", - " 104 call vec_len(Vec(obj#99))": "cpu:2952467, mem:1584", - " 105 ret vec_len -> Ok(U32(4))": "cpu:2952589", - " 106 ret bls12_381_g1_msm -> Ok(Bytes(obj#101))": "cpu:8495479, mem:122481, objs:-/51@38fc93bb", + " 98 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:13658, mem:1184, objs:-/50@d6716ebc", + " 99 call bls12_381_g1_msm(Vec(obj#97), Vec(obj#99))": "", + " 100 call vec_len(Vec(obj#97))": "cpu:13902", + " 101 ret vec_len -> Ok(U32(4))": "cpu:14024", + " 102 call vec_len(Vec(obj#99))": "cpu:2952467, mem:1584", + " 103 ret vec_len -> Ok(U32(4))": "cpu:2952589", + " 104 ret bls12_381_g1_msm -> Ok(Bytes(obj#101))": "cpu:8495479, mem:122481, objs:-/51@38fc93bb", + " 105 call vec_new_from_slice(4)": "", + " 106 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:8496692, mem:122593, objs:-/52@332932d6", " 107 call vec_new_from_slice(4)": "", - " 108 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:8496692, mem:122593, objs:-/52@332932d6", - " 109 call vec_new_from_slice(4)": "", - " 110 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:8497905, mem:122705, objs:-/53@eb9d99bf", - " 111 call bls12_381_g1_msm(Vec(obj#103), Vec(obj#105))": "", - " 112 call vec_len(Vec(obj#103))": "cpu:8498149", - " 113 ret vec_len -> Ok(U32(4))": "cpu:8498271", - " 114 call vec_len(Vec(obj#105))": "cpu:11436714, mem:123105", - " 115 ret vec_len -> Ok(U32(4))": "cpu:11436836", - " 116 ret bls12_381_g1_msm -> Ok(Bytes(obj#107))": "cpu:16979726, mem:244002, objs:-/54@f3e7e2fb", - " 117 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", - " 118 ret obj_cmp -> Ok(0)": "cpu:16980026", + " 108 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:8497905, mem:122705, objs:-/53@eb9d99bf", + " 109 call bls12_381_g1_msm(Vec(obj#103), Vec(obj#105))": "", + " 110 call vec_len(Vec(obj#103))": "cpu:8498149", + " 111 ret vec_len -> Ok(U32(4))": "cpu:8498271", + " 112 call vec_len(Vec(obj#105))": "cpu:11436714, mem:123105", + " 113 ret vec_len -> Ok(U32(4))": "cpu:11436836", + " 114 ret bls12_381_g1_msm -> Ok(Bytes(obj#107))": "cpu:16979726, mem:244002, objs:-/54@f3e7e2fb", + " 115 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", + " 116 ret obj_cmp -> Ok(0)": "cpu:16980026", + " 117 call vec_new_from_slice(4)": "", + " 118 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:16981239, mem:244114, objs:-/55@c50146aa", " 119 call vec_new_from_slice(4)": "", - " 120 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:16981239, mem:244114, objs:-/55@c50146aa", - " 121 call vec_new_from_slice(4)": "", - " 122 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:16982452, mem:244226, objs:-/56@c60df128", - " 123 call bls12_381_g1_msm(Vec(obj#109), Vec(obj#111))": "", - " 124 call vec_len(Vec(obj#109))": "cpu:16982696", - " 125 ret vec_len -> Ok(U32(4))": "cpu:16982818", - " 126 call vec_len(Vec(obj#111))": "cpu:19921261, mem:244626", - " 127 ret vec_len -> Ok(U32(4))": "cpu:19921383", - " 128 ret bls12_381_g1_msm -> Ok(Bytes(obj#113))": "cpu:25464273, mem:365523, objs:-/57@bcaec10e", - " 129 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", - " 130 ret obj_cmp -> Ok(0)": "cpu:25464573", + " 120 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:16982452, mem:244226, objs:-/56@c60df128", + " 121 call bls12_381_g1_msm(Vec(obj#109), Vec(obj#111))": "", + " 122 call vec_len(Vec(obj#109))": "cpu:16982696", + " 123 ret vec_len -> Ok(U32(4))": "cpu:16982818", + " 124 call vec_len(Vec(obj#111))": "cpu:19921261, mem:244626", + " 125 ret vec_len -> Ok(U32(4))": "cpu:19921383", + " 126 ret bls12_381_g1_msm -> Ok(Bytes(obj#113))": "cpu:25464273, mem:365523, objs:-/57@bcaec10e", + " 127 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", + " 128 ret obj_cmp -> Ok(0)": "cpu:25464573", + " 129 call vec_new_from_slice(4)": "", + " 130 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:25465786, mem:365635, objs:-/58@c312d486", " 131 call vec_new_from_slice(4)": "", - " 132 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:25465786, mem:365635, objs:-/58@c312d486", - " 133 call vec_new_from_slice(4)": "", - " 134 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:25466999, mem:365747, objs:-/59@8118160e", - " 135 call bls12_381_g1_msm(Vec(obj#115), Vec(obj#117))": "", - " 136 call vec_len(Vec(obj#115))": "cpu:25467243", - " 137 ret vec_len -> Ok(U32(4))": "cpu:25467365", - " 138 call vec_len(Vec(obj#117))": "cpu:28405808, mem:366147", - " 139 ret vec_len -> Ok(U32(4))": "cpu:28405930", - " 140 ret bls12_381_g1_msm -> Ok(Bytes(obj#119))": "cpu:33948820, mem:487044, objs:-/60@2f469956", - " 141 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", - " 142 ret obj_cmp -> Ok(0)": "cpu:33949120", + " 132 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:25466999, mem:365747, objs:-/59@8118160e", + " 133 call bls12_381_g1_msm(Vec(obj#115), Vec(obj#117))": "", + " 134 call vec_len(Vec(obj#115))": "cpu:25467243", + " 135 ret vec_len -> Ok(U32(4))": "cpu:25467365", + " 136 call vec_len(Vec(obj#117))": "cpu:28405808, mem:366147", + " 137 ret vec_len -> Ok(U32(4))": "cpu:28405930", + " 138 ret bls12_381_g1_msm -> Ok(Bytes(obj#119))": "cpu:33948820, mem:487044, objs:-/60@2f469956", + " 139 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", + " 140 ret obj_cmp -> Ok(0)": "cpu:33949120", + " 141 call vec_new_from_slice(4)": "", + " 142 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:33950333, mem:487156, objs:-/61@e3634851", " 143 call vec_new_from_slice(4)": "", - " 144 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:33950333, mem:487156, objs:-/61@e3634851", - " 145 call vec_new_from_slice(4)": "", - " 146 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:33951546, mem:487268, objs:-/62@efcd97c0", - " 147 call bls12_381_g1_msm(Vec(obj#121), Vec(obj#123))": "", - " 148 call vec_len(Vec(obj#121))": "cpu:33951790", - " 149 ret vec_len -> Ok(U32(4))": "cpu:33951912", - " 150 call vec_len(Vec(obj#123))": "cpu:36890355, mem:487668", - " 151 ret vec_len -> Ok(U32(4))": "cpu:36890477", - " 152 ret bls12_381_g1_msm -> Ok(Bytes(obj#125))": "cpu:42433367, mem:608565, objs:-/63@56df4afe", - " 153 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", - " 154 ret obj_cmp -> Ok(0)": "cpu:42433667", + " 144 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:33951546, mem:487268, objs:-/62@efcd97c0", + " 145 call bls12_381_g1_msm(Vec(obj#121), Vec(obj#123))": "", + " 146 call vec_len(Vec(obj#121))": "cpu:33951790", + " 147 ret vec_len -> Ok(U32(4))": "cpu:33951912", + " 148 call vec_len(Vec(obj#123))": "cpu:36890355, mem:487668", + " 149 ret vec_len -> Ok(U32(4))": "cpu:36890477", + " 150 ret bls12_381_g1_msm -> Ok(Bytes(obj#125))": "cpu:42433367, mem:608565, objs:-/63@56df4afe", + " 151 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", + " 152 ret obj_cmp -> Ok(0)": "cpu:42433667", + " 153 call vec_new_from_slice(4)": "", + " 154 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:42434880, mem:608677, objs:-/64@c6fa44ae", " 155 call vec_new_from_slice(4)": "", - " 156 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:42434880, mem:608677, objs:-/64@c6fa44ae", - " 157 call vec_new_from_slice(4)": "", - " 158 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:42436093, mem:608789, objs:-/65@4be879d9", - " 159 call bls12_381_g1_msm(Vec(obj#127), Vec(obj#129))": "", - " 160 call vec_len(Vec(obj#127))": "cpu:42436337", - " 161 ret vec_len -> Ok(U32(4))": "cpu:42436459", - " 162 call vec_len(Vec(obj#129))": "cpu:45374902, mem:609189", - " 163 ret vec_len -> Ok(U32(4))": "cpu:45375024", - " 164 ret bls12_381_g1_msm -> Ok(Bytes(obj#131))": "cpu:50917914, mem:730086, objs:-/66@cd9321cc", - " 165 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", - " 166 ret obj_cmp -> Ok(0)": "cpu:50918214", + " 156 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:42436093, mem:608789, objs:-/65@4be879d9", + " 157 call bls12_381_g1_msm(Vec(obj#127), Vec(obj#129))": "", + " 158 call vec_len(Vec(obj#127))": "cpu:42436337", + " 159 ret vec_len -> Ok(U32(4))": "cpu:42436459", + " 160 call vec_len(Vec(obj#129))": "cpu:45374902, mem:609189", + " 161 ret vec_len -> Ok(U32(4))": "cpu:45375024", + " 162 ret bls12_381_g1_msm -> Ok(Bytes(obj#131))": "cpu:50917914, mem:730086, objs:-/66@cd9321cc", + " 163 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", + " 164 ret obj_cmp -> Ok(0)": "cpu:50918214", + " 165 call vec_new_from_slice(4)": "", + " 166 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:50919427, mem:730198, objs:-/67@83139207", " 167 call vec_new_from_slice(4)": "", - " 168 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:50919427, mem:730198, objs:-/67@83139207", - " 169 call vec_new_from_slice(4)": "", - " 170 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:50920640, mem:730310, objs:-/68@bff98043", - " 171 call bls12_381_g1_msm(Vec(obj#133), Vec(obj#135))": "", - " 172 call vec_len(Vec(obj#133))": "cpu:50920884", - " 173 ret vec_len -> Ok(U32(4))": "cpu:50921006", - " 174 call vec_len(Vec(obj#135))": "cpu:53859449, mem:730710", - " 175 ret vec_len -> Ok(U32(4))": "cpu:53859571", - " 176 ret bls12_381_g1_msm -> Ok(Bytes(obj#137))": "cpu:59402461, mem:851607, objs:-/69@57b33ea5", - " 177 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", - " 178 ret obj_cmp -> Ok(0)": "cpu:59402761", + " 168 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:50920640, mem:730310, objs:-/68@bff98043", + " 169 call bls12_381_g1_msm(Vec(obj#133), Vec(obj#135))": "", + " 170 call vec_len(Vec(obj#133))": "cpu:50920884", + " 171 ret vec_len -> Ok(U32(4))": "cpu:50921006", + " 172 call vec_len(Vec(obj#135))": "cpu:53859449, mem:730710", + " 173 ret vec_len -> Ok(U32(4))": "cpu:53859571", + " 174 ret bls12_381_g1_msm -> Ok(Bytes(obj#137))": "cpu:59402461, mem:851607, objs:-/69@57b33ea5", + " 175 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", + " 176 ret obj_cmp -> Ok(0)": "cpu:59402761", + " 177 call vec_new_from_slice(4)": "", + " 178 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:59403974, mem:851719, objs:-/70@67ce2467", " 179 call vec_new_from_slice(4)": "", - " 180 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:59403974, mem:851719, objs:-/70@67ce2467", - " 181 call vec_new_from_slice(4)": "", - " 182 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:59405187, mem:851831, objs:-/71@1a3a91ea", - " 183 call bls12_381_g1_msm(Vec(obj#139), Vec(obj#141))": "", - " 184 call vec_len(Vec(obj#139))": "cpu:59405431", - " 185 ret vec_len -> Ok(U32(4))": "cpu:59405553", - " 186 call vec_len(Vec(obj#141))": "cpu:62343996, mem:852231", - " 187 ret vec_len -> Ok(U32(4))": "cpu:62344118", - " 188 ret bls12_381_g1_msm -> Ok(Bytes(obj#143))": "cpu:67887008, mem:973128, objs:-/72@d3eea58f", - " 189 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", - " 190 ret obj_cmp -> Ok(0)": "cpu:67887308", + " 180 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:59405187, mem:851831, objs:-/71@1a3a91ea", + " 181 call bls12_381_g1_msm(Vec(obj#139), Vec(obj#141))": "", + " 182 call vec_len(Vec(obj#139))": "cpu:59405431", + " 183 ret vec_len -> Ok(U32(4))": "cpu:59405553", + " 184 call vec_len(Vec(obj#141))": "cpu:62343996, mem:852231", + " 185 ret vec_len -> Ok(U32(4))": "cpu:62344118", + " 186 ret bls12_381_g1_msm -> Ok(Bytes(obj#143))": "cpu:67887008, mem:973128, objs:-/72@d3eea58f", + " 187 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", + " 188 ret obj_cmp -> Ok(0)": "cpu:67887308", + " 189 call vec_new_from_slice(4)": "", + " 190 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:67888521, mem:973240, objs:-/73@d260e80a", " 191 call vec_new_from_slice(4)": "", - " 192 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:67888521, mem:973240, objs:-/73@d260e80a", - " 193 call vec_new_from_slice(4)": "", - " 194 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:67889734, mem:973352, objs:-/74@fc820513", - " 195 call bls12_381_g1_msm(Vec(obj#145), Vec(obj#147))": "", - " 196 call vec_len(Vec(obj#145))": "cpu:67889978", - " 197 ret vec_len -> Ok(U32(4))": "cpu:67890100", - " 198 call vec_len(Vec(obj#147))": "cpu:70828543, mem:973752", - " 199 ret vec_len -> Ok(U32(4))": "cpu:70828665", - " 200 ret bls12_381_g1_msm -> Ok(Bytes(obj#149))": "cpu:76371555, mem:1094649, objs:-/75@14642af", - " 201 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", - " 202 ret obj_cmp -> Ok(0)": "cpu:76371855", + " 192 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:67889734, mem:973352, objs:-/74@fc820513", + " 193 call bls12_381_g1_msm(Vec(obj#145), Vec(obj#147))": "", + " 194 call vec_len(Vec(obj#145))": "cpu:67889978", + " 195 ret vec_len -> Ok(U32(4))": "cpu:67890100", + " 196 call vec_len(Vec(obj#147))": "cpu:70828543, mem:973752", + " 197 ret vec_len -> Ok(U32(4))": "cpu:70828665", + " 198 ret bls12_381_g1_msm -> Ok(Bytes(obj#149))": "cpu:76371555, mem:1094649, objs:-/75@14642af", + " 199 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", + " 200 ret obj_cmp -> Ok(0)": "cpu:76371855", + " 201 call vec_new_from_slice(4)": "", + " 202 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:76373068, mem:1094761, objs:-/76@8e00d86c", " 203 call vec_new_from_slice(4)": "", - " 204 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:76373068, mem:1094761, objs:-/76@8e00d86c", - " 205 call vec_new_from_slice(4)": "", - " 206 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:76374281, mem:1094873, objs:-/77@8e3de39e", - " 207 call bls12_381_g1_msm(Vec(obj#151), Vec(obj#153))": "", - " 208 call vec_len(Vec(obj#151))": "cpu:76374525", - " 209 ret vec_len -> Ok(U32(4))": "cpu:76374647", - " 210 call vec_len(Vec(obj#153))": "cpu:79313090, mem:1095273", - " 211 ret vec_len -> Ok(U32(4))": "cpu:79313212", - " 212 ret bls12_381_g1_msm -> Ok(Bytes(obj#155))": "cpu:84856102, mem:1216170, objs:-/78@8bf03081", - " 213 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", - " 214 ret obj_cmp -> Ok(0)": "cpu:84856402", + " 204 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:76374281, mem:1094873, objs:-/77@8e3de39e", + " 205 call bls12_381_g1_msm(Vec(obj#151), Vec(obj#153))": "", + " 206 call vec_len(Vec(obj#151))": "cpu:76374525", + " 207 ret vec_len -> Ok(U32(4))": "cpu:76374647", + " 208 call vec_len(Vec(obj#153))": "cpu:79313090, mem:1095273", + " 209 ret vec_len -> Ok(U32(4))": "cpu:79313212", + " 210 ret bls12_381_g1_msm -> Ok(Bytes(obj#155))": "cpu:84856102, mem:1216170, objs:-/78@8bf03081", + " 211 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", + " 212 ret obj_cmp -> Ok(0)": "cpu:84856402", + " 213 call vec_new_from_slice(4)": "", + " 214 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:84857615, mem:1216282, objs:-/79@df97cf2f", " 215 call vec_new_from_slice(4)": "", - " 216 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:84857615, mem:1216282, objs:-/79@df97cf2f", - " 217 call vec_new_from_slice(4)": "", - " 218 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:84858828, mem:1216394, objs:-/80@a4dbe930", - " 219 call bls12_381_g1_msm(Vec(obj#157), Vec(obj#159))": "", - " 220 call vec_len(Vec(obj#157))": "cpu:84859072", - " 221 ret vec_len -> Ok(U32(4))": "cpu:84859194", - " 222 call vec_len(Vec(obj#159))": "cpu:87797637, mem:1216794", - " 223 ret vec_len -> Ok(U32(4))": "cpu:87797759", - " 224 ret bls12_381_g1_msm -> Ok(Bytes(obj#161))": "cpu:93340649, mem:1337691, objs:-/81@9f62a7d5", - " 225 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", - " 226 ret obj_cmp -> Ok(0)": "cpu:93340949", - " 227 call bytes_new_from_slice(96)": "cpu:1322, mem:0", - " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:2307, mem:176, objs:-/82@dd48ce00", - " 229 call bytes_new_from_slice(96)": "cpu:3629", - " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:4614, mem:352, objs:-/83@2ba0a36c", - " 231 call bytes_new_from_slice(96)": "cpu:5936", - " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:6921, mem:528, objs:-/84@a00db887", - " 233 call bytes_new_from_slice(96)": "cpu:8243", - " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:9228, mem:704, objs:-/85@2ff3a0e7", - " 235 call bytes_new_from_slice(96)": "cpu:10550", - " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:11535, mem:880, objs:-/86@67a727f9", - " 237 call bytes_new_from_slice(96)": "cpu:12857", - " 238 ret bytes_new_from_slice -> Ok(Bytes(obj#173))": "cpu:13842, mem:1056, objs:-/87@928f7064", - " 239 call bytes_new_from_slice(96)": "cpu:15164", - " 240 ret bytes_new_from_slice -> Ok(Bytes(obj#175))": "cpu:16149, mem:1232, objs:-/88@8e6f6128", - " 241 call bytes_new_from_slice(96)": "cpu:17471", - " 242 ret bytes_new_from_slice -> Ok(Bytes(obj#177))": "cpu:18456, mem:1408, objs:-/89@8b355a07", - " 243 call bytes_new_from_slice(96)": "cpu:19778", - " 244 ret bytes_new_from_slice -> Ok(Bytes(obj#179))": "cpu:20763, mem:1584, objs:-/90@2bebefc3", - " 245 call bytes_new_from_slice(96)": "cpu:22085", - " 246 ret bytes_new_from_slice -> Ok(Bytes(obj#181))": "cpu:23070, mem:1760, objs:-/91@87d223bb", - " 247 call vec_new_from_slice(10)": "", - " 248 ret vec_new_from_slice -> Ok(Vec(obj#183))": "cpu:24661, mem:1920, objs:-/92@e05d7d45", - " 249 call obj_from_u256_pieces(17618770950827998744, 14662068724577735075, 2249062990298394979, 9977923089826089615)": "", - " 250 ret obj_from_u256_pieces -> Ok(U256(obj#185))": "cpu:25162, mem:1984, objs:-/93@e4abda0a", - " 251 call obj_from_u256_pieces(2821194631792961874, 16547277464900892467, 14819559542962736549, 17981056101655367365)": "", - " 252 ret obj_from_u256_pieces -> Ok(U256(obj#187))": "cpu:25663, mem:2048, objs:-/94@59894c0f", - " 253 call obj_from_u256_pieces(14823680325444367514, 16057910356200631686, 11653412393475167983, 17971148540471083046)": "", - " 254 ret obj_from_u256_pieces -> Ok(U256(obj#189))": "cpu:26164, mem:2112, objs:-/95@f611f183", - " 255 call obj_from_u256_pieces(16502273625602787483, 2713688267813643125, 15061415354752276271, 16690818686241479208)": "", - " 256 ret obj_from_u256_pieces -> Ok(U256(obj#191))": "cpu:26665, mem:2176, objs:-/96@b6efa1b5", - " 257 call obj_from_u256_pieces(7027192125185647877, 17045944964573428771, 10144290202347477085, 10705035438189734679)": "", - " 258 ret obj_from_u256_pieces -> Ok(U256(obj#193))": "cpu:27166, mem:2240, objs:-/97@f626d632", - " 259 call obj_from_u256_pieces(14552017996338670628, 17384320552016825872, 12623460464266321339, 2351693706725345962)": "", - " 260 ret obj_from_u256_pieces -> Ok(U256(obj#195))": "cpu:27667, mem:2304, objs:-/98@dc0fd6a8", - " 261 call obj_from_u256_pieces(4037855643097226315, 3588748593401323528, 18145554024939280631, 6805129555195258487)": "", - " 262 ret obj_from_u256_pieces -> Ok(U256(obj#197))": "cpu:28168, mem:2368, objs:-/99@3a43cf0d", - " 263 call obj_from_u256_pieces(10690484396013942008, 3220507769215303921, 6575779185716732641, 1735816512470570891)": "", - " 264 ret obj_from_u256_pieces -> Ok(U256(obj#199))": "cpu:28669, mem:2432, objs:-/100@72aa4d1", - " 265 call obj_from_u256_pieces(854729243539327218, 14181304886955281704, 12059208175304010597, 16702944845996181439)": "", - " 266 ret obj_from_u256_pieces -> Ok(U256(obj#201))": "cpu:29170, mem:2496, objs:-/101@898aec71", - " 267 call obj_from_u256_pieces(11497158191995684079, 43326291776979156, 14533160951240524555, 12852174102015084654)": "", - " 268 ret obj_from_u256_pieces -> Ok(U256(obj#203))": "cpu:29671, mem:2560, objs:-/102@a0762125", - " 269 call vec_new_from_slice(10)": "", - " 270 ret vec_new_from_slice -> Ok(Vec(obj#205))": "cpu:31262, mem:2720, objs:-/103@d1b8c868", - " 271 call bls12_381_g1_msm(Vec(obj#183), Vec(obj#205))": "", - " 272 call vec_len(Vec(obj#183))": "cpu:31506", - " 273 ret vec_len -> Ok(U32(10))": "cpu:31628", - " 274 call vec_len(Vec(obj#205))": "cpu:7376993, mem:3696", - " 275 ret vec_len -> Ok(U32(10))": "cpu:7377115", - " 276 ret bls12_381_g1_msm -> Ok(Bytes(obj#207))": "cpu:17451000, mem:141410, objs:-/104@5e3fb337", - " 277 call vec_get(Vec(obj#183), U32(0))": "cpu:17453307, mem:141586, objs:-/105@cc1ad99a", - " 278 ret vec_get -> Ok(Bytes(obj#163))": "cpu:17453533", - " 279 call vec_get(Vec(obj#205), U32(0))": "", - " 280 ret vec_get -> Ok(U256(obj#185))": "cpu:17453759", - " 281 call bls12_381_g1_mul(Bytes(obj#163), U256(obj#185))": "", - " 282 ret bls12_381_g1_mul -> Ok(Bytes(obj#211))": "cpu:20744406, mem:141762, objs:-/106@4d87b466", - " 283 call bls12_381_g1_add(Bytes(obj#209), Bytes(obj#211))": "", - " 284 ret bls12_381_g1_add -> Ok(Bytes(obj#213))": "cpu:20855157, mem:141938, objs:-/107@a668862", - " 285 call vec_get(Vec(obj#183), U32(1))": "", - " 286 ret vec_get -> Ok(Bytes(obj#165))": "cpu:20855383", - " 287 call vec_get(Vec(obj#205), U32(1))": "", - " 288 ret vec_get -> Ok(U256(obj#187))": "cpu:20855609", - " 289 call bls12_381_g1_mul(Bytes(obj#165), U256(obj#187))": "", - " 290 ret bls12_381_g1_mul -> Ok(Bytes(obj#215))": "cpu:24146256, mem:142114, objs:-/108@26939bdb", - " 291 call bls12_381_g1_add(Bytes(obj#213), Bytes(obj#215))": "", - " 292 ret bls12_381_g1_add -> Ok(Bytes(obj#217))": "cpu:24257007, mem:142290, objs:-/109@afa942f2", - " 293 call vec_get(Vec(obj#183), U32(2))": "", - " 294 ret vec_get -> Ok(Bytes(obj#167))": "cpu:24257233", - " 295 call vec_get(Vec(obj#205), U32(2))": "", - " 296 ret vec_get -> Ok(U256(obj#189))": "cpu:24257459", - " 297 call bls12_381_g1_mul(Bytes(obj#167), U256(obj#189))": "", - " 298 ret bls12_381_g1_mul -> Ok(Bytes(obj#219))": "cpu:27548106, mem:142466, objs:-/110@80ebabcb", - " 299 call bls12_381_g1_add(Bytes(obj#217), Bytes(obj#219))": "", - " 300 ret bls12_381_g1_add -> Ok(Bytes(obj#221))": "cpu:27658857, mem:142642, objs:-/111@c5129985", - " 301 call vec_get(Vec(obj#183), U32(3))": "", - " 302 ret vec_get -> Ok(Bytes(obj#169))": "cpu:27659083", - " 303 call vec_get(Vec(obj#205), U32(3))": "", - " 304 ret vec_get -> Ok(U256(obj#191))": "cpu:27659309", - " 305 call bls12_381_g1_mul(Bytes(obj#169), U256(obj#191))": "", - " 306 ret bls12_381_g1_mul -> Ok(Bytes(obj#223))": "cpu:30949956, mem:142818, objs:-/112@185b22ec", - " 307 call bls12_381_g1_add(Bytes(obj#221), Bytes(obj#223))": "", - " 308 ret bls12_381_g1_add -> Ok(Bytes(obj#225))": "cpu:31060707, mem:142994, objs:-/113@c4f97300", - " 309 call vec_get(Vec(obj#183), U32(4))": "", - " 310 ret vec_get -> Ok(Bytes(obj#171))": "cpu:31060933", - " 311 call vec_get(Vec(obj#205), U32(4))": "", - " 312 ret vec_get -> Ok(U256(obj#193))": "cpu:31061159", - " 313 call bls12_381_g1_mul(Bytes(obj#171), U256(obj#193))": "", - " 314 ret bls12_381_g1_mul -> Ok(Bytes(obj#227))": "cpu:34351806, mem:143170, objs:-/114@5dcb2245", - " 315 call bls12_381_g1_add(Bytes(obj#225), Bytes(obj#227))": "", - " 316 ret bls12_381_g1_add -> Ok(Bytes(obj#229))": "cpu:34462557, mem:143346, objs:-/115@9b8b7719", - " 317 call vec_get(Vec(obj#183), U32(5))": "", - " 318 ret vec_get -> Ok(Bytes(obj#173))": "cpu:34462783", - " 319 call vec_get(Vec(obj#205), U32(5))": "", - " 320 ret vec_get -> Ok(U256(obj#195))": "cpu:34463009", - " 321 call bls12_381_g1_mul(Bytes(obj#173), U256(obj#195))": "", - " 322 ret bls12_381_g1_mul -> Ok(Bytes(obj#231))": "cpu:37753656, mem:143522, objs:-/116@7e32132b", - " 323 call bls12_381_g1_add(Bytes(obj#229), Bytes(obj#231))": "", - " 324 ret bls12_381_g1_add -> Ok(Bytes(obj#233))": "cpu:37864407, mem:143698, objs:-/117@820927b5", - " 325 call vec_get(Vec(obj#183), U32(6))": "", - " 326 ret vec_get -> Ok(Bytes(obj#175))": "cpu:37864633", - " 327 call vec_get(Vec(obj#205), U32(6))": "", - " 328 ret vec_get -> Ok(U256(obj#197))": "cpu:37864859", - " 329 call bls12_381_g1_mul(Bytes(obj#175), U256(obj#197))": "", - " 330 ret bls12_381_g1_mul -> Ok(Bytes(obj#235))": "cpu:41155506, mem:143874, objs:-/118@734cedc3", - " 331 call bls12_381_g1_add(Bytes(obj#233), Bytes(obj#235))": "", - " 332 ret bls12_381_g1_add -> Ok(Bytes(obj#237))": "cpu:41266257, mem:144050, objs:-/119@9f782901", - " 333 call vec_get(Vec(obj#183), U32(7))": "", - " 334 ret vec_get -> Ok(Bytes(obj#177))": "cpu:41266483", - " 335 call vec_get(Vec(obj#205), U32(7))": "", - " 336 ret vec_get -> Ok(U256(obj#199))": "cpu:41266709", - " 337 call bls12_381_g1_mul(Bytes(obj#177), U256(obj#199))": "", - " 338 ret bls12_381_g1_mul -> Ok(Bytes(obj#239))": "cpu:44557356, mem:144226, objs:-/120@6222b65f", - " 339 call bls12_381_g1_add(Bytes(obj#237), Bytes(obj#239))": "", - " 340 ret bls12_381_g1_add -> Ok(Bytes(obj#241))": "cpu:44668107, mem:144402, objs:-/121@ec08d7b8", - " 341 call vec_get(Vec(obj#183), U32(8))": "", - " 342 ret vec_get -> Ok(Bytes(obj#179))": "cpu:44668333", - " 343 call vec_get(Vec(obj#205), U32(8))": "", - " 344 ret vec_get -> Ok(U256(obj#201))": "cpu:44668559", - " 345 call bls12_381_g1_mul(Bytes(obj#179), U256(obj#201))": "", - " 346 ret bls12_381_g1_mul -> Ok(Bytes(obj#243))": "cpu:47959206, mem:144578, objs:-/122@ed50266c", - " 347 call bls12_381_g1_add(Bytes(obj#241), Bytes(obj#243))": "", - " 348 ret bls12_381_g1_add -> Ok(Bytes(obj#245))": "cpu:48069957, mem:144754, objs:-/123@c4adee2a", - " 349 call vec_get(Vec(obj#183), U32(9))": "", - " 350 ret vec_get -> Ok(Bytes(obj#181))": "cpu:48070183", - " 351 call vec_get(Vec(obj#205), U32(9))": "", - " 352 ret vec_get -> Ok(U256(obj#203))": "cpu:48070409", - " 353 call bls12_381_g1_mul(Bytes(obj#181), U256(obj#203))": "", - " 354 ret bls12_381_g1_mul -> Ok(Bytes(obj#247))": "cpu:51361056, mem:144930, objs:-/124@e5cf2285", - " 355 call bls12_381_g1_add(Bytes(obj#245), Bytes(obj#247))": "", - " 356 ret bls12_381_g1_add -> Ok(Bytes(obj#249))": "cpu:51471807, mem:145106, objs:-/125@e28e8633", - " 357 call obj_cmp(Bytes(obj#249), Bytes(obj#207))": "", - " 358 ret obj_cmp -> Ok(0)": "cpu:51472107", - " 359 end": "cpu:51472107, mem:145106, prngs:-/-, objs:-/125@e28e8633, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 216 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:84858828, mem:1216394, objs:-/80@a4dbe930", + " 217 call bls12_381_g1_msm(Vec(obj#157), Vec(obj#159))": "", + " 218 call vec_len(Vec(obj#157))": "cpu:84859072", + " 219 ret vec_len -> Ok(U32(4))": "cpu:84859194", + " 220 call vec_len(Vec(obj#159))": "cpu:87797637, mem:1216794", + " 221 ret vec_len -> Ok(U32(4))": "cpu:87797759", + " 222 ret bls12_381_g1_msm -> Ok(Bytes(obj#161))": "cpu:93340649, mem:1337691, objs:-/81@9f62a7d5", + " 223 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", + " 224 ret obj_cmp -> Ok(0)": "cpu:93340949", + " 225 call bytes_new_from_slice(96)": "cpu:1322, mem:0", + " 226 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:2307, mem:176, objs:-/82@dd48ce00", + " 227 call bytes_new_from_slice(96)": "cpu:3629", + " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:4614, mem:352, objs:-/83@2ba0a36c", + " 229 call bytes_new_from_slice(96)": "cpu:5936", + " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:6921, mem:528, objs:-/84@a00db887", + " 231 call bytes_new_from_slice(96)": "cpu:8243", + " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:9228, mem:704, objs:-/85@2ff3a0e7", + " 233 call bytes_new_from_slice(96)": "cpu:10550", + " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:11535, mem:880, objs:-/86@67a727f9", + " 235 call bytes_new_from_slice(96)": "cpu:12857", + " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#173))": "cpu:13842, mem:1056, objs:-/87@928f7064", + " 237 call bytes_new_from_slice(96)": "cpu:15164", + " 238 ret bytes_new_from_slice -> Ok(Bytes(obj#175))": "cpu:16149, mem:1232, objs:-/88@8e6f6128", + " 239 call bytes_new_from_slice(96)": "cpu:17471", + " 240 ret bytes_new_from_slice -> Ok(Bytes(obj#177))": "cpu:18456, mem:1408, objs:-/89@8b355a07", + " 241 call bytes_new_from_slice(96)": "cpu:19778", + " 242 ret bytes_new_from_slice -> Ok(Bytes(obj#179))": "cpu:20763, mem:1584, objs:-/90@2bebefc3", + " 243 call bytes_new_from_slice(96)": "cpu:22085", + " 244 ret bytes_new_from_slice -> Ok(Bytes(obj#181))": "cpu:23070, mem:1760, objs:-/91@87d223bb", + " 245 call vec_new_from_slice(10)": "", + " 246 ret vec_new_from_slice -> Ok(Vec(obj#183))": "cpu:24661, mem:1920, objs:-/92@e05d7d45", + " 247 call obj_from_u256_pieces(17618770950827998744, 14662068724577735075, 2249062990298394979, 9977923089826089615)": "", + " 248 ret obj_from_u256_pieces -> Ok(U256(obj#185))": "cpu:25162, mem:1984, objs:-/93@e4abda0a", + " 249 call obj_from_u256_pieces(2821194631792961874, 16547277464900892467, 14819559542962736549, 17981056101655367365)": "", + " 250 ret obj_from_u256_pieces -> Ok(U256(obj#187))": "cpu:25663, mem:2048, objs:-/94@59894c0f", + " 251 call obj_from_u256_pieces(14823680325444367514, 16057910356200631686, 11653412393475167983, 17971148540471083046)": "", + " 252 ret obj_from_u256_pieces -> Ok(U256(obj#189))": "cpu:26164, mem:2112, objs:-/95@f611f183", + " 253 call obj_from_u256_pieces(16502273625602787483, 2713688267813643125, 15061415354752276271, 16690818686241479208)": "", + " 254 ret obj_from_u256_pieces -> Ok(U256(obj#191))": "cpu:26665, mem:2176, objs:-/96@b6efa1b5", + " 255 call obj_from_u256_pieces(7027192125185647877, 17045944964573428771, 10144290202347477085, 10705035438189734679)": "", + " 256 ret obj_from_u256_pieces -> Ok(U256(obj#193))": "cpu:27166, mem:2240, objs:-/97@f626d632", + " 257 call obj_from_u256_pieces(14552017996338670628, 17384320552016825872, 12623460464266321339, 2351693706725345962)": "", + " 258 ret obj_from_u256_pieces -> Ok(U256(obj#195))": "cpu:27667, mem:2304, objs:-/98@dc0fd6a8", + " 259 call obj_from_u256_pieces(4037855643097226315, 3588748593401323528, 18145554024939280631, 6805129555195258487)": "", + " 260 ret obj_from_u256_pieces -> Ok(U256(obj#197))": "cpu:28168, mem:2368, objs:-/99@3a43cf0d", + " 261 call obj_from_u256_pieces(10690484396013942008, 3220507769215303921, 6575779185716732641, 1735816512470570891)": "", + " 262 ret obj_from_u256_pieces -> Ok(U256(obj#199))": "cpu:28669, mem:2432, objs:-/100@72aa4d1", + " 263 call obj_from_u256_pieces(854729243539327218, 14181304886955281704, 12059208175304010597, 16702944845996181439)": "", + " 264 ret obj_from_u256_pieces -> Ok(U256(obj#201))": "cpu:29170, mem:2496, objs:-/101@898aec71", + " 265 call obj_from_u256_pieces(11497158191995684079, 43326291776979156, 14533160951240524555, 12852174102015084654)": "", + " 266 ret obj_from_u256_pieces -> Ok(U256(obj#203))": "cpu:29671, mem:2560, objs:-/102@a0762125", + " 267 call vec_new_from_slice(10)": "", + " 268 ret vec_new_from_slice -> Ok(Vec(obj#205))": "cpu:31262, mem:2720, objs:-/103@d1b8c868", + " 269 call bls12_381_g1_msm(Vec(obj#183), Vec(obj#205))": "", + " 270 call vec_len(Vec(obj#183))": "cpu:31506", + " 271 ret vec_len -> Ok(U32(10))": "cpu:31628", + " 272 call vec_len(Vec(obj#205))": "cpu:7376993, mem:3696", + " 273 ret vec_len -> Ok(U32(10))": "cpu:7377115", + " 274 ret bls12_381_g1_msm -> Ok(Bytes(obj#207))": "cpu:17451000, mem:141410, objs:-/104@5e3fb337", + " 275 call vec_get(Vec(obj#183), U32(0))": "cpu:17453307, mem:141586, objs:-/105@cc1ad99a", + " 276 ret vec_get -> Ok(Bytes(obj#163))": "cpu:17453533", + " 277 call vec_get(Vec(obj#205), U32(0))": "", + " 278 ret vec_get -> Ok(U256(obj#185))": "cpu:17453759", + " 279 call bls12_381_g1_mul(Bytes(obj#163), U256(obj#185))": "", + " 280 ret bls12_381_g1_mul -> Ok(Bytes(obj#211))": "cpu:20744406, mem:141762, objs:-/106@4d87b466", + " 281 call bls12_381_g1_add(Bytes(obj#209), Bytes(obj#211))": "", + " 282 ret bls12_381_g1_add -> Ok(Bytes(obj#213))": "cpu:20855157, mem:141938, objs:-/107@a668862", + " 283 call vec_get(Vec(obj#183), U32(1))": "", + " 284 ret vec_get -> Ok(Bytes(obj#165))": "cpu:20855383", + " 285 call vec_get(Vec(obj#205), U32(1))": "", + " 286 ret vec_get -> Ok(U256(obj#187))": "cpu:20855609", + " 287 call bls12_381_g1_mul(Bytes(obj#165), U256(obj#187))": "", + " 288 ret bls12_381_g1_mul -> Ok(Bytes(obj#215))": "cpu:24146256, mem:142114, objs:-/108@26939bdb", + " 289 call bls12_381_g1_add(Bytes(obj#213), Bytes(obj#215))": "", + " 290 ret bls12_381_g1_add -> Ok(Bytes(obj#217))": "cpu:24257007, mem:142290, objs:-/109@afa942f2", + " 291 call vec_get(Vec(obj#183), U32(2))": "", + " 292 ret vec_get -> Ok(Bytes(obj#167))": "cpu:24257233", + " 293 call vec_get(Vec(obj#205), U32(2))": "", + " 294 ret vec_get -> Ok(U256(obj#189))": "cpu:24257459", + " 295 call bls12_381_g1_mul(Bytes(obj#167), U256(obj#189))": "", + " 296 ret bls12_381_g1_mul -> Ok(Bytes(obj#219))": "cpu:27548106, mem:142466, objs:-/110@80ebabcb", + " 297 call bls12_381_g1_add(Bytes(obj#217), Bytes(obj#219))": "", + " 298 ret bls12_381_g1_add -> Ok(Bytes(obj#221))": "cpu:27658857, mem:142642, objs:-/111@c5129985", + " 299 call vec_get(Vec(obj#183), U32(3))": "", + " 300 ret vec_get -> Ok(Bytes(obj#169))": "cpu:27659083", + " 301 call vec_get(Vec(obj#205), U32(3))": "", + " 302 ret vec_get -> Ok(U256(obj#191))": "cpu:27659309", + " 303 call bls12_381_g1_mul(Bytes(obj#169), U256(obj#191))": "", + " 304 ret bls12_381_g1_mul -> Ok(Bytes(obj#223))": "cpu:30949956, mem:142818, objs:-/112@185b22ec", + " 305 call bls12_381_g1_add(Bytes(obj#221), Bytes(obj#223))": "", + " 306 ret bls12_381_g1_add -> Ok(Bytes(obj#225))": "cpu:31060707, mem:142994, objs:-/113@c4f97300", + " 307 call vec_get(Vec(obj#183), U32(4))": "", + " 308 ret vec_get -> Ok(Bytes(obj#171))": "cpu:31060933", + " 309 call vec_get(Vec(obj#205), U32(4))": "", + " 310 ret vec_get -> Ok(U256(obj#193))": "cpu:31061159", + " 311 call bls12_381_g1_mul(Bytes(obj#171), U256(obj#193))": "", + " 312 ret bls12_381_g1_mul -> Ok(Bytes(obj#227))": "cpu:34351806, mem:143170, objs:-/114@5dcb2245", + " 313 call bls12_381_g1_add(Bytes(obj#225), Bytes(obj#227))": "", + " 314 ret bls12_381_g1_add -> Ok(Bytes(obj#229))": "cpu:34462557, mem:143346, objs:-/115@9b8b7719", + " 315 call vec_get(Vec(obj#183), U32(5))": "", + " 316 ret vec_get -> Ok(Bytes(obj#173))": "cpu:34462783", + " 317 call vec_get(Vec(obj#205), U32(5))": "", + " 318 ret vec_get -> Ok(U256(obj#195))": "cpu:34463009", + " 319 call bls12_381_g1_mul(Bytes(obj#173), U256(obj#195))": "", + " 320 ret bls12_381_g1_mul -> Ok(Bytes(obj#231))": "cpu:37753656, mem:143522, objs:-/116@7e32132b", + " 321 call bls12_381_g1_add(Bytes(obj#229), Bytes(obj#231))": "", + " 322 ret bls12_381_g1_add -> Ok(Bytes(obj#233))": "cpu:37864407, mem:143698, objs:-/117@820927b5", + " 323 call vec_get(Vec(obj#183), U32(6))": "", + " 324 ret vec_get -> Ok(Bytes(obj#175))": "cpu:37864633", + " 325 call vec_get(Vec(obj#205), U32(6))": "", + " 326 ret vec_get -> Ok(U256(obj#197))": "cpu:37864859", + " 327 call bls12_381_g1_mul(Bytes(obj#175), U256(obj#197))": "", + " 328 ret bls12_381_g1_mul -> Ok(Bytes(obj#235))": "cpu:41155506, mem:143874, objs:-/118@734cedc3", + " 329 call bls12_381_g1_add(Bytes(obj#233), Bytes(obj#235))": "", + " 330 ret bls12_381_g1_add -> Ok(Bytes(obj#237))": "cpu:41266257, mem:144050, objs:-/119@9f782901", + " 331 call vec_get(Vec(obj#183), U32(7))": "", + " 332 ret vec_get -> Ok(Bytes(obj#177))": "cpu:41266483", + " 333 call vec_get(Vec(obj#205), U32(7))": "", + " 334 ret vec_get -> Ok(U256(obj#199))": "cpu:41266709", + " 335 call bls12_381_g1_mul(Bytes(obj#177), U256(obj#199))": "", + " 336 ret bls12_381_g1_mul -> Ok(Bytes(obj#239))": "cpu:44557356, mem:144226, objs:-/120@6222b65f", + " 337 call bls12_381_g1_add(Bytes(obj#237), Bytes(obj#239))": "", + " 338 ret bls12_381_g1_add -> Ok(Bytes(obj#241))": "cpu:44668107, mem:144402, objs:-/121@ec08d7b8", + " 339 call vec_get(Vec(obj#183), U32(8))": "", + " 340 ret vec_get -> Ok(Bytes(obj#179))": "cpu:44668333", + " 341 call vec_get(Vec(obj#205), U32(8))": "", + " 342 ret vec_get -> Ok(U256(obj#201))": "cpu:44668559", + " 343 call bls12_381_g1_mul(Bytes(obj#179), U256(obj#201))": "", + " 344 ret bls12_381_g1_mul -> Ok(Bytes(obj#243))": "cpu:47959206, mem:144578, objs:-/122@ed50266c", + " 345 call bls12_381_g1_add(Bytes(obj#241), Bytes(obj#243))": "", + " 346 ret bls12_381_g1_add -> Ok(Bytes(obj#245))": "cpu:48069957, mem:144754, objs:-/123@c4adee2a", + " 347 call vec_get(Vec(obj#183), U32(9))": "", + " 348 ret vec_get -> Ok(Bytes(obj#181))": "cpu:48070183", + " 349 call vec_get(Vec(obj#205), U32(9))": "", + " 350 ret vec_get -> Ok(U256(obj#203))": "cpu:48070409", + " 351 call bls12_381_g1_mul(Bytes(obj#181), U256(obj#203))": "", + " 352 ret bls12_381_g1_mul -> Ok(Bytes(obj#247))": "cpu:51361056, mem:144930, objs:-/124@e5cf2285", + " 353 call bls12_381_g1_add(Bytes(obj#245), Bytes(obj#247))": "", + " 354 ret bls12_381_g1_add -> Ok(Bytes(obj#249))": "cpu:51471807, mem:145106, objs:-/125@e28e8633", + " 355 call obj_cmp(Bytes(obj#249), Bytes(obj#207))": "", + " 356 ret obj_cmp -> Ok(0)": "cpu:51472107", + " 357 end": "cpu:51472107, mem:145106, prngs:-/-, objs:-/125@e28e8633, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g2_msm.json b/soroban-env-host/observations/22/test__bls12_381__g2_msm.json index 7a8c4af56..2d22c8642 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g2_msm.json +++ b/soroban-env-host/observations/22/test__bls12_381__g2_msm.json @@ -35,268 +35,266 @@ " 33 call bls12_381_g2_msm(Vec(obj#27), Vec(obj#35))": "", " 34 call vec_len(Vec(obj#27))": "cpu:31195", " 35 ret vec_len -> Ok(U32(3))": "cpu:31317", - " 36 call vec_len(Vec(obj#35))": "cpu:2167372, mem:3144", - " 37 ret vec_len -> Ok(U32(3))": "cpu:2167494", - " 38 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:2174166, mem:3256", - " 39 call vec_new_from_slice(3)": "cpu:2177819, mem:3528, objs:-/19@fc4eae83", - " 40 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:2178969, mem:3632, objs:-/20@fc5a7848", - " 41 call obj_from_u256_pieces(10885390432521285204, 10089357480003724487, 11017657889674374380, 349979284301977343)": "", - " 42 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:2179470, mem:3696, objs:-/21@c11c1e9", - " 43 call obj_from_u256_pieces(15502034860521929120, 5197508503879521041, 10172360046471299633, 18026852881196000031)": "", - " 44 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:2179971, mem:3760, objs:-/22@fbed0030", - " 45 call obj_from_u256_pieces(7434520258580032483, 1508470301556677986, 6272863840242768080, 12830499169355232182)": "", - " 46 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:2180472, mem:3824, objs:-/23@7c759a0d", - " 47 call vec_new_from_slice(3)": "", - " 48 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:2181622, mem:3928, objs:-/24@892a5924", - " 49 call bls12_381_g2_msm(Vec(obj#39), Vec(obj#47))": "", - " 50 call vec_len(Vec(obj#39))": "cpu:2181866", - " 51 ret vec_len -> Ok(U32(3))": "cpu:2181988", - " 52 call vec_len(Vec(obj#47))": "cpu:5385787, mem:4520", - " 53 ret vec_len -> Ok(U32(3))": "cpu:5385909", - " 54 ret bls12_381_g2_msm -> Ok(Bytes(obj#49))": "cpu:20790833, mem:232870, objs:-/25@b3e2fb94", - " 55 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:20794486, mem:233142, objs:-/26@36256f36", - " 56 ret obj_cmp -> Ok(0)": "cpu:20794798", - " 57 call bytes_new_from_slice(192)": "cpu:20797442", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:20798451, mem:233414, objs:-/27@8ed979ac", - " 59 call bytes_new_from_slice(192)": "cpu:20801095", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:20802104, mem:233686, objs:-/28@a3eb6aea", - " 61 call bytes_new_from_slice(192)": "cpu:20804748", - " 62 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:20805757, mem:233958, objs:-/29@9bc29a7f", + " 36 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:2167372, mem:3144", + " 37 call vec_new_from_slice(3)": "cpu:2171025, mem:3416, objs:-/19@fc4eae83", + " 38 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:2172175, mem:3520, objs:-/20@fc5a7848", + " 39 call obj_from_u256_pieces(10885390432521285204, 10089357480003724487, 11017657889674374380, 349979284301977343)": "", + " 40 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:2172676, mem:3584, objs:-/21@c11c1e9", + " 41 call obj_from_u256_pieces(15502034860521929120, 5197508503879521041, 10172360046471299633, 18026852881196000031)": "", + " 42 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:2173177, mem:3648, objs:-/22@fbed0030", + " 43 call obj_from_u256_pieces(7434520258580032483, 1508470301556677986, 6272863840242768080, 12830499169355232182)": "", + " 44 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:2173678, mem:3712, objs:-/23@7c759a0d", + " 45 call vec_new_from_slice(3)": "", + " 46 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:2174828, mem:3816, objs:-/24@892a5924", + " 47 call bls12_381_g2_msm(Vec(obj#39), Vec(obj#47))": "", + " 48 call vec_len(Vec(obj#39))": "cpu:2175072", + " 49 ret vec_len -> Ok(U32(3))": "cpu:2175194", + " 50 call vec_len(Vec(obj#47))": "cpu:5378993, mem:4408", + " 51 ret vec_len -> Ok(U32(3))": "cpu:5379115", + " 52 ret bls12_381_g2_msm -> Ok(Bytes(obj#49))": "cpu:20784039, mem:232758, objs:-/25@b3e2fb94", + " 53 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:20787692, mem:233030, objs:-/26@36256f36", + " 54 ret obj_cmp -> Ok(0)": "cpu:20788004", + " 55 call bytes_new_from_slice(192)": "cpu:20790648", + " 56 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:20791657, mem:233302, objs:-/27@8ed979ac", + " 57 call bytes_new_from_slice(192)": "cpu:20794301", + " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:20795310, mem:233574, objs:-/28@a3eb6aea", + " 59 call bytes_new_from_slice(192)": "cpu:20797954", + " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:20798963, mem:233846, objs:-/29@9bc29a7f", + " 61 call vec_new_from_slice(3)": "", + " 62 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:20800113, mem:233950, objs:-/30@379dffd4", " 63 call vec_new_from_slice(3)": "", - " 64 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:20806907, mem:234062, objs:-/30@379dffd4", - " 65 call vec_new_from_slice(3)": "", - " 66 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:20807874, mem:234166, objs:-/31@f3d911e6", - " 67 call bls12_381_g2_msm(Vec(obj#59), Vec(obj#61))": "", - " 68 call vec_len(Vec(obj#59))": "cpu:20808118", - " 69 ret vec_len -> Ok(U32(3))": "cpu:20808240", - " 70 call vec_len(Vec(obj#61))": "cpu:24012039, mem:234758", - " 71 ret vec_len -> Ok(U32(3))": "cpu:24012161", - " 72 ret bls12_381_g2_msm -> Ok(Bytes(obj#63))": "cpu:39416902, mem:463108, objs:-/32@99e86db8", - " 73 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:39420555, mem:463380, objs:-/33@d5a55acc", - " 74 ret obj_cmp -> Ok(0)": "cpu:39420867", - " 75 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:39428173, mem:463924, objs:-/35@52d12591", - " 76 ret obj_cmp -> Ok(-1)": "cpu:39428485", - " 77 call vec_new_from_slice(2)": "cpu:40499882, mem:464196, objs:-/36@f4b12971", - " 78 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:40500969, mem:464292, objs:-/37@43b753fc", - " 79 call vec_new_from_slice(2)": "", - " 80 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:40501934, mem:464388, objs:-/38@d88a608d", - " 81 call bls12_381_g2_msm(Vec(obj#73), Vec(obj#75))": "", - " 82 call vec_len(Vec(obj#73))": "cpu:40502178", - " 83 ret vec_len -> Ok(U32(2))": "cpu:40502300", - " 84 call vec_len(Vec(obj#75))": "cpu:42638331, mem:464788", - " 85 ret vec_len -> Ok(U32(2))": "cpu:42638453", - " 86 ret bls12_381_g2_msm -> Ok(Bytes(obj#77))": "cpu:55621920, mem:690335, objs:-/39@308f505c", - " 87 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:55625573, mem:690607, objs:-/40@9dfbcd24", - " 88 ret obj_cmp -> Ok(0)": "cpu:55625885", - " 89 call obj_from_u256_pieces(576349249354864704, 6205532040440579369, 13730557568579417905, 2677733454007168321)": "cpu:55640497, mem:691695, objs:-/44@cd73d980", - " 90 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:55640998, mem:691759, objs:-/45@d173b8e8", - " 91 call obj_from_u256_pieces(15107729625736847273, 3736362233123338213, 1310693883286457402, 15587527586950209119)": "", - " 92 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:55641499, mem:691823, objs:-/46@8a8ce1f3", - " 93 call obj_from_u256_pieces(7130333837602304766, 15809650852848135414, 16809337653702689547, 14300891233011973695)": "", - " 94 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:55642000, mem:691887, objs:-/47@eacff4b8", - " 95 call obj_from_u256_pieces(5531006726045309341, 889630097820975985, 16583573122393188327, 9061467097759417586)": "", - " 96 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:55642501, mem:691951, objs:-/48@42874a94", + " 64 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:20801080, mem:234054, objs:-/31@f3d911e6", + " 65 call bls12_381_g2_msm(Vec(obj#59), Vec(obj#61))": "", + " 66 call vec_len(Vec(obj#59))": "cpu:20801324", + " 67 ret vec_len -> Ok(U32(3))": "cpu:20801446", + " 68 call vec_len(Vec(obj#61))": "cpu:24005245, mem:234646", + " 69 ret vec_len -> Ok(U32(3))": "cpu:24005367", + " 70 ret bls12_381_g2_msm -> Ok(Bytes(obj#63))": "cpu:39410108, mem:462996, objs:-/32@99e86db8", + " 71 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:39413761, mem:463268, objs:-/33@d5a55acc", + " 72 ret obj_cmp -> Ok(0)": "cpu:39414073", + " 73 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:39421379, mem:463812, objs:-/35@52d12591", + " 74 ret obj_cmp -> Ok(-1)": "cpu:39421691", + " 75 call vec_new_from_slice(2)": "cpu:40493088, mem:464084, objs:-/36@f4b12971", + " 76 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:40494175, mem:464180, objs:-/37@43b753fc", + " 77 call vec_new_from_slice(2)": "", + " 78 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:40495140, mem:464276, objs:-/38@d88a608d", + " 79 call bls12_381_g2_msm(Vec(obj#73), Vec(obj#75))": "", + " 80 call vec_len(Vec(obj#73))": "cpu:40495384", + " 81 ret vec_len -> Ok(U32(2))": "cpu:40495506", + " 82 call vec_len(Vec(obj#75))": "cpu:42631537, mem:464676", + " 83 ret vec_len -> Ok(U32(2))": "cpu:42631659", + " 84 ret bls12_381_g2_msm -> Ok(Bytes(obj#77))": "cpu:55615126, mem:690223, objs:-/39@308f505c", + " 85 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:55618779, mem:690495, objs:-/40@9dfbcd24", + " 86 ret obj_cmp -> Ok(0)": "cpu:55619091", + " 87 call obj_from_u256_pieces(576349249354864704, 6205532040440579369, 13730557568579417905, 2677733454007168321)": "cpu:55633703, mem:691583, objs:-/44@cd73d980", + " 88 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:55634204, mem:691647, objs:-/45@d173b8e8", + " 89 call obj_from_u256_pieces(15107729625736847273, 3736362233123338213, 1310693883286457402, 15587527586950209119)": "", + " 90 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:55634705, mem:691711, objs:-/46@8a8ce1f3", + " 91 call obj_from_u256_pieces(7130333837602304766, 15809650852848135414, 16809337653702689547, 14300891233011973695)": "", + " 92 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:55635206, mem:691775, objs:-/47@eacff4b8", + " 93 call obj_from_u256_pieces(5531006726045309341, 889630097820975985, 16583573122393188327, 9061467097759417586)": "", + " 94 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:55635707, mem:691839, objs:-/48@42874a94", + " 95 call vec_new_from_slice(4)": "", + " 96 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:55636920, mem:691951, objs:-/49@239aaa14", " 97 call vec_new_from_slice(4)": "", - " 98 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:55643714, mem:692063, objs:-/49@239aaa14", - " 99 call vec_new_from_slice(4)": "", - " 100 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:55644927, mem:692175, objs:-/50@60ff6572", - " 101 call bls12_381_g2_msm(Vec(obj#97), Vec(obj#99))": "", - " 102 call vec_len(Vec(obj#97))": "cpu:55645171", - " 103 ret vec_len -> Ok(U32(4))": "cpu:55645293", - " 104 call vec_len(Vec(obj#99))": "cpu:59916860, mem:692959", - " 105 ret vec_len -> Ok(U32(4))": "cpu:59916982", - " 106 ret bls12_381_g2_msm -> Ok(Bytes(obj#101))": "cpu:77743241, mem:924112, objs:-/51@6bf9c3f3", - " 107 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 108 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:1213, mem:112, objs:-/52@c42f87dd", - " 109 call vec_new_from_slice(4)": "", - " 110 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:2426, mem:224, objs:-/53@6a9d8396", - " 111 call bls12_381_g2_msm(Vec(obj#103), Vec(obj#105))": "", - " 112 call vec_len(Vec(obj#103))": "cpu:2670", - " 113 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 114 call vec_len(Vec(obj#105))": "cpu:4274359, mem:1008", - " 115 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 116 ret bls12_381_g2_msm -> Ok(Bytes(obj#107))": "cpu:22100740, mem:232161, objs:-/54@3472db57", - " 117 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", - " 118 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 119 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 120 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:1213, mem:112, objs:-/55@472ba905", - " 121 call vec_new_from_slice(4)": "", - " 122 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:2426, mem:224, objs:-/56@e84328b6", - " 123 call bls12_381_g2_msm(Vec(obj#109), Vec(obj#111))": "", - " 124 call vec_len(Vec(obj#109))": "cpu:2670", - " 125 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 126 call vec_len(Vec(obj#111))": "cpu:4274359, mem:1008", - " 127 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 128 ret bls12_381_g2_msm -> Ok(Bytes(obj#113))": "cpu:22100740, mem:232161, objs:-/57@5cd90966", - " 129 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", - " 130 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 131 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 132 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:1213, mem:112, objs:-/58@5477447f", - " 133 call vec_new_from_slice(4)": "", - " 134 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:2426, mem:224, objs:-/59@42339f28", - " 135 call bls12_381_g2_msm(Vec(obj#115), Vec(obj#117))": "", - " 136 call vec_len(Vec(obj#115))": "cpu:2670", - " 137 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 138 call vec_len(Vec(obj#117))": "cpu:4274359, mem:1008", - " 139 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 140 ret bls12_381_g2_msm -> Ok(Bytes(obj#119))": "cpu:22100740, mem:232161, objs:-/60@142a3f6", - " 141 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", - " 142 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 143 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 144 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:1213, mem:112, objs:-/61@f554fdda", - " 145 call vec_new_from_slice(4)": "", - " 146 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:2426, mem:224, objs:-/62@392d78a5", - " 147 call bls12_381_g2_msm(Vec(obj#121), Vec(obj#123))": "", - " 148 call vec_len(Vec(obj#121))": "cpu:2670", - " 149 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 150 call vec_len(Vec(obj#123))": "cpu:4274359, mem:1008", - " 151 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 152 ret bls12_381_g2_msm -> Ok(Bytes(obj#125))": "cpu:22100740, mem:232161, objs:-/63@a37c7b18", - " 153 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", - " 154 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 155 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 156 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:1213, mem:112, objs:-/64@d830e19", - " 157 call vec_new_from_slice(4)": "", - " 158 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:2426, mem:224, objs:-/65@de9f2d72", - " 159 call bls12_381_g2_msm(Vec(obj#127), Vec(obj#129))": "", - " 160 call vec_len(Vec(obj#127))": "cpu:2670", - " 161 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 162 call vec_len(Vec(obj#129))": "cpu:4274359, mem:1008", - " 163 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 164 ret bls12_381_g2_msm -> Ok(Bytes(obj#131))": "cpu:22100740, mem:232161, objs:-/66@12bd397c", - " 165 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", - " 166 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 167 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 168 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:1213, mem:112, objs:-/67@9fc98ec8", - " 169 call vec_new_from_slice(4)": "", - " 170 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:2426, mem:224, objs:-/68@2e15d9f1", - " 171 call bls12_381_g2_msm(Vec(obj#133), Vec(obj#135))": "", - " 172 call vec_len(Vec(obj#133))": "cpu:2670", - " 173 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 174 call vec_len(Vec(obj#135))": "cpu:4274359, mem:1008", - " 175 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 176 ret bls12_381_g2_msm -> Ok(Bytes(obj#137))": "cpu:22100740, mem:232161, objs:-/69@516fe495", - " 177 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", - " 178 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 179 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 180 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:1213, mem:112, objs:-/70@745e9418", - " 181 call vec_new_from_slice(4)": "", - " 182 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:2426, mem:224, objs:-/71@db69de4c", - " 183 call bls12_381_g2_msm(Vec(obj#139), Vec(obj#141))": "", - " 184 call vec_len(Vec(obj#139))": "cpu:2670", - " 185 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 186 call vec_len(Vec(obj#141))": "cpu:4274359, mem:1008", - " 187 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 188 ret bls12_381_g2_msm -> Ok(Bytes(obj#143))": "cpu:22100740, mem:232161, objs:-/72@8a46f90c", - " 189 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", - " 190 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 191 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 192 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:1213, mem:112, objs:-/73@1e08429e", - " 193 call vec_new_from_slice(4)": "", - " 194 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:2426, mem:224, objs:-/74@b5ef3ee0", - " 195 call bls12_381_g2_msm(Vec(obj#145), Vec(obj#147))": "", - " 196 call vec_len(Vec(obj#145))": "cpu:2670", - " 197 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 198 call vec_len(Vec(obj#147))": "cpu:4274359, mem:1008", - " 199 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 200 ret bls12_381_g2_msm -> Ok(Bytes(obj#149))": "cpu:22100740, mem:232161, objs:-/75@5ece035c", - " 201 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", - " 202 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 203 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 204 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:1213, mem:112, objs:-/76@f42c812e", - " 205 call vec_new_from_slice(4)": "", - " 206 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:2426, mem:224, objs:-/77@a0486908", - " 207 call bls12_381_g2_msm(Vec(obj#151), Vec(obj#153))": "", - " 208 call vec_len(Vec(obj#151))": "cpu:2670", - " 209 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 210 call vec_len(Vec(obj#153))": "cpu:4274359, mem:1008", - " 211 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 212 ret bls12_381_g2_msm -> Ok(Bytes(obj#155))": "cpu:22100740, mem:232161, objs:-/78@de21d2fc", - " 213 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", - " 214 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 215 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 216 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:1213, mem:112, objs:-/79@4620805c", - " 217 call vec_new_from_slice(4)": "", - " 218 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:2426, mem:224, objs:-/80@89a4898d", - " 219 call bls12_381_g2_msm(Vec(obj#157), Vec(obj#159))": "", - " 220 call vec_len(Vec(obj#157))": "cpu:2670", - " 221 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 222 call vec_len(Vec(obj#159))": "cpu:4274359, mem:1008", - " 223 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 224 ret bls12_381_g2_msm -> Ok(Bytes(obj#161))": "cpu:22100740, mem:232161, objs:-/81@151aaaa4", - " 225 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", - " 226 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 227 call bytes_new_from_slice(192)": "cpu:2644, mem:0", - " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:3653, mem:272, objs:-/82@526b5995", - " 229 call bytes_new_from_slice(192)": "cpu:6297", - " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:7306, mem:544, objs:-/83@6efe8bf2", - " 231 call bytes_new_from_slice(192)": "cpu:9950", - " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:10959, mem:816, objs:-/84@d65370d1", - " 233 call bytes_new_from_slice(192)": "cpu:13603", - " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:14612, mem:1088, objs:-/85@768353f3", - " 235 call bytes_new_from_slice(192)": "cpu:17256", - " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:18265, mem:1360, objs:-/86@d38309a4", - " 237 call vec_new_from_slice(5)": "", - " 238 ret vec_new_from_slice -> Ok(Vec(obj#173))": "cpu:19541, mem:1480, objs:-/87@3939bbac", - " 239 call obj_from_u256_pieces(17073613341124213686, 9800153404225276109, 6607116724722439497, 842746758976683084)": "", - " 240 ret obj_from_u256_pieces -> Ok(U256(obj#175))": "cpu:20042, mem:1544, objs:-/88@a1c554a1", - " 241 call obj_from_u256_pieces(16040841695964229797, 5061605267848115623, 14000740750614834722, 13904863006945675968)": "", - " 242 ret obj_from_u256_pieces -> Ok(U256(obj#177))": "cpu:20543, mem:1608, objs:-/89@5dbca5f2", - " 243 call obj_from_u256_pieces(5830218664442262694, 4114147737062195718, 16434537214804972826, 1396935906550304884)": "", - " 244 ret obj_from_u256_pieces -> Ok(U256(obj#179))": "cpu:21044, mem:1672, objs:-/90@329f03eb", - " 245 call obj_from_u256_pieces(8756542147870587062, 2334579494105318157, 3880849428716171604, 577514052903835922)": "", - " 246 ret obj_from_u256_pieces -> Ok(U256(obj#181))": "cpu:21545, mem:1736, objs:-/91@8451f38d", - " 247 call obj_from_u256_pieces(5259919734814292314, 1486637374753912723, 9060486243487422013, 18066450239200677051)": "", - " 248 ret obj_from_u256_pieces -> Ok(U256(obj#183))": "cpu:22046, mem:1800, objs:-/92@c5a670c", - " 249 call vec_new_from_slice(5)": "", - " 250 ret vec_new_from_slice -> Ok(Vec(obj#185))": "cpu:23322, mem:1920, objs:-/93@80ddd82c", - " 251 call bls12_381_g2_msm(Vec(obj#173), Vec(obj#185))": "", - " 252 call vec_len(Vec(obj#173))": "cpu:23566", - " 253 ret vec_len -> Ok(U32(5))": "cpu:23688", - " 254 call vec_len(Vec(obj#185))": "cpu:5363023, mem:2896", - " 255 ret vec_len -> Ok(U32(5))": "cpu:5363145", - " 256 ret bls12_381_g2_msm -> Ok(Bytes(obj#187))": "cpu:25610739, mem:236852, objs:-/94@37bd5b7d", - " 257 call vec_get(Vec(obj#173), U32(0))": "cpu:25614392, mem:237124, objs:-/95@47f3520c", - " 258 ret vec_get -> Ok(Bytes(obj#163))": "cpu:25614618", - " 259 call vec_get(Vec(obj#185), U32(0))": "", - " 260 ret vec_get -> Ok(U256(obj#175))": "cpu:25614844", - " 261 call bls12_381_g2_mul(Bytes(obj#163), U256(obj#175))": "", - " 262 ret bls12_381_g2_mul -> Ok(Bytes(obj#191))": "cpu:34662440, mem:237396, objs:-/96@8cc676a4", - " 263 call bls12_381_g2_add(Bytes(obj#189), Bytes(obj#191))": "", - " 264 ret bls12_381_g2_add -> Ok(Bytes(obj#193))": "cpu:34812069, mem:237668, objs:-/97@fd5accef", - " 265 call vec_get(Vec(obj#173), U32(1))": "", - " 266 ret vec_get -> Ok(Bytes(obj#165))": "cpu:34812295", - " 267 call vec_get(Vec(obj#185), U32(1))": "", - " 268 ret vec_get -> Ok(U256(obj#177))": "cpu:34812521", - " 269 call bls12_381_g2_mul(Bytes(obj#165), U256(obj#177))": "", - " 270 ret bls12_381_g2_mul -> Ok(Bytes(obj#195))": "cpu:43860117, mem:237940, objs:-/98@287ee088", - " 271 call bls12_381_g2_add(Bytes(obj#193), Bytes(obj#195))": "", - " 272 ret bls12_381_g2_add -> Ok(Bytes(obj#197))": "cpu:44009746, mem:238212, objs:-/99@85bfd7f9", - " 273 call vec_get(Vec(obj#173), U32(2))": "", - " 274 ret vec_get -> Ok(Bytes(obj#167))": "cpu:44009972", - " 275 call vec_get(Vec(obj#185), U32(2))": "", - " 276 ret vec_get -> Ok(U256(obj#179))": "cpu:44010198", - " 277 call bls12_381_g2_mul(Bytes(obj#167), U256(obj#179))": "", - " 278 ret bls12_381_g2_mul -> Ok(Bytes(obj#199))": "cpu:53057794, mem:238484, objs:-/100@83eb557e", - " 279 call bls12_381_g2_add(Bytes(obj#197), Bytes(obj#199))": "", - " 280 ret bls12_381_g2_add -> Ok(Bytes(obj#201))": "cpu:53207423, mem:238756, objs:-/101@356eda48", - " 281 call vec_get(Vec(obj#173), U32(3))": "", - " 282 ret vec_get -> Ok(Bytes(obj#169))": "cpu:53207649", - " 283 call vec_get(Vec(obj#185), U32(3))": "", - " 284 ret vec_get -> Ok(U256(obj#181))": "cpu:53207875", - " 285 call bls12_381_g2_mul(Bytes(obj#169), U256(obj#181))": "", - " 286 ret bls12_381_g2_mul -> Ok(Bytes(obj#203))": "cpu:62255471, mem:239028, objs:-/102@633754c7", - " 287 call bls12_381_g2_add(Bytes(obj#201), Bytes(obj#203))": "", - " 288 ret bls12_381_g2_add -> Ok(Bytes(obj#205))": "cpu:62405100, mem:239300, objs:-/103@d51e3c43", - " 289 call vec_get(Vec(obj#173), U32(4))": "", - " 290 ret vec_get -> Ok(Bytes(obj#171))": "cpu:62405326", - " 291 call vec_get(Vec(obj#185), U32(4))": "", - " 292 ret vec_get -> Ok(U256(obj#183))": "cpu:62405552", - " 293 call bls12_381_g2_mul(Bytes(obj#171), U256(obj#183))": "", - " 294 ret bls12_381_g2_mul -> Ok(Bytes(obj#207))": "cpu:71453148, mem:239572, objs:-/104@e5da1eed", - " 295 call bls12_381_g2_add(Bytes(obj#205), Bytes(obj#207))": "", - " 296 ret bls12_381_g2_add -> Ok(Bytes(obj#209))": "cpu:71602777, mem:239844, objs:-/105@395f149e", - " 297 call obj_cmp(Bytes(obj#209), Bytes(obj#187))": "", - " 298 ret obj_cmp -> Ok(0)": "cpu:71603089", - " 299 end": "cpu:71603089, mem:239844, prngs:-/-, objs:-/105@395f149e, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 98 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:55638133, mem:692063, objs:-/50@60ff6572", + " 99 call bls12_381_g2_msm(Vec(obj#97), Vec(obj#99))": "", + " 100 call vec_len(Vec(obj#97))": "cpu:55638377", + " 101 ret vec_len -> Ok(U32(4))": "cpu:55638499", + " 102 call vec_len(Vec(obj#99))": "cpu:59910066, mem:692847", + " 103 ret vec_len -> Ok(U32(4))": "cpu:59910188", + " 104 ret bls12_381_g2_msm -> Ok(Bytes(obj#101))": "cpu:77736447, mem:924000, objs:-/51@6bf9c3f3", + " 105 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 106 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:1213, mem:112, objs:-/52@c42f87dd", + " 107 call vec_new_from_slice(4)": "", + " 108 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:2426, mem:224, objs:-/53@6a9d8396", + " 109 call bls12_381_g2_msm(Vec(obj#103), Vec(obj#105))": "", + " 110 call vec_len(Vec(obj#103))": "cpu:2670", + " 111 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 112 call vec_len(Vec(obj#105))": "cpu:4274359, mem:1008", + " 113 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 114 ret bls12_381_g2_msm -> Ok(Bytes(obj#107))": "cpu:22100740, mem:232161, objs:-/54@3472db57", + " 115 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", + " 116 ret obj_cmp -> Ok(0)": "cpu:22101052", + " 117 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 118 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:1213, mem:112, objs:-/55@472ba905", + " 119 call vec_new_from_slice(4)": "", + " 120 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:2426, mem:224, objs:-/56@e84328b6", + " 121 call bls12_381_g2_msm(Vec(obj#109), Vec(obj#111))": "", + " 122 call vec_len(Vec(obj#109))": "cpu:2670", + " 123 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 124 call vec_len(Vec(obj#111))": "cpu:4274359, mem:1008", + " 125 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 126 ret bls12_381_g2_msm -> Ok(Bytes(obj#113))": "cpu:22100740, mem:232161, objs:-/57@5cd90966", + " 127 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", + " 128 ret obj_cmp -> Ok(0)": "cpu:22101052", + " 129 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 130 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:1213, mem:112, objs:-/58@5477447f", + " 131 call vec_new_from_slice(4)": "", + " 132 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:2426, mem:224, objs:-/59@42339f28", + " 133 call bls12_381_g2_msm(Vec(obj#115), Vec(obj#117))": "", + " 134 call vec_len(Vec(obj#115))": "cpu:2670", + " 135 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 136 call vec_len(Vec(obj#117))": "cpu:4274359, mem:1008", + " 137 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 138 ret bls12_381_g2_msm -> Ok(Bytes(obj#119))": "cpu:22100740, mem:232161, objs:-/60@142a3f6", + " 139 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", + " 140 ret obj_cmp -> Ok(0)": "cpu:22101052", + " 141 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 142 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:1213, mem:112, objs:-/61@f554fdda", + " 143 call vec_new_from_slice(4)": "", + " 144 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:2426, mem:224, objs:-/62@392d78a5", + " 145 call bls12_381_g2_msm(Vec(obj#121), Vec(obj#123))": "", + " 146 call vec_len(Vec(obj#121))": "cpu:2670", + " 147 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 148 call vec_len(Vec(obj#123))": "cpu:4274359, mem:1008", + " 149 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 150 ret bls12_381_g2_msm -> Ok(Bytes(obj#125))": "cpu:22100740, mem:232161, objs:-/63@a37c7b18", + " 151 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", + " 152 ret obj_cmp -> Ok(0)": "cpu:22101052", + " 153 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 154 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:1213, mem:112, objs:-/64@d830e19", + " 155 call vec_new_from_slice(4)": "", + " 156 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:2426, mem:224, objs:-/65@de9f2d72", + " 157 call bls12_381_g2_msm(Vec(obj#127), Vec(obj#129))": "", + " 158 call vec_len(Vec(obj#127))": "cpu:2670", + " 159 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 160 call vec_len(Vec(obj#129))": "cpu:4274359, mem:1008", + " 161 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 162 ret bls12_381_g2_msm -> Ok(Bytes(obj#131))": "cpu:22100740, mem:232161, objs:-/66@12bd397c", + " 163 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", + " 164 ret obj_cmp -> Ok(0)": "cpu:22101052", + " 165 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 166 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:1213, mem:112, objs:-/67@9fc98ec8", + " 167 call vec_new_from_slice(4)": "", + " 168 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:2426, mem:224, objs:-/68@2e15d9f1", + " 169 call bls12_381_g2_msm(Vec(obj#133), Vec(obj#135))": "", + " 170 call vec_len(Vec(obj#133))": "cpu:2670", + " 171 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 172 call vec_len(Vec(obj#135))": "cpu:4274359, mem:1008", + " 173 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 174 ret bls12_381_g2_msm -> Ok(Bytes(obj#137))": "cpu:22100740, mem:232161, objs:-/69@516fe495", + " 175 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", + " 176 ret obj_cmp -> Ok(0)": "cpu:22101052", + " 177 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 178 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:1213, mem:112, objs:-/70@745e9418", + " 179 call vec_new_from_slice(4)": "", + " 180 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:2426, mem:224, objs:-/71@db69de4c", + " 181 call bls12_381_g2_msm(Vec(obj#139), Vec(obj#141))": "", + " 182 call vec_len(Vec(obj#139))": "cpu:2670", + " 183 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 184 call vec_len(Vec(obj#141))": "cpu:4274359, mem:1008", + " 185 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 186 ret bls12_381_g2_msm -> Ok(Bytes(obj#143))": "cpu:22100740, mem:232161, objs:-/72@8a46f90c", + " 187 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", + " 188 ret obj_cmp -> Ok(0)": "cpu:22101052", + " 189 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 190 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:1213, mem:112, objs:-/73@1e08429e", + " 191 call vec_new_from_slice(4)": "", + " 192 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:2426, mem:224, objs:-/74@b5ef3ee0", + " 193 call bls12_381_g2_msm(Vec(obj#145), Vec(obj#147))": "", + " 194 call vec_len(Vec(obj#145))": "cpu:2670", + " 195 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 196 call vec_len(Vec(obj#147))": "cpu:4274359, mem:1008", + " 197 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 198 ret bls12_381_g2_msm -> Ok(Bytes(obj#149))": "cpu:22100740, mem:232161, objs:-/75@5ece035c", + " 199 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", + " 200 ret obj_cmp -> Ok(0)": "cpu:22101052", + " 201 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 202 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:1213, mem:112, objs:-/76@f42c812e", + " 203 call vec_new_from_slice(4)": "", + " 204 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:2426, mem:224, objs:-/77@a0486908", + " 205 call bls12_381_g2_msm(Vec(obj#151), Vec(obj#153))": "", + " 206 call vec_len(Vec(obj#151))": "cpu:2670", + " 207 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 208 call vec_len(Vec(obj#153))": "cpu:4274359, mem:1008", + " 209 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 210 ret bls12_381_g2_msm -> Ok(Bytes(obj#155))": "cpu:22100740, mem:232161, objs:-/78@de21d2fc", + " 211 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", + " 212 ret obj_cmp -> Ok(0)": "cpu:22101052", + " 213 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 214 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:1213, mem:112, objs:-/79@4620805c", + " 215 call vec_new_from_slice(4)": "", + " 216 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:2426, mem:224, objs:-/80@89a4898d", + " 217 call bls12_381_g2_msm(Vec(obj#157), Vec(obj#159))": "", + " 218 call vec_len(Vec(obj#157))": "cpu:2670", + " 219 ret vec_len -> Ok(U32(4))": "cpu:2792", + " 220 call vec_len(Vec(obj#159))": "cpu:4274359, mem:1008", + " 221 ret vec_len -> Ok(U32(4))": "cpu:4274481", + " 222 ret bls12_381_g2_msm -> Ok(Bytes(obj#161))": "cpu:22100740, mem:232161, objs:-/81@151aaaa4", + " 223 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", + " 224 ret obj_cmp -> Ok(0)": "cpu:22101052", + " 225 call bytes_new_from_slice(192)": "cpu:2644, mem:0", + " 226 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:3653, mem:272, objs:-/82@526b5995", + " 227 call bytes_new_from_slice(192)": "cpu:6297", + " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:7306, mem:544, objs:-/83@6efe8bf2", + " 229 call bytes_new_from_slice(192)": "cpu:9950", + " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:10959, mem:816, objs:-/84@d65370d1", + " 231 call bytes_new_from_slice(192)": "cpu:13603", + " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:14612, mem:1088, objs:-/85@768353f3", + " 233 call bytes_new_from_slice(192)": "cpu:17256", + " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:18265, mem:1360, objs:-/86@d38309a4", + " 235 call vec_new_from_slice(5)": "", + " 236 ret vec_new_from_slice -> Ok(Vec(obj#173))": "cpu:19541, mem:1480, objs:-/87@3939bbac", + " 237 call obj_from_u256_pieces(17073613341124213686, 9800153404225276109, 6607116724722439497, 842746758976683084)": "", + " 238 ret obj_from_u256_pieces -> Ok(U256(obj#175))": "cpu:20042, mem:1544, objs:-/88@a1c554a1", + " 239 call obj_from_u256_pieces(16040841695964229797, 5061605267848115623, 14000740750614834722, 13904863006945675968)": "", + " 240 ret obj_from_u256_pieces -> Ok(U256(obj#177))": "cpu:20543, mem:1608, objs:-/89@5dbca5f2", + " 241 call obj_from_u256_pieces(5830218664442262694, 4114147737062195718, 16434537214804972826, 1396935906550304884)": "", + " 242 ret obj_from_u256_pieces -> Ok(U256(obj#179))": "cpu:21044, mem:1672, objs:-/90@329f03eb", + " 243 call obj_from_u256_pieces(8756542147870587062, 2334579494105318157, 3880849428716171604, 577514052903835922)": "", + " 244 ret obj_from_u256_pieces -> Ok(U256(obj#181))": "cpu:21545, mem:1736, objs:-/91@8451f38d", + " 245 call obj_from_u256_pieces(5259919734814292314, 1486637374753912723, 9060486243487422013, 18066450239200677051)": "", + " 246 ret obj_from_u256_pieces -> Ok(U256(obj#183))": "cpu:22046, mem:1800, objs:-/92@c5a670c", + " 247 call vec_new_from_slice(5)": "", + " 248 ret vec_new_from_slice -> Ok(Vec(obj#185))": "cpu:23322, mem:1920, objs:-/93@80ddd82c", + " 249 call bls12_381_g2_msm(Vec(obj#173), Vec(obj#185))": "", + " 250 call vec_len(Vec(obj#173))": "cpu:23566", + " 251 ret vec_len -> Ok(U32(5))": "cpu:23688", + " 252 call vec_len(Vec(obj#185))": "cpu:5363023, mem:2896", + " 253 ret vec_len -> Ok(U32(5))": "cpu:5363145", + " 254 ret bls12_381_g2_msm -> Ok(Bytes(obj#187))": "cpu:25610739, mem:236852, objs:-/94@37bd5b7d", + " 255 call vec_get(Vec(obj#173), U32(0))": "cpu:25614392, mem:237124, objs:-/95@47f3520c", + " 256 ret vec_get -> Ok(Bytes(obj#163))": "cpu:25614618", + " 257 call vec_get(Vec(obj#185), U32(0))": "", + " 258 ret vec_get -> Ok(U256(obj#175))": "cpu:25614844", + " 259 call bls12_381_g2_mul(Bytes(obj#163), U256(obj#175))": "", + " 260 ret bls12_381_g2_mul -> Ok(Bytes(obj#191))": "cpu:34662440, mem:237396, objs:-/96@8cc676a4", + " 261 call bls12_381_g2_add(Bytes(obj#189), Bytes(obj#191))": "", + " 262 ret bls12_381_g2_add -> Ok(Bytes(obj#193))": "cpu:34812069, mem:237668, objs:-/97@fd5accef", + " 263 call vec_get(Vec(obj#173), U32(1))": "", + " 264 ret vec_get -> Ok(Bytes(obj#165))": "cpu:34812295", + " 265 call vec_get(Vec(obj#185), U32(1))": "", + " 266 ret vec_get -> Ok(U256(obj#177))": "cpu:34812521", + " 267 call bls12_381_g2_mul(Bytes(obj#165), U256(obj#177))": "", + " 268 ret bls12_381_g2_mul -> Ok(Bytes(obj#195))": "cpu:43860117, mem:237940, objs:-/98@287ee088", + " 269 call bls12_381_g2_add(Bytes(obj#193), Bytes(obj#195))": "", + " 270 ret bls12_381_g2_add -> Ok(Bytes(obj#197))": "cpu:44009746, mem:238212, objs:-/99@85bfd7f9", + " 271 call vec_get(Vec(obj#173), U32(2))": "", + " 272 ret vec_get -> Ok(Bytes(obj#167))": "cpu:44009972", + " 273 call vec_get(Vec(obj#185), U32(2))": "", + " 274 ret vec_get -> Ok(U256(obj#179))": "cpu:44010198", + " 275 call bls12_381_g2_mul(Bytes(obj#167), U256(obj#179))": "", + " 276 ret bls12_381_g2_mul -> Ok(Bytes(obj#199))": "cpu:53057794, mem:238484, objs:-/100@83eb557e", + " 277 call bls12_381_g2_add(Bytes(obj#197), Bytes(obj#199))": "", + " 278 ret bls12_381_g2_add -> Ok(Bytes(obj#201))": "cpu:53207423, mem:238756, objs:-/101@356eda48", + " 279 call vec_get(Vec(obj#173), U32(3))": "", + " 280 ret vec_get -> Ok(Bytes(obj#169))": "cpu:53207649", + " 281 call vec_get(Vec(obj#185), U32(3))": "", + " 282 ret vec_get -> Ok(U256(obj#181))": "cpu:53207875", + " 283 call bls12_381_g2_mul(Bytes(obj#169), U256(obj#181))": "", + " 284 ret bls12_381_g2_mul -> Ok(Bytes(obj#203))": "cpu:62255471, mem:239028, objs:-/102@633754c7", + " 285 call bls12_381_g2_add(Bytes(obj#201), Bytes(obj#203))": "", + " 286 ret bls12_381_g2_add -> Ok(Bytes(obj#205))": "cpu:62405100, mem:239300, objs:-/103@d51e3c43", + " 287 call vec_get(Vec(obj#173), U32(4))": "", + " 288 ret vec_get -> Ok(Bytes(obj#171))": "cpu:62405326", + " 289 call vec_get(Vec(obj#185), U32(4))": "", + " 290 ret vec_get -> Ok(U256(obj#183))": "cpu:62405552", + " 291 call bls12_381_g2_mul(Bytes(obj#171), U256(obj#183))": "", + " 292 ret bls12_381_g2_mul -> Ok(Bytes(obj#207))": "cpu:71453148, mem:239572, objs:-/104@e5da1eed", + " 293 call bls12_381_g2_add(Bytes(obj#205), Bytes(obj#207))": "", + " 294 ret bls12_381_g2_add -> Ok(Bytes(obj#209))": "cpu:71602777, mem:239844, objs:-/105@395f149e", + " 295 call obj_cmp(Bytes(obj#209), Bytes(obj#187))": "", + " 296 ret obj_cmp -> Ok(0)": "cpu:71603089", + " 297 end": "cpu:71603089, mem:239844, prngs:-/-, objs:-/105@395f149e, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs index 865aa9046..c39aab7b4 100644 --- a/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs +++ b/soroban-env-host/src/cost_runner/cost_types/bls12_381.rs @@ -52,7 +52,12 @@ pub struct Bls12381G1AddSample(pub G1Affine, pub G1Affine); #[derive(Clone)] pub struct Bls12381G1MulSample(pub G1Affine, pub Fr); #[derive(Clone)] -pub struct Bls12381G1MsmSample(pub Vec, pub Vec); +pub struct Bls12381G1MsmSample( + pub Vec, + pub Vec, + pub ContractCostType, + pub String, +); #[derive(Clone)] pub struct Bls12381MapFpToG1Sample(pub Fq, pub ContractCostType); #[derive(Clone)] @@ -64,7 +69,12 @@ pub struct Bls12381G2AddSample(pub G2Affine, pub G2Affine); #[derive(Clone)] pub struct Bls12381G2MulSample(pub G2Affine, pub Fr); #[derive(Clone)] -pub struct Bls12381G2MsmSample(pub Vec, pub Vec); +pub struct Bls12381G2MsmSample( + pub Vec, + pub Vec, + pub ContractCostType, + pub String, +); #[derive(Clone)] pub struct Bls12381MapFp2ToG2Sample(pub Fq2, pub ContractCostType); #[derive(Clone)] @@ -206,21 +216,25 @@ impl_lin_cost_runner_for_bls_deref_sample!( impl_lin_cost_runner_for_bls_deref_sample!( Bls12381G1MsmRun, Bls12381G1Msm, - g1_msm_internal, + msm_internal, Bls12381G1MsmSample, G1Projective, vp, - vs + vs, + ty, + tag ); impl_lin_cost_runner_for_bls_deref_sample!( Bls12381G2MsmRun, Bls12381G2Msm, - g2_msm_internal, + msm_internal, Bls12381G2MsmSample, G2Projective, vp, - vs + vs, + ty, + tag ); type InternalPairingOutput = PairingOutput; diff --git a/soroban-env-host/src/crypto/bls12_381.rs b/soroban-env-host/src/crypto/bls12_381.rs index 68fab8af2..8b1c862fe 100644 --- a/soroban-env-host/src/crypto/bls12_381.rs +++ b/soroban-env-host/src/crypto/bls12_381.rs @@ -2,8 +2,8 @@ use crate::{ budget::AsBudget, host_object::HostVec, xdr::{ContractCostType, ScBytes, ScErrorCode, ScErrorType}, - Bool, BytesObject, ConversionError, Env, Error, Host, HostError, TryFromVal, U256Object, - U256Small, U256Val, Val, VecObject, U256, + Bool, BytesObject, ConversionError, Env, Host, HostError, TryFromVal, U256Object, U256Small, + U256Val, Val, VecObject, U256, }; use ark_bls12_381::{ g1::Config as G1Config, g2::Config as G2Config, Bls12_381, Fq, Fq12, Fq2, Fr, G1Affine, @@ -18,7 +18,7 @@ use ark_ec::{ pairing::{Pairing, PairingOutput}, scalar_mul::variable_base::VariableBaseMSM, short_weierstrass::{Affine, Projective, SWCurveConfig}, - AffineRepr, CurveGroup, + AffineRepr, CurveConfig, CurveGroup, }; use ark_ff::{field_hashers::DefaultFieldHasher, BigInteger, Field, PrimeField}; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Compress, Validate}; @@ -51,13 +51,13 @@ impl Host { >( &self, slice: &[u8], - msg: &str, + tag: &str, ) -> Result { if EXPECTED_SIZE == 0 || slice.len() != EXPECTED_SIZE { return Err(self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, - format!("bls12-381 {msg}: invalid input length to deserialize").as_str(), + format!("bls12-381 {tag}: invalid input length to deserialize").as_str(), &[ Val::from_u32(slice.len() as u32).into(), Val::from_u32(EXPECTED_SIZE as u32).into(), @@ -75,7 +75,7 @@ impl Host { self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, - format!("bls12-381: unable to deserialize {msg}").as_str(), + format!("bls12-381: unable to deserialize {tag}").as_str(), &[], ) }) @@ -91,13 +91,13 @@ impl Host { &self, element: &T, buf: &mut [u8], - msg: &str, + tag: &str, ) -> Result<(), HostError> { if EXPECTED_SIZE == 0 || buf.len() != EXPECTED_SIZE { return Err(self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, - format!("bls12-381 {msg}: invalid buffer length to serialize into").as_str(), + format!("bls12-381 {tag}: invalid buffer length to serialize into").as_str(), &[ Val::from_u32(buf.len() as u32).into(), Val::from_u32(EXPECTED_SIZE as u32).into(), @@ -113,7 +113,7 @@ impl Host { self.err( ScErrorType::Crypto, ScErrorCode::InternalError, - format!("bls12-381: unable to serialize {msg}").as_str(), + format!("bls12-381: unable to serialize {tag}").as_str(), &[], ) })?; @@ -123,14 +123,14 @@ impl Host { fn validate_point_encoding( &self, bytes: &[u8], - msg: &str, + tag: &str, ) -> Result<(), HostError> { // validate input bytes length if EXPECTED_SIZE == 0 || bytes.len() != EXPECTED_SIZE { return Err(self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, - format!("bls12-381 {msg}: invalid input length to deserialize").as_str(), + format!("bls12-381 {tag}: invalid input length to deserialize").as_str(), &[ Val::from_u32(bytes.len() as u32).into(), Val::from_u32(EXPECTED_SIZE as u32).into(), @@ -148,13 +148,13 @@ impl Host { // infinite bit is set, check all other bits are zero let is_valid = bytes[0] == 0b0100_0000 && bytes[1..].iter().all(|x| x.is_zero()); if !is_valid { - Err(self.err(ScErrorType::Crypto, ScErrorCode::InvalidInput, format!("bls12-381 {msg} deserialize: infinity flag (bit 1) is set while remaining bits are not all zero").as_str(), &[])) + Err(self.err(ScErrorType::Crypto, ScErrorCode::InvalidInput, format!("bls12-381 {tag} deserialize: infinity flag (bit 1) is set while remaining bits are not all zero").as_str(), &[])) } else { Ok(()) } }, 0b0000_0000 => Ok(()), // infinite bit is unset - _ => Err(self.err(ScErrorType::Crypto, ScErrorCode::InvalidInput, format!("bls12-381 {msg} deserialize: either compression flag (bit 0) or the sort flag (bit 2) is set, while the input should be encoded uncompressed").as_str(), &[])) + _ => Err(self.err(ScErrorType::Crypto, ScErrorCode::InvalidInput, format!("bls12-381 {tag} deserialize: either compression flag (bit 0) or the sort flag (bit 2) is set, while the input should be encoded uncompressed").as_str(), &[])) } } @@ -184,17 +184,39 @@ impl Host { ct_curve: ContractCostType, subgroup_check: bool, ct_subgroup: ContractCostType, - msg: &str, + tag: &str, ) -> Result, HostError> { let pt: Affine

= self.visit_obj(bo, |bytes: &ScBytes| { - self.validate_point_encoding::(&bytes, msg)?; - self.deserialize_uncompressed_no_validate::(bytes.as_slice(), msg) + self.validate_point_encoding::(&bytes, tag)?; + // `CanonicalDeserialize` of `Affine

` calls into + // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::{g1,g2}::Config`, the + // core logic is in `arc_bls12_381::curves::util::read_{g1,g2}_uncompressed`. + // + // The `arc_bls12_381` lib already expects the input to be serialized in + // big-endian order (aligning with the common standard and contrary + // to ark::serialize's convention), + // + // i.e. `input = be_bytes(X) || be_bytes(Y)` and the + // most-significant three bits of X are flags: + // + // `bits(Affine) = [compression_flag, infinity_flag, sort_flag, ..remaining X_bits.., ..Y_bits..]` + // + // For `G1Affine`, each coordinate is an `Fp` that is 48 bytes. + // + // For `G2Affine`, each coordinate is an `Fp2` which contains two `Fp`, + // i.e. `(c1: Fp, c0: Fp)` see `field_element_deserialize` for more details. + // + // Internally when deserializing `Fp`, the flag bits are masked off + // to get `X: Fp`. The Y however, does not have the top bits masked off + // so it is possible for Y to exceed 381 bits. Internally `Fp` deserialization + // makes sure any value >= prime modulus results in an error. + self.deserialize_uncompressed_no_validate::(bytes.as_slice(), tag) })?; if !self.check_point_is_on_curve(&pt, &ct_curve)? { return Err(self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, - format!("bls12-381 {}: point not on curve", msg).as_str(), + format!("bls12-381 {}: point not on curve", tag).as_str(), &[], )); } @@ -202,7 +224,7 @@ impl Host { return Err(self.err( ScErrorType::Crypto, ScErrorCode::InvalidInput, - format!("bls12-381 {}: point not in the correct subgroup", msg).as_str(), + format!("bls12-381 {}: point not in the correct subgroup", tag).as_str(), &[], )); } @@ -214,23 +236,6 @@ impl Host { bo: BytesObject, subgroup_check: bool, ) -> Result { - // `CanonicalDeserialize` of `Affine

` calls into - // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::g1::Config`, the - // core logic is in `arc_bls12_381::curves::util::read_g1_uncompressed`. - // - // The `arc_bls12_381` lib already expects the input to be serialized in - // big-endian order (aligning with the common standard and contrary - // to ark::serialize's convention), - // - // i.e. `input = be_bytes(X) || be_bytes(Y)` and the - // most-significant three bits of X are flags: - // - // `bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` - // - // internally when deserializing `Fp`, the flag bits are masked off - // to get `X: Fp`. The Y however, does not have the top bits masked off - // so it is possible for Y to exceed 381 bits. Internally Fp deserialization - // makes sure any value >= prime modulus results in an error. self.affine_deserialize::( bo, ContractCostType::Bls12381G1CheckPointOnCurve, @@ -245,23 +250,6 @@ impl Host { bo: BytesObject, subgroup_check: bool, ) -> Result { - // `CanonicalDeserialize` of `Affine

` calls into - // `P::deserialize_with_mode`, where `P` is `arc_bls12_381::g2::Config`, the - // core logic is in `arc_bls12_381::curves::util::read_g2_uncompressed`. - // - // The `arc_bls12_381` lib already expects the input to be serialized in - // big-endian order (aligning with the common standard and contrary - // to ark::serialize's convention), - // - // i.e. `input = be_bytes(X) || be_bytes(Y)` and the - // most-significant three bits of X are flags: - // - // `bits(X) = [compression_flag, infinity_flag, sort_flag, bit_3, .. bit_383]` - // - // internally when deserializing `Fp`, the flag bits are masked off - // to get `X: Fp`. The Y however, does not have the top bits masked off - // so it is possible for Y to exceed 381 bits. Internally Fp deserialization - // makes sure any value >= prime modulus results in an error. self.affine_deserialize::( bo, ContractCostType::Bls12381G2CheckPointOnCurve, @@ -372,7 +360,7 @@ impl Host { pub(crate) fn field_element_deserialize( &self, bo: BytesObject, - msg: &str, + tag: &str, ) -> Result { self.visit_obj(bo, |bytes: &ScBytes| { if bytes.len() != EXPECTED_SIZE { @@ -381,7 +369,7 @@ impl Host { ScErrorCode::InvalidInput, format!( "bls12-381 field element {}: invalid input length to deserialize", - msg + tag ) .as_str(), &[ @@ -394,56 +382,40 @@ impl Host { let mut buf = [0u8; EXPECTED_SIZE]; buf.copy_from_slice(bytes); buf.reverse(); - self.deserialize_uncompressed_no_validate::(&buf, msg) + + // The field element here an either be a Fp (base field + // element) or QuadExtField

(quadratic extension) + // + // - `CanonicalDeserialize for Fp` assumes input bytes in + // little-endian order, with the highest (right-most) bits being + // empty flags. This is reverse of our rule, which assumes + // big-endian order with the highest (left-most) bits for flags. + // + // - `CanonicalDeserialize for QuadExtField

` reads the first + // chunk, deserialize it into `Fp` as `c0`. Then repeat for `c1`. The + // deserialization for `Fp` follows same rules as above, where the + // bytes are expected in little-endian, with the highest bits being + // empty flags. There is no check involved. This is entirely + // reversed from our input format: `be_bytes(c1) || be_bytes(c0)` from + // [standard](https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) + // + // In either case, we just need to reverse the input bytes before + // passing them in. There is no other check for `Fp` besides the + // length check, internally it makes sure `Fp` is valid integer + // modulo `q` (the prime modulus) + self.deserialize_uncompressed_no_validate::(&buf, tag) }) } pub(crate) fn fp_deserialize_from_bytesobj(&self, bo: BytesObject) -> Result { - // `CanonicalDeserialize for Fp` assumes input bytes in - // little-endian order, with the highest bits being empty flags. - // thus we must first reverse the bytes before passing them in. - // there is no other check for Fp besides the length check. self.field_element_deserialize::(bo, "Fp") } pub(crate) fn fp2_deserialize_from_bytesobj(&self, bo: BytesObject) -> Result { - // `CanonicalDeserialize for QuadExtField

` reads the first chunk, - // deserialize it into `Fp` as c0. Then repeat for c1. The - // deserialization for `Fp` follows same rules as above, where the - // bytes are expected in little-endian, with the highest bits being - // empty flags. There is no check involved. - // - // This is entirely reversed from the [standard](https://github.com/zcash/librustzcash/blob/6e0364cd42a2b3d2b958a54771ef51a8db79dd29/pairing/src/bls12_381/README.md#serialization) - // we have adopted. This is the input format we provide: - // - // `input = be_bytes(c1) || be_bytes(c0)` - // - // So we just need to reverse our input. self.field_element_deserialize::(bo, "Fp2") } - pub(crate) fn g1_vec_from_vecobj(&self, vp: VecObject) -> Result, HostError> { - let len: u32 = self.vec_len(vp)?.into(); - let mut points: Vec = vec![]; - self.charge_budget( - ContractCostType::MemAlloc, - Some(len as u64 * G1_SERIALIZED_SIZE as u64), - )?; - points.reserve(len as usize); - let _ = self.visit_obj(vp, |vp: &HostVec| { - for p in vp.iter() { - let pp = self.g1_affine_deserialize_from_bytesobj( - BytesObject::try_from_val(self, p)?, - true, - )?; - points.push(pp); - } - Ok(()) - }); - Ok(points) - } - - pub(crate) fn scalar_vec_from_vecobj(&self, vs: VecObject) -> Result, HostError> { + pub(crate) fn fr_vec_from_vecobj(&self, vs: VecObject) -> Result, HostError> { let len: u32 = self.vec_len(vs)?.into(); let mut scalars: Vec = vec![]; self.charge_budget( @@ -457,7 +429,7 @@ impl Host { scalars.push(ss); } Ok(()) - }); + })?; Ok(scalars) } @@ -479,44 +451,62 @@ impl Host { Ok(p0.mul(scalar)) } - pub(crate) fn g1_msm_internal( + pub(crate) fn affine_vec_from_vecobj( &self, - points: &[G1Affine], - scalars: &[Fr], - ) -> Result { - // this check should've been done outside, here is just extra caution - if points.len() != scalars.len() || points.len() == 0 { - return Err( - Error::from_type_and_code(ScErrorType::Crypto, ScErrorCode::InvalidInput).into(), - ); - } - // The actual logic happens inside msm_bigint_wnaf (ark_ec/variable_base/mod.rs) - // under branch negation is cheap. - // the unchecked version just skips the length equal check - self.charge_budget(ContractCostType::Bls12381G1Msm, Some(points.len() as u64))?; - Ok(G1Projective::msm_unchecked(points, scalars)) - } - - pub(crate) fn g2_vec_from_vecobj(&self, vp: VecObject) -> Result, HostError> { + vp: VecObject, + ct_curve: ContractCostType, + subgroup_check: bool, + ct_subgroup: ContractCostType, + tag: &str, + ) -> Result>, HostError> { let len: u32 = self.vec_len(vp)?.into(); self.charge_budget( ContractCostType::MemAlloc, - Some(len as u64 * G2_SERIALIZED_SIZE as u64), + Some(len as u64 * EXPECTED_SIZE as u64), )?; - let mut points: Vec = Vec::with_capacity(len as usize); + let mut points: Vec> = Vec::with_capacity(len as usize); let _ = self.visit_obj(vp, |vp: &HostVec| { for p in vp.iter() { - let pp = self.g2_affine_deserialize_from_bytesobj( + let pp = self.affine_deserialize::( BytesObject::try_from_val(self, p)?, - true, + ct_curve, + subgroup_check, + ct_subgroup, + tag, )?; points.push(pp); } Ok(()) - }); + })?; Ok(points) } + pub(crate) fn checked_g1_vec_from_vecobj( + &self, + vp: VecObject, + ) -> Result, HostError> { + self.affine_vec_from_vecobj::( + vp, + ContractCostType::Bls12381G1CheckPointOnCurve, + true, + ContractCostType::Bls12381G1CheckPointInSubgroup, + "G1", + ) + } + + pub(crate) fn checked_g2_vec_from_vecobj( + &self, + vp: VecObject, + ) -> Result, HostError> { + self.affine_vec_from_vecobj::( + vp, + ContractCostType::Bls12381G2CheckPointOnCurve, + true, + ContractCostType::Bls12381G2CheckPointInSubgroup, + "G2", + ) + } + pub(crate) fn g2_add_internal( &self, p0: G2Affine, @@ -535,22 +525,31 @@ impl Host { Ok(p0.mul(scalar)) } - pub(crate) fn g2_msm_internal( + pub(crate) fn msm_internal( &self, - points: &[G2Affine], - scalars: &[Fr], - ) -> Result { - // this check should've been done outside, here is just extra caution + points: &[Affine

], + scalars: &[

::ScalarField], + ty: &ContractCostType, + tag: &str, + ) -> Result, HostError> { + self.charge_budget(*ty, Some(points.len() as u64))?; if points.len() != scalars.len() || points.len() == 0 { - return Err( - Error::from_type_and_code(ScErrorType::Crypto, ScErrorCode::InvalidInput).into(), - ); + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!( + "{tag} msm: invalid input vector lengths ({}, {})", + points.len(), + scalars.len() + ) + .as_str(), + &[], + )); } // The actual logic happens inside msm_bigint_wnaf (ark_ec/variable_base/mod.rs) // under branch negation is cheap. // the unchecked version just skips the length equal check - self.charge_budget(ContractCostType::Bls12381G2Msm, Some(points.len() as u64))?; - Ok(G2Projective::msm_unchecked(points, scalars)) + Ok(Projective::

::msm_unchecked(points, scalars)) } pub(crate) fn map_to_curve( @@ -616,6 +615,17 @@ impl Host { ty: &ContractCostType, ) -> Result, HostError> { self.charge_budget(*ty, Some(msg.len() as u64))?; + // check dst requirements + let dst_len = domain.len(); + if dst_len == 0 || dst_len > 255 { + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!("hash_to_curve: invalid input dst length {dst_len}, must be > 0 and < 256") + .as_str(), + &[], + )); + } // The `new` function here constructs a DefaultFieldHasher and a WBMap. // - The DefaultFieldHasher::new() function creates an ExpanderXmd with @@ -678,13 +688,21 @@ impl Host { vp1: &Vec, vp2: &Vec, ) -> Result, HostError> { - // this check should've been done outside, here is just extra caution + self.charge_budget(ContractCostType::Bls12381Pairing, Some(vp1.len() as u64))?; + // check length requirements if vp1.len() != vp2.len() || vp1.len() == 0 { - return Err( - Error::from_type_and_code(ScErrorType::Crypto, ScErrorCode::InvalidInput).into(), - ); + return Err(self.err( + ScErrorType::Crypto, + ScErrorCode::InvalidInput, + format!( + "pairing: invalid input vector lengths ({}, {})", + vp1.len(), + vp2.len() + ) + .as_str(), + &[], + )); } - self.charge_budget(ContractCostType::Bls12381Pairing, Some(vp1.len() as u64))?; // This calls into `Bls12::multi_miller_loop`, which just calls // `ark_ec::models::bls12::Bls12Config::multi_miller_loop` with specific diff --git a/soroban-env-host/src/host.rs b/soroban-env-host/src/host.rs index e508c4ca0..16d93eb6e 100644 --- a/soroban-env-host/src/host.rs +++ b/soroban-env-host/src/host.rs @@ -2966,9 +2966,9 @@ impl VmCallerEnv for Host { &[p_len.to_val(), s_len.to_val()], )); } - let points = self.g1_vec_from_vecobj(vp)?; - let scalars = self.scalar_vec_from_vecobj(vs)?; - let res = self.g1_msm_internal(&points, &scalars)?; + let points = self.checked_g1_vec_from_vecobj(vp)?; + let scalars = self.fr_vec_from_vecobj(vs)?; + let res = self.msm_internal(&points, &scalars, &ContractCostType::Bls12381G1Msm, "G1")?; self.g1_projective_serialize_uncompressed(res) } @@ -3062,9 +3062,9 @@ impl VmCallerEnv for Host { &[p_len.to_val(), s_len.to_val()], )); } - let points = self.g2_vec_from_vecobj(vp)?; - let scalars = self.scalar_vec_from_vecobj(vs)?; - let res = self.g2_msm_internal(&points, &scalars)?; + let points = self.checked_g2_vec_from_vecobj(vp)?; + let scalars = self.fr_vec_from_vecobj(vs)?; + let res = self.msm_internal(&points, &scalars, &ContractCostType::Bls12381G2Msm, "G2")?; self.g2_projective_serialize_uncompressed(res) } @@ -3124,8 +3124,8 @@ impl VmCallerEnv for Host { &[], )); } - let vp1 = self.g1_vec_from_vecobj(vp1)?; - let vp2 = self.g2_vec_from_vecobj(vp2)?; + let vp1 = self.checked_g1_vec_from_vecobj(vp1)?; + let vp2 = self.checked_g2_vec_from_vecobj(vp2)?; let output = self.pairing_internal(&vp1, &vp2)?; self.check_pairing_output(&output) } From a4be80fbd203f6a5758a3453e896d582bc2980c8 Mon Sep 17 00:00:00 2001 From: Jay Geng Date: Wed, 18 Sep 2024 17:19:12 -0400 Subject: [PATCH 18/18] remove length check at higher level --- .../22/test__bls12_381__g1_msm.json | 710 +++++++++--------- .../22/test__bls12_381__g2_msm.json | 592 ++++++++------- .../22/test__bls12_381__hash_to_g1.json | 52 +- .../22/test__bls12_381__hash_to_g2.json | 52 +- soroban-env-host/src/host.rs | 48 +- soroban-env-host/src/test/bls12_381.rs | 1 + 6 files changed, 714 insertions(+), 741 deletions(-) diff --git a/soroban-env-host/observations/22/test__bls12_381__g1_msm.json b/soroban-env-host/observations/22/test__bls12_381__g1_msm.json index 7ab97c1e9..15c587799 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g1_msm.json +++ b/soroban-env-host/observations/22/test__bls12_381__g1_msm.json @@ -5,356 +5,364 @@ " 3 call vec_new()": "", " 4 ret vec_new -> Ok(Vec(obj#3))": "cpu:1002, mem:128, objs:-/2@14339b3d", " 5 call bls12_381_g1_msm(Vec(obj#1), Vec(obj#3))": "", - " 6 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1246", - " 7 call bytes_new_from_slice(96)": "cpu:2568", - " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:3553, mem:304, objs:-/3@f987415", - " 9 call bytes_new_from_slice(96)": "cpu:4875", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:5860, mem:480, objs:-/4@f550cb25", - " 11 call vec_new_from_slice(2)": "", - " 12 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:6947, mem:576, objs:-/5@27393823", - " 13 call obj_from_u256_pieces(2515383451482204963, 3798294199605637777, 9874121741094930036, 5634530503602181405)": "", - " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:7448, mem:640, objs:-/6@3f49b7c2", - " 15 call obj_from_u256_pieces(16161944172311556037, 9348631246554537043, 7119928359786205760, 2656543668720567255)": "", - " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:7949, mem:704, objs:-/7@2ed0a706", - " 17 call obj_from_u256_pieces(9580499452994475139, 12513764331848801915, 17507952593492800906, 8551509165293236575)": "", - " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:8450, mem:768, objs:-/8@43230a4b", - " 19 call vec_new_from_slice(3)": "", - " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:9600, mem:872, objs:-/9@ac0e3b8c", - " 21 call bls12_381_g1_msm(Vec(obj#9), Vec(obj#17))": "", - " 22 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:9844", - " 23 call vec_new_from_slice(3)": "cpu:19072, mem:1576, objs:-/13@561be3e7", - " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:20222, mem:1680, objs:-/14@c49c6ff2", - " 25 call obj_from_u256_pieces(11943197420912477102, 14634913559439210090, 15499375484791752188, 12925620935896195067)": "", - " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:20723, mem:1744, objs:-/15@3da47540", - " 27 call obj_from_u256_pieces(5622195026378228418, 9560417407481221846, 8127851712333271140, 4557073498745857109)": "", - " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:21224, mem:1808, objs:-/16@d07ec2c0", - " 29 call obj_from_u256_pieces(12072680829433668232, 2892971212195715449, 599041459787463398, 17399677212821182399)": "", - " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:21725, mem:1872, objs:-/17@2d23aeeb", - " 31 call vec_new_from_slice(3)": "", - " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:22875, mem:1976, objs:-/18@9ffeec8c", - " 33 call bls12_381_g1_msm(Vec(obj#27), Vec(obj#35))": "", - " 34 call vec_len(Vec(obj#27))": "cpu:23119", - " 35 ret vec_len -> Ok(U32(3))": "cpu:23241", - " 36 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1492722, mem:2280", - " 37 call vec_new_from_slice(3)": "cpu:1495029, mem:2456, objs:-/19@42952458", - " 38 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:1496179, mem:2560, objs:-/20@a0bd3ff", - " 39 call obj_from_u256_pieces(9030446305465662626, 6854247188031249140, 3026823929057343686, 5018424221301027056)": "", - " 40 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:1496680, mem:2624, objs:-/21@5d27dd7c", - " 41 call obj_from_u256_pieces(17540322581155608940, 9042723259083353182, 9336846948556567215, 15266620357577816939)": "", - " 42 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:1497181, mem:2688, objs:-/22@32305aea", - " 43 call obj_from_u256_pieces(2273584195287690476, 203274327658109228, 545101579437905274, 9593152778203258958)": "", - " 44 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:1497682, mem:2752, objs:-/23@d5672c27", - " 45 call vec_new_from_slice(3)": "", - " 46 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:1498832, mem:2856, objs:-/24@f299ae2e", - " 47 call bls12_381_g1_msm(Vec(obj#39), Vec(obj#47))": "", - " 48 call vec_len(Vec(obj#39))": "cpu:1499076", - " 49 ret vec_len -> Ok(U32(3))": "cpu:1499198", - " 50 call vec_len(Vec(obj#47))": "cpu:3703154, mem:3160", - " 51 ret vec_len -> Ok(U32(3))": "cpu:3703276", - " 52 ret bls12_381_g1_msm -> Ok(Bytes(obj#49))": "cpu:8491000, mem:121254, objs:-/25@e3c1a53", - " 53 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:8493307, mem:121430, objs:-/26@f6f4e327", - " 54 ret obj_cmp -> Ok(0)": "cpu:8493607", - " 55 call bytes_new_from_slice(96)": "cpu:8494929", - " 56 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:8495914, mem:121606, objs:-/27@de36fc43", - " 57 call bytes_new_from_slice(96)": "cpu:8497236", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:8498221, mem:121782, objs:-/28@d5575135", - " 59 call bytes_new_from_slice(96)": "cpu:8499543", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:8500528, mem:121958, objs:-/29@75b6bfd6", - " 61 call vec_new_from_slice(3)": "", - " 62 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:8501678, mem:122062, objs:-/30@a0da8ba2", - " 63 call vec_new_from_slice(3)": "", - " 64 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:8502645, mem:122166, objs:-/31@3969541b", - " 65 call bls12_381_g1_msm(Vec(obj#59), Vec(obj#61))": "", - " 66 call vec_len(Vec(obj#59))": "cpu:8502889", - " 67 ret vec_len -> Ok(U32(3))": "cpu:8503011", - " 68 call vec_len(Vec(obj#61))": "cpu:10706967, mem:122470", - " 69 ret vec_len -> Ok(U32(3))": "cpu:10707089", - " 70 ret bls12_381_g1_msm -> Ok(Bytes(obj#63))": "cpu:15494630, mem:240564, objs:-/32@4cf72b63", - " 71 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:15496937, mem:240740, objs:-/33@2b1e328c", - " 72 ret obj_cmp -> Ok(0)": "cpu:15497237", - " 73 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:15501851, mem:241092, objs:-/35@c5e3864a", - " 74 ret obj_cmp -> Ok(-1)": "cpu:15502151", - " 75 call vec_new_from_slice(2)": "cpu:16238933, mem:241268, objs:-/36@48960b91", - " 76 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:16240020, mem:241364, objs:-/37@9fba2a30", - " 77 call vec_new_from_slice(2)": "", - " 78 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:16240985, mem:241460, objs:-/38@417ebf06", - " 79 call bls12_381_g1_msm(Vec(obj#73), Vec(obj#75))": "", - " 80 call vec_len(Vec(obj#73))": "cpu:16241229", - " 81 ret vec_len -> Ok(U32(2))": "cpu:16241351", - " 82 call vec_len(Vec(obj#75))": "cpu:17710820, mem:241668", - " 83 ret vec_len -> Ok(U32(2))": "cpu:17710942", - " 84 ret bls12_381_g1_msm -> Ok(Bytes(obj#77))": "cpu:21743378, mem:356959, objs:-/39@d2932e3e", - " 85 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:21745685, mem:357135, objs:-/40@3b58e936", - " 86 ret obj_cmp -> Ok(0)": "cpu:21745985", - " 87 call obj_from_u256_pieces(2137869300824195577, 2408943964792666977, 4119820914549582912, 10689500621133072587)": "cpu:9228, mem:704, objs:-/44@bdf24bea", - " 88 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:9729, mem:768, objs:-/45@ff9db193", - " 89 call obj_from_u256_pieces(1962485755387024656, 9106496787558144827, 9789057793268231909, 16221084701331329973)": "", - " 90 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:10230, mem:832, objs:-/46@c719630e", - " 91 call obj_from_u256_pieces(1296515190507321084, 10989324616177374759, 8226479548446315792, 5867014538613133674)": "", - " 92 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:10731, mem:896, objs:-/47@a3ded57a", - " 93 call obj_from_u256_pieces(15796377402950621781, 1952675446632466581, 13889210310322241459, 7969271833534144739)": "", - " 94 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:11232, mem:960, objs:-/48@d367c748", - " 95 call vec_new_from_slice(4)": "", - " 96 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:12445, mem:1072, objs:-/49@4aa6caa5", - " 97 call vec_new_from_slice(4)": "", - " 98 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:13658, mem:1184, objs:-/50@d6716ebc", - " 99 call bls12_381_g1_msm(Vec(obj#97), Vec(obj#99))": "", - " 100 call vec_len(Vec(obj#97))": "cpu:13902", - " 101 ret vec_len -> Ok(U32(4))": "cpu:14024", - " 102 call vec_len(Vec(obj#99))": "cpu:2952467, mem:1584", - " 103 ret vec_len -> Ok(U32(4))": "cpu:2952589", - " 104 ret bls12_381_g1_msm -> Ok(Bytes(obj#101))": "cpu:8495479, mem:122481, objs:-/51@38fc93bb", + " 6 call vec_len(Vec(obj#1))": "cpu:1124", + " 7 ret vec_len -> Ok(U32(0))": "cpu:1246", + " 8 call vec_len(Vec(obj#3))": "cpu:1741, mem:144", + " 9 ret vec_len -> Ok(U32(0))": "cpu:1863", + " 10 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:2429080, mem:109654", + " 11 call bytes_new_from_slice(96)": "cpu:2430402", + " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:2431387, mem:109830, objs:-/3@f987415", + " 13 call bytes_new_from_slice(96)": "cpu:2432709", + " 14 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:2433694, mem:110006, objs:-/4@f550cb25", + " 15 call vec_new_from_slice(2)": "", + " 16 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:2434781, mem:110102, objs:-/5@27393823", + " 17 call obj_from_u256_pieces(2515383451482204963, 3798294199605637777, 9874121741094930036, 5634530503602181405)": "", + " 18 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:2435282, mem:110166, objs:-/6@3f49b7c2", + " 19 call obj_from_u256_pieces(16161944172311556037, 9348631246554537043, 7119928359786205760, 2656543668720567255)": "", + " 20 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:2435783, mem:110230, objs:-/7@2ed0a706", + " 21 call obj_from_u256_pieces(9580499452994475139, 12513764331848801915, 17507952593492800906, 8551509165293236575)": "", + " 22 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:2436284, mem:110294, objs:-/8@43230a4b", + " 23 call vec_new_from_slice(3)": "", + " 24 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:2437434, mem:110398, objs:-/9@ac0e3b8c", + " 25 call bls12_381_g1_msm(Vec(obj#9), Vec(obj#17))": "", + " 26 call vec_len(Vec(obj#9))": "cpu:2437556", + " 27 ret vec_len -> Ok(U32(2))": "cpu:2437678", + " 28 call vec_len(Vec(obj#17))": "cpu:3907147, mem:110606", + " 29 ret vec_len -> Ok(U32(3))": "cpu:3907269", + " 30 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:7846876, mem:225753", + " 31 call vec_new_from_slice(3)": "cpu:7856104, mem:226457, objs:-/13@561be3e7", + " 32 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:7857254, mem:226561, objs:-/14@c49c6ff2", + " 33 call obj_from_u256_pieces(11943197420912477102, 14634913559439210090, 15499375484791752188, 12925620935896195067)": "", + " 34 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:7857755, mem:226625, objs:-/15@3da47540", + " 35 call obj_from_u256_pieces(5622195026378228418, 9560417407481221846, 8127851712333271140, 4557073498745857109)": "", + " 36 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:7858256, mem:226689, objs:-/16@d07ec2c0", + " 37 call obj_from_u256_pieces(12072680829433668232, 2892971212195715449, 599041459787463398, 17399677212821182399)": "", + " 38 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:7858757, mem:226753, objs:-/17@2d23aeeb", + " 39 call vec_new_from_slice(3)": "", + " 40 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:7859907, mem:226857, objs:-/18@9ffeec8c", + " 41 call bls12_381_g1_msm(Vec(obj#27), Vec(obj#35))": "", + " 42 call vec_len(Vec(obj#27))": "cpu:7860029", + " 43 ret vec_len -> Ok(U32(3))": "cpu:7860151", + " 44 ret bls12_381_g1_msm -> Err(Error(Crypto, InvalidInput))": "cpu:9329632, mem:227161", + " 45 call vec_new_from_slice(3)": "cpu:9331939, mem:227337, objs:-/19@42952458", + " 46 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:9333089, mem:227441, objs:-/20@a0bd3ff", + " 47 call obj_from_u256_pieces(9030446305465662626, 6854247188031249140, 3026823929057343686, 5018424221301027056)": "", + " 48 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:9333590, mem:227505, objs:-/21@5d27dd7c", + " 49 call obj_from_u256_pieces(17540322581155608940, 9042723259083353182, 9336846948556567215, 15266620357577816939)": "", + " 50 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:9334091, mem:227569, objs:-/22@32305aea", + " 51 call obj_from_u256_pieces(2273584195287690476, 203274327658109228, 545101579437905274, 9593152778203258958)": "", + " 52 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:9334592, mem:227633, objs:-/23@d5672c27", + " 53 call vec_new_from_slice(3)": "", + " 54 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:9335742, mem:227737, objs:-/24@f299ae2e", + " 55 call bls12_381_g1_msm(Vec(obj#39), Vec(obj#47))": "", + " 56 call vec_len(Vec(obj#39))": "cpu:9335864", + " 57 ret vec_len -> Ok(U32(3))": "cpu:9335986", + " 58 call vec_len(Vec(obj#47))": "cpu:11539942, mem:228041", + " 59 ret vec_len -> Ok(U32(3))": "cpu:11540064", + " 60 ret bls12_381_g1_msm -> Ok(Bytes(obj#49))": "cpu:16327788, mem:346135, objs:-/25@e3c1a53", + " 61 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:16330095, mem:346311, objs:-/26@f6f4e327", + " 62 ret obj_cmp -> Ok(0)": "cpu:16330395", + " 63 call bytes_new_from_slice(96)": "cpu:16331717", + " 64 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:16332702, mem:346487, objs:-/27@de36fc43", + " 65 call bytes_new_from_slice(96)": "cpu:16334024", + " 66 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:16335009, mem:346663, objs:-/28@d5575135", + " 67 call bytes_new_from_slice(96)": "cpu:16336331", + " 68 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:16337316, mem:346839, objs:-/29@75b6bfd6", + " 69 call vec_new_from_slice(3)": "", + " 70 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:16338466, mem:346943, objs:-/30@a0da8ba2", + " 71 call vec_new_from_slice(3)": "", + " 72 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:16339433, mem:347047, objs:-/31@3969541b", + " 73 call bls12_381_g1_msm(Vec(obj#59), Vec(obj#61))": "", + " 74 call vec_len(Vec(obj#59))": "cpu:16339555", + " 75 ret vec_len -> Ok(U32(3))": "cpu:16339677", + " 76 call vec_len(Vec(obj#61))": "cpu:18543633, mem:347351", + " 77 ret vec_len -> Ok(U32(3))": "cpu:18543755", + " 78 ret bls12_381_g1_msm -> Ok(Bytes(obj#63))": "cpu:23331296, mem:465445, objs:-/32@4cf72b63", + " 79 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:23333603, mem:465621, objs:-/33@2b1e328c", + " 80 ret obj_cmp -> Ok(0)": "cpu:23333903", + " 81 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:23338517, mem:465973, objs:-/35@c5e3864a", + " 82 ret obj_cmp -> Ok(-1)": "cpu:23338817", + " 83 call vec_new_from_slice(2)": "cpu:24075599, mem:466149, objs:-/36@48960b91", + " 84 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:24076686, mem:466245, objs:-/37@9fba2a30", + " 85 call vec_new_from_slice(2)": "", + " 86 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:24077651, mem:466341, objs:-/38@417ebf06", + " 87 call bls12_381_g1_msm(Vec(obj#73), Vec(obj#75))": "", + " 88 call vec_len(Vec(obj#73))": "cpu:24077773", + " 89 ret vec_len -> Ok(U32(2))": "cpu:24077895", + " 90 call vec_len(Vec(obj#75))": "cpu:25547364, mem:466549", + " 91 ret vec_len -> Ok(U32(2))": "cpu:25547486", + " 92 ret bls12_381_g1_msm -> Ok(Bytes(obj#77))": "cpu:29579922, mem:581840, objs:-/39@d2932e3e", + " 93 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:29582229, mem:582016, objs:-/40@3b58e936", + " 94 ret obj_cmp -> Ok(0)": "cpu:29582529", + " 95 call obj_from_u256_pieces(2137869300824195577, 2408943964792666977, 4119820914549582912, 10689500621133072587)": "cpu:9228, mem:704, objs:-/44@bdf24bea", + " 96 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:9729, mem:768, objs:-/45@ff9db193", + " 97 call obj_from_u256_pieces(1962485755387024656, 9106496787558144827, 9789057793268231909, 16221084701331329973)": "", + " 98 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:10230, mem:832, objs:-/46@c719630e", + " 99 call obj_from_u256_pieces(1296515190507321084, 10989324616177374759, 8226479548446315792, 5867014538613133674)": "", + " 100 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:10731, mem:896, objs:-/47@a3ded57a", + " 101 call obj_from_u256_pieces(15796377402950621781, 1952675446632466581, 13889210310322241459, 7969271833534144739)": "", + " 102 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:11232, mem:960, objs:-/48@d367c748", + " 103 call vec_new_from_slice(4)": "", + " 104 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:12445, mem:1072, objs:-/49@4aa6caa5", " 105 call vec_new_from_slice(4)": "", - " 106 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:8496692, mem:122593, objs:-/52@332932d6", - " 107 call vec_new_from_slice(4)": "", - " 108 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:8497905, mem:122705, objs:-/53@eb9d99bf", - " 109 call bls12_381_g1_msm(Vec(obj#103), Vec(obj#105))": "", - " 110 call vec_len(Vec(obj#103))": "cpu:8498149", - " 111 ret vec_len -> Ok(U32(4))": "cpu:8498271", - " 112 call vec_len(Vec(obj#105))": "cpu:11436714, mem:123105", - " 113 ret vec_len -> Ok(U32(4))": "cpu:11436836", - " 114 ret bls12_381_g1_msm -> Ok(Bytes(obj#107))": "cpu:16979726, mem:244002, objs:-/54@f3e7e2fb", - " 115 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", - " 116 ret obj_cmp -> Ok(0)": "cpu:16980026", - " 117 call vec_new_from_slice(4)": "", - " 118 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:16981239, mem:244114, objs:-/55@c50146aa", - " 119 call vec_new_from_slice(4)": "", - " 120 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:16982452, mem:244226, objs:-/56@c60df128", - " 121 call bls12_381_g1_msm(Vec(obj#109), Vec(obj#111))": "", - " 122 call vec_len(Vec(obj#109))": "cpu:16982696", - " 123 ret vec_len -> Ok(U32(4))": "cpu:16982818", - " 124 call vec_len(Vec(obj#111))": "cpu:19921261, mem:244626", - " 125 ret vec_len -> Ok(U32(4))": "cpu:19921383", - " 126 ret bls12_381_g1_msm -> Ok(Bytes(obj#113))": "cpu:25464273, mem:365523, objs:-/57@bcaec10e", - " 127 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", - " 128 ret obj_cmp -> Ok(0)": "cpu:25464573", - " 129 call vec_new_from_slice(4)": "", - " 130 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:25465786, mem:365635, objs:-/58@c312d486", - " 131 call vec_new_from_slice(4)": "", - " 132 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:25466999, mem:365747, objs:-/59@8118160e", - " 133 call bls12_381_g1_msm(Vec(obj#115), Vec(obj#117))": "", - " 134 call vec_len(Vec(obj#115))": "cpu:25467243", - " 135 ret vec_len -> Ok(U32(4))": "cpu:25467365", - " 136 call vec_len(Vec(obj#117))": "cpu:28405808, mem:366147", - " 137 ret vec_len -> Ok(U32(4))": "cpu:28405930", - " 138 ret bls12_381_g1_msm -> Ok(Bytes(obj#119))": "cpu:33948820, mem:487044, objs:-/60@2f469956", - " 139 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", - " 140 ret obj_cmp -> Ok(0)": "cpu:33949120", - " 141 call vec_new_from_slice(4)": "", - " 142 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:33950333, mem:487156, objs:-/61@e3634851", - " 143 call vec_new_from_slice(4)": "", - " 144 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:33951546, mem:487268, objs:-/62@efcd97c0", - " 145 call bls12_381_g1_msm(Vec(obj#121), Vec(obj#123))": "", - " 146 call vec_len(Vec(obj#121))": "cpu:33951790", - " 147 ret vec_len -> Ok(U32(4))": "cpu:33951912", - " 148 call vec_len(Vec(obj#123))": "cpu:36890355, mem:487668", - " 149 ret vec_len -> Ok(U32(4))": "cpu:36890477", - " 150 ret bls12_381_g1_msm -> Ok(Bytes(obj#125))": "cpu:42433367, mem:608565, objs:-/63@56df4afe", - " 151 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", - " 152 ret obj_cmp -> Ok(0)": "cpu:42433667", - " 153 call vec_new_from_slice(4)": "", - " 154 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:42434880, mem:608677, objs:-/64@c6fa44ae", - " 155 call vec_new_from_slice(4)": "", - " 156 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:42436093, mem:608789, objs:-/65@4be879d9", - " 157 call bls12_381_g1_msm(Vec(obj#127), Vec(obj#129))": "", - " 158 call vec_len(Vec(obj#127))": "cpu:42436337", - " 159 ret vec_len -> Ok(U32(4))": "cpu:42436459", - " 160 call vec_len(Vec(obj#129))": "cpu:45374902, mem:609189", - " 161 ret vec_len -> Ok(U32(4))": "cpu:45375024", - " 162 ret bls12_381_g1_msm -> Ok(Bytes(obj#131))": "cpu:50917914, mem:730086, objs:-/66@cd9321cc", - " 163 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", - " 164 ret obj_cmp -> Ok(0)": "cpu:50918214", - " 165 call vec_new_from_slice(4)": "", - " 166 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:50919427, mem:730198, objs:-/67@83139207", - " 167 call vec_new_from_slice(4)": "", - " 168 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:50920640, mem:730310, objs:-/68@bff98043", - " 169 call bls12_381_g1_msm(Vec(obj#133), Vec(obj#135))": "", - " 170 call vec_len(Vec(obj#133))": "cpu:50920884", - " 171 ret vec_len -> Ok(U32(4))": "cpu:50921006", - " 172 call vec_len(Vec(obj#135))": "cpu:53859449, mem:730710", - " 173 ret vec_len -> Ok(U32(4))": "cpu:53859571", - " 174 ret bls12_381_g1_msm -> Ok(Bytes(obj#137))": "cpu:59402461, mem:851607, objs:-/69@57b33ea5", - " 175 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", - " 176 ret obj_cmp -> Ok(0)": "cpu:59402761", - " 177 call vec_new_from_slice(4)": "", - " 178 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:59403974, mem:851719, objs:-/70@67ce2467", - " 179 call vec_new_from_slice(4)": "", - " 180 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:59405187, mem:851831, objs:-/71@1a3a91ea", - " 181 call bls12_381_g1_msm(Vec(obj#139), Vec(obj#141))": "", - " 182 call vec_len(Vec(obj#139))": "cpu:59405431", - " 183 ret vec_len -> Ok(U32(4))": "cpu:59405553", - " 184 call vec_len(Vec(obj#141))": "cpu:62343996, mem:852231", - " 185 ret vec_len -> Ok(U32(4))": "cpu:62344118", - " 186 ret bls12_381_g1_msm -> Ok(Bytes(obj#143))": "cpu:67887008, mem:973128, objs:-/72@d3eea58f", - " 187 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", - " 188 ret obj_cmp -> Ok(0)": "cpu:67887308", - " 189 call vec_new_from_slice(4)": "", - " 190 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:67888521, mem:973240, objs:-/73@d260e80a", - " 191 call vec_new_from_slice(4)": "", - " 192 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:67889734, mem:973352, objs:-/74@fc820513", - " 193 call bls12_381_g1_msm(Vec(obj#145), Vec(obj#147))": "", - " 194 call vec_len(Vec(obj#145))": "cpu:67889978", - " 195 ret vec_len -> Ok(U32(4))": "cpu:67890100", - " 196 call vec_len(Vec(obj#147))": "cpu:70828543, mem:973752", - " 197 ret vec_len -> Ok(U32(4))": "cpu:70828665", - " 198 ret bls12_381_g1_msm -> Ok(Bytes(obj#149))": "cpu:76371555, mem:1094649, objs:-/75@14642af", - " 199 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", - " 200 ret obj_cmp -> Ok(0)": "cpu:76371855", - " 201 call vec_new_from_slice(4)": "", - " 202 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:76373068, mem:1094761, objs:-/76@8e00d86c", - " 203 call vec_new_from_slice(4)": "", - " 204 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:76374281, mem:1094873, objs:-/77@8e3de39e", - " 205 call bls12_381_g1_msm(Vec(obj#151), Vec(obj#153))": "", - " 206 call vec_len(Vec(obj#151))": "cpu:76374525", - " 207 ret vec_len -> Ok(U32(4))": "cpu:76374647", - " 208 call vec_len(Vec(obj#153))": "cpu:79313090, mem:1095273", - " 209 ret vec_len -> Ok(U32(4))": "cpu:79313212", - " 210 ret bls12_381_g1_msm -> Ok(Bytes(obj#155))": "cpu:84856102, mem:1216170, objs:-/78@8bf03081", - " 211 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", - " 212 ret obj_cmp -> Ok(0)": "cpu:84856402", - " 213 call vec_new_from_slice(4)": "", - " 214 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:84857615, mem:1216282, objs:-/79@df97cf2f", - " 215 call vec_new_from_slice(4)": "", - " 216 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:84858828, mem:1216394, objs:-/80@a4dbe930", - " 217 call bls12_381_g1_msm(Vec(obj#157), Vec(obj#159))": "", - " 218 call vec_len(Vec(obj#157))": "cpu:84859072", - " 219 ret vec_len -> Ok(U32(4))": "cpu:84859194", - " 220 call vec_len(Vec(obj#159))": "cpu:87797637, mem:1216794", - " 221 ret vec_len -> Ok(U32(4))": "cpu:87797759", - " 222 ret bls12_381_g1_msm -> Ok(Bytes(obj#161))": "cpu:93340649, mem:1337691, objs:-/81@9f62a7d5", - " 223 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", - " 224 ret obj_cmp -> Ok(0)": "cpu:93340949", - " 225 call bytes_new_from_slice(96)": "cpu:1322, mem:0", - " 226 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:2307, mem:176, objs:-/82@dd48ce00", - " 227 call bytes_new_from_slice(96)": "cpu:3629", - " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:4614, mem:352, objs:-/83@2ba0a36c", - " 229 call bytes_new_from_slice(96)": "cpu:5936", - " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:6921, mem:528, objs:-/84@a00db887", - " 231 call bytes_new_from_slice(96)": "cpu:8243", - " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:9228, mem:704, objs:-/85@2ff3a0e7", - " 233 call bytes_new_from_slice(96)": "cpu:10550", - " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:11535, mem:880, objs:-/86@67a727f9", - " 235 call bytes_new_from_slice(96)": "cpu:12857", - " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#173))": "cpu:13842, mem:1056, objs:-/87@928f7064", - " 237 call bytes_new_from_slice(96)": "cpu:15164", - " 238 ret bytes_new_from_slice -> Ok(Bytes(obj#175))": "cpu:16149, mem:1232, objs:-/88@8e6f6128", - " 239 call bytes_new_from_slice(96)": "cpu:17471", - " 240 ret bytes_new_from_slice -> Ok(Bytes(obj#177))": "cpu:18456, mem:1408, objs:-/89@8b355a07", - " 241 call bytes_new_from_slice(96)": "cpu:19778", - " 242 ret bytes_new_from_slice -> Ok(Bytes(obj#179))": "cpu:20763, mem:1584, objs:-/90@2bebefc3", - " 243 call bytes_new_from_slice(96)": "cpu:22085", - " 244 ret bytes_new_from_slice -> Ok(Bytes(obj#181))": "cpu:23070, mem:1760, objs:-/91@87d223bb", - " 245 call vec_new_from_slice(10)": "", - " 246 ret vec_new_from_slice -> Ok(Vec(obj#183))": "cpu:24661, mem:1920, objs:-/92@e05d7d45", - " 247 call obj_from_u256_pieces(17618770950827998744, 14662068724577735075, 2249062990298394979, 9977923089826089615)": "", - " 248 ret obj_from_u256_pieces -> Ok(U256(obj#185))": "cpu:25162, mem:1984, objs:-/93@e4abda0a", - " 249 call obj_from_u256_pieces(2821194631792961874, 16547277464900892467, 14819559542962736549, 17981056101655367365)": "", - " 250 ret obj_from_u256_pieces -> Ok(U256(obj#187))": "cpu:25663, mem:2048, objs:-/94@59894c0f", - " 251 call obj_from_u256_pieces(14823680325444367514, 16057910356200631686, 11653412393475167983, 17971148540471083046)": "", - " 252 ret obj_from_u256_pieces -> Ok(U256(obj#189))": "cpu:26164, mem:2112, objs:-/95@f611f183", - " 253 call obj_from_u256_pieces(16502273625602787483, 2713688267813643125, 15061415354752276271, 16690818686241479208)": "", - " 254 ret obj_from_u256_pieces -> Ok(U256(obj#191))": "cpu:26665, mem:2176, objs:-/96@b6efa1b5", - " 255 call obj_from_u256_pieces(7027192125185647877, 17045944964573428771, 10144290202347477085, 10705035438189734679)": "", - " 256 ret obj_from_u256_pieces -> Ok(U256(obj#193))": "cpu:27166, mem:2240, objs:-/97@f626d632", - " 257 call obj_from_u256_pieces(14552017996338670628, 17384320552016825872, 12623460464266321339, 2351693706725345962)": "", - " 258 ret obj_from_u256_pieces -> Ok(U256(obj#195))": "cpu:27667, mem:2304, objs:-/98@dc0fd6a8", - " 259 call obj_from_u256_pieces(4037855643097226315, 3588748593401323528, 18145554024939280631, 6805129555195258487)": "", - " 260 ret obj_from_u256_pieces -> Ok(U256(obj#197))": "cpu:28168, mem:2368, objs:-/99@3a43cf0d", - " 261 call obj_from_u256_pieces(10690484396013942008, 3220507769215303921, 6575779185716732641, 1735816512470570891)": "", - " 262 ret obj_from_u256_pieces -> Ok(U256(obj#199))": "cpu:28669, mem:2432, objs:-/100@72aa4d1", - " 263 call obj_from_u256_pieces(854729243539327218, 14181304886955281704, 12059208175304010597, 16702944845996181439)": "", - " 264 ret obj_from_u256_pieces -> Ok(U256(obj#201))": "cpu:29170, mem:2496, objs:-/101@898aec71", - " 265 call obj_from_u256_pieces(11497158191995684079, 43326291776979156, 14533160951240524555, 12852174102015084654)": "", - " 266 ret obj_from_u256_pieces -> Ok(U256(obj#203))": "cpu:29671, mem:2560, objs:-/102@a0762125", - " 267 call vec_new_from_slice(10)": "", - " 268 ret vec_new_from_slice -> Ok(Vec(obj#205))": "cpu:31262, mem:2720, objs:-/103@d1b8c868", - " 269 call bls12_381_g1_msm(Vec(obj#183), Vec(obj#205))": "", - " 270 call vec_len(Vec(obj#183))": "cpu:31506", - " 271 ret vec_len -> Ok(U32(10))": "cpu:31628", - " 272 call vec_len(Vec(obj#205))": "cpu:7376993, mem:3696", - " 273 ret vec_len -> Ok(U32(10))": "cpu:7377115", - " 274 ret bls12_381_g1_msm -> Ok(Bytes(obj#207))": "cpu:17451000, mem:141410, objs:-/104@5e3fb337", - " 275 call vec_get(Vec(obj#183), U32(0))": "cpu:17453307, mem:141586, objs:-/105@cc1ad99a", - " 276 ret vec_get -> Ok(Bytes(obj#163))": "cpu:17453533", - " 277 call vec_get(Vec(obj#205), U32(0))": "", - " 278 ret vec_get -> Ok(U256(obj#185))": "cpu:17453759", - " 279 call bls12_381_g1_mul(Bytes(obj#163), U256(obj#185))": "", - " 280 ret bls12_381_g1_mul -> Ok(Bytes(obj#211))": "cpu:20744406, mem:141762, objs:-/106@4d87b466", - " 281 call bls12_381_g1_add(Bytes(obj#209), Bytes(obj#211))": "", - " 282 ret bls12_381_g1_add -> Ok(Bytes(obj#213))": "cpu:20855157, mem:141938, objs:-/107@a668862", - " 283 call vec_get(Vec(obj#183), U32(1))": "", - " 284 ret vec_get -> Ok(Bytes(obj#165))": "cpu:20855383", - " 285 call vec_get(Vec(obj#205), U32(1))": "", - " 286 ret vec_get -> Ok(U256(obj#187))": "cpu:20855609", - " 287 call bls12_381_g1_mul(Bytes(obj#165), U256(obj#187))": "", - " 288 ret bls12_381_g1_mul -> Ok(Bytes(obj#215))": "cpu:24146256, mem:142114, objs:-/108@26939bdb", - " 289 call bls12_381_g1_add(Bytes(obj#213), Bytes(obj#215))": "", - " 290 ret bls12_381_g1_add -> Ok(Bytes(obj#217))": "cpu:24257007, mem:142290, objs:-/109@afa942f2", - " 291 call vec_get(Vec(obj#183), U32(2))": "", - " 292 ret vec_get -> Ok(Bytes(obj#167))": "cpu:24257233", - " 293 call vec_get(Vec(obj#205), U32(2))": "", - " 294 ret vec_get -> Ok(U256(obj#189))": "cpu:24257459", - " 295 call bls12_381_g1_mul(Bytes(obj#167), U256(obj#189))": "", - " 296 ret bls12_381_g1_mul -> Ok(Bytes(obj#219))": "cpu:27548106, mem:142466, objs:-/110@80ebabcb", - " 297 call bls12_381_g1_add(Bytes(obj#217), Bytes(obj#219))": "", - " 298 ret bls12_381_g1_add -> Ok(Bytes(obj#221))": "cpu:27658857, mem:142642, objs:-/111@c5129985", - " 299 call vec_get(Vec(obj#183), U32(3))": "", - " 300 ret vec_get -> Ok(Bytes(obj#169))": "cpu:27659083", - " 301 call vec_get(Vec(obj#205), U32(3))": "", - " 302 ret vec_get -> Ok(U256(obj#191))": "cpu:27659309", - " 303 call bls12_381_g1_mul(Bytes(obj#169), U256(obj#191))": "", - " 304 ret bls12_381_g1_mul -> Ok(Bytes(obj#223))": "cpu:30949956, mem:142818, objs:-/112@185b22ec", - " 305 call bls12_381_g1_add(Bytes(obj#221), Bytes(obj#223))": "", - " 306 ret bls12_381_g1_add -> Ok(Bytes(obj#225))": "cpu:31060707, mem:142994, objs:-/113@c4f97300", - " 307 call vec_get(Vec(obj#183), U32(4))": "", - " 308 ret vec_get -> Ok(Bytes(obj#171))": "cpu:31060933", - " 309 call vec_get(Vec(obj#205), U32(4))": "", - " 310 ret vec_get -> Ok(U256(obj#193))": "cpu:31061159", - " 311 call bls12_381_g1_mul(Bytes(obj#171), U256(obj#193))": "", - " 312 ret bls12_381_g1_mul -> Ok(Bytes(obj#227))": "cpu:34351806, mem:143170, objs:-/114@5dcb2245", - " 313 call bls12_381_g1_add(Bytes(obj#225), Bytes(obj#227))": "", - " 314 ret bls12_381_g1_add -> Ok(Bytes(obj#229))": "cpu:34462557, mem:143346, objs:-/115@9b8b7719", - " 315 call vec_get(Vec(obj#183), U32(5))": "", - " 316 ret vec_get -> Ok(Bytes(obj#173))": "cpu:34462783", - " 317 call vec_get(Vec(obj#205), U32(5))": "", - " 318 ret vec_get -> Ok(U256(obj#195))": "cpu:34463009", - " 319 call bls12_381_g1_mul(Bytes(obj#173), U256(obj#195))": "", - " 320 ret bls12_381_g1_mul -> Ok(Bytes(obj#231))": "cpu:37753656, mem:143522, objs:-/116@7e32132b", - " 321 call bls12_381_g1_add(Bytes(obj#229), Bytes(obj#231))": "", - " 322 ret bls12_381_g1_add -> Ok(Bytes(obj#233))": "cpu:37864407, mem:143698, objs:-/117@820927b5", - " 323 call vec_get(Vec(obj#183), U32(6))": "", - " 324 ret vec_get -> Ok(Bytes(obj#175))": "cpu:37864633", - " 325 call vec_get(Vec(obj#205), U32(6))": "", - " 326 ret vec_get -> Ok(U256(obj#197))": "cpu:37864859", - " 327 call bls12_381_g1_mul(Bytes(obj#175), U256(obj#197))": "", - " 328 ret bls12_381_g1_mul -> Ok(Bytes(obj#235))": "cpu:41155506, mem:143874, objs:-/118@734cedc3", - " 329 call bls12_381_g1_add(Bytes(obj#233), Bytes(obj#235))": "", - " 330 ret bls12_381_g1_add -> Ok(Bytes(obj#237))": "cpu:41266257, mem:144050, objs:-/119@9f782901", - " 331 call vec_get(Vec(obj#183), U32(7))": "", - " 332 ret vec_get -> Ok(Bytes(obj#177))": "cpu:41266483", - " 333 call vec_get(Vec(obj#205), U32(7))": "", - " 334 ret vec_get -> Ok(U256(obj#199))": "cpu:41266709", - " 335 call bls12_381_g1_mul(Bytes(obj#177), U256(obj#199))": "", - " 336 ret bls12_381_g1_mul -> Ok(Bytes(obj#239))": "cpu:44557356, mem:144226, objs:-/120@6222b65f", - " 337 call bls12_381_g1_add(Bytes(obj#237), Bytes(obj#239))": "", - " 338 ret bls12_381_g1_add -> Ok(Bytes(obj#241))": "cpu:44668107, mem:144402, objs:-/121@ec08d7b8", - " 339 call vec_get(Vec(obj#183), U32(8))": "", - " 340 ret vec_get -> Ok(Bytes(obj#179))": "cpu:44668333", - " 341 call vec_get(Vec(obj#205), U32(8))": "", - " 342 ret vec_get -> Ok(U256(obj#201))": "cpu:44668559", - " 343 call bls12_381_g1_mul(Bytes(obj#179), U256(obj#201))": "", - " 344 ret bls12_381_g1_mul -> Ok(Bytes(obj#243))": "cpu:47959206, mem:144578, objs:-/122@ed50266c", - " 345 call bls12_381_g1_add(Bytes(obj#241), Bytes(obj#243))": "", - " 346 ret bls12_381_g1_add -> Ok(Bytes(obj#245))": "cpu:48069957, mem:144754, objs:-/123@c4adee2a", - " 347 call vec_get(Vec(obj#183), U32(9))": "", - " 348 ret vec_get -> Ok(Bytes(obj#181))": "cpu:48070183", - " 349 call vec_get(Vec(obj#205), U32(9))": "", - " 350 ret vec_get -> Ok(U256(obj#203))": "cpu:48070409", - " 351 call bls12_381_g1_mul(Bytes(obj#181), U256(obj#203))": "", - " 352 ret bls12_381_g1_mul -> Ok(Bytes(obj#247))": "cpu:51361056, mem:144930, objs:-/124@e5cf2285", - " 353 call bls12_381_g1_add(Bytes(obj#245), Bytes(obj#247))": "", - " 354 ret bls12_381_g1_add -> Ok(Bytes(obj#249))": "cpu:51471807, mem:145106, objs:-/125@e28e8633", - " 355 call obj_cmp(Bytes(obj#249), Bytes(obj#207))": "", - " 356 ret obj_cmp -> Ok(0)": "cpu:51472107", - " 357 end": "cpu:51472107, mem:145106, prngs:-/-, objs:-/125@e28e8633, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 106 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:13658, mem:1184, objs:-/50@d6716ebc", + " 107 call bls12_381_g1_msm(Vec(obj#97), Vec(obj#99))": "", + " 108 call vec_len(Vec(obj#97))": "cpu:13780", + " 109 ret vec_len -> Ok(U32(4))": "cpu:13902", + " 110 call vec_len(Vec(obj#99))": "cpu:2952345, mem:1584", + " 111 ret vec_len -> Ok(U32(4))": "cpu:2952467", + " 112 ret bls12_381_g1_msm -> Ok(Bytes(obj#101))": "cpu:8495357, mem:122481, objs:-/51@38fc93bb", + " 113 call vec_new_from_slice(4)": "", + " 114 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:8496570, mem:122593, objs:-/52@332932d6", + " 115 call vec_new_from_slice(4)": "", + " 116 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:8497783, mem:122705, objs:-/53@eb9d99bf", + " 117 call bls12_381_g1_msm(Vec(obj#103), Vec(obj#105))": "", + " 118 call vec_len(Vec(obj#103))": "cpu:8497905", + " 119 ret vec_len -> Ok(U32(4))": "cpu:8498027", + " 120 call vec_len(Vec(obj#105))": "cpu:11436470, mem:123105", + " 121 ret vec_len -> Ok(U32(4))": "cpu:11436592", + " 122 ret bls12_381_g1_msm -> Ok(Bytes(obj#107))": "cpu:16979482, mem:244002, objs:-/54@f3e7e2fb", + " 123 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", + " 124 ret obj_cmp -> Ok(0)": "cpu:16979782", + " 125 call vec_new_from_slice(4)": "", + " 126 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:16980995, mem:244114, objs:-/55@c50146aa", + " 127 call vec_new_from_slice(4)": "", + " 128 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:16982208, mem:244226, objs:-/56@c60df128", + " 129 call bls12_381_g1_msm(Vec(obj#109), Vec(obj#111))": "", + " 130 call vec_len(Vec(obj#109))": "cpu:16982330", + " 131 ret vec_len -> Ok(U32(4))": "cpu:16982452", + " 132 call vec_len(Vec(obj#111))": "cpu:19920895, mem:244626", + " 133 ret vec_len -> Ok(U32(4))": "cpu:19921017", + " 134 ret bls12_381_g1_msm -> Ok(Bytes(obj#113))": "cpu:25463907, mem:365523, objs:-/57@bcaec10e", + " 135 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", + " 136 ret obj_cmp -> Ok(0)": "cpu:25464207", + " 137 call vec_new_from_slice(4)": "", + " 138 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:25465420, mem:365635, objs:-/58@c312d486", + " 139 call vec_new_from_slice(4)": "", + " 140 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:25466633, mem:365747, objs:-/59@8118160e", + " 141 call bls12_381_g1_msm(Vec(obj#115), Vec(obj#117))": "", + " 142 call vec_len(Vec(obj#115))": "cpu:25466755", + " 143 ret vec_len -> Ok(U32(4))": "cpu:25466877", + " 144 call vec_len(Vec(obj#117))": "cpu:28405320, mem:366147", + " 145 ret vec_len -> Ok(U32(4))": "cpu:28405442", + " 146 ret bls12_381_g1_msm -> Ok(Bytes(obj#119))": "cpu:33948332, mem:487044, objs:-/60@2f469956", + " 147 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", + " 148 ret obj_cmp -> Ok(0)": "cpu:33948632", + " 149 call vec_new_from_slice(4)": "", + " 150 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:33949845, mem:487156, objs:-/61@e3634851", + " 151 call vec_new_from_slice(4)": "", + " 152 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:33951058, mem:487268, objs:-/62@efcd97c0", + " 153 call bls12_381_g1_msm(Vec(obj#121), Vec(obj#123))": "", + " 154 call vec_len(Vec(obj#121))": "cpu:33951180", + " 155 ret vec_len -> Ok(U32(4))": "cpu:33951302", + " 156 call vec_len(Vec(obj#123))": "cpu:36889745, mem:487668", + " 157 ret vec_len -> Ok(U32(4))": "cpu:36889867", + " 158 ret bls12_381_g1_msm -> Ok(Bytes(obj#125))": "cpu:42432757, mem:608565, objs:-/63@56df4afe", + " 159 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", + " 160 ret obj_cmp -> Ok(0)": "cpu:42433057", + " 161 call vec_new_from_slice(4)": "", + " 162 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:42434270, mem:608677, objs:-/64@c6fa44ae", + " 163 call vec_new_from_slice(4)": "", + " 164 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:42435483, mem:608789, objs:-/65@4be879d9", + " 165 call bls12_381_g1_msm(Vec(obj#127), Vec(obj#129))": "", + " 166 call vec_len(Vec(obj#127))": "cpu:42435605", + " 167 ret vec_len -> Ok(U32(4))": "cpu:42435727", + " 168 call vec_len(Vec(obj#129))": "cpu:45374170, mem:609189", + " 169 ret vec_len -> Ok(U32(4))": "cpu:45374292", + " 170 ret bls12_381_g1_msm -> Ok(Bytes(obj#131))": "cpu:50917182, mem:730086, objs:-/66@cd9321cc", + " 171 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", + " 172 ret obj_cmp -> Ok(0)": "cpu:50917482", + " 173 call vec_new_from_slice(4)": "", + " 174 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:50918695, mem:730198, objs:-/67@83139207", + " 175 call vec_new_from_slice(4)": "", + " 176 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:50919908, mem:730310, objs:-/68@bff98043", + " 177 call bls12_381_g1_msm(Vec(obj#133), Vec(obj#135))": "", + " 178 call vec_len(Vec(obj#133))": "cpu:50920030", + " 179 ret vec_len -> Ok(U32(4))": "cpu:50920152", + " 180 call vec_len(Vec(obj#135))": "cpu:53858595, mem:730710", + " 181 ret vec_len -> Ok(U32(4))": "cpu:53858717", + " 182 ret bls12_381_g1_msm -> Ok(Bytes(obj#137))": "cpu:59401607, mem:851607, objs:-/69@57b33ea5", + " 183 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", + " 184 ret obj_cmp -> Ok(0)": "cpu:59401907", + " 185 call vec_new_from_slice(4)": "", + " 186 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:59403120, mem:851719, objs:-/70@67ce2467", + " 187 call vec_new_from_slice(4)": "", + " 188 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:59404333, mem:851831, objs:-/71@1a3a91ea", + " 189 call bls12_381_g1_msm(Vec(obj#139), Vec(obj#141))": "", + " 190 call vec_len(Vec(obj#139))": "cpu:59404455", + " 191 ret vec_len -> Ok(U32(4))": "cpu:59404577", + " 192 call vec_len(Vec(obj#141))": "cpu:62343020, mem:852231", + " 193 ret vec_len -> Ok(U32(4))": "cpu:62343142", + " 194 ret bls12_381_g1_msm -> Ok(Bytes(obj#143))": "cpu:67886032, mem:973128, objs:-/72@d3eea58f", + " 195 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", + " 196 ret obj_cmp -> Ok(0)": "cpu:67886332", + " 197 call vec_new_from_slice(4)": "", + " 198 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:67887545, mem:973240, objs:-/73@d260e80a", + " 199 call vec_new_from_slice(4)": "", + " 200 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:67888758, mem:973352, objs:-/74@fc820513", + " 201 call bls12_381_g1_msm(Vec(obj#145), Vec(obj#147))": "", + " 202 call vec_len(Vec(obj#145))": "cpu:67888880", + " 203 ret vec_len -> Ok(U32(4))": "cpu:67889002", + " 204 call vec_len(Vec(obj#147))": "cpu:70827445, mem:973752", + " 205 ret vec_len -> Ok(U32(4))": "cpu:70827567", + " 206 ret bls12_381_g1_msm -> Ok(Bytes(obj#149))": "cpu:76370457, mem:1094649, objs:-/75@14642af", + " 207 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", + " 208 ret obj_cmp -> Ok(0)": "cpu:76370757", + " 209 call vec_new_from_slice(4)": "", + " 210 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:76371970, mem:1094761, objs:-/76@8e00d86c", + " 211 call vec_new_from_slice(4)": "", + " 212 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:76373183, mem:1094873, objs:-/77@8e3de39e", + " 213 call bls12_381_g1_msm(Vec(obj#151), Vec(obj#153))": "", + " 214 call vec_len(Vec(obj#151))": "cpu:76373305", + " 215 ret vec_len -> Ok(U32(4))": "cpu:76373427", + " 216 call vec_len(Vec(obj#153))": "cpu:79311870, mem:1095273", + " 217 ret vec_len -> Ok(U32(4))": "cpu:79311992", + " 218 ret bls12_381_g1_msm -> Ok(Bytes(obj#155))": "cpu:84854882, mem:1216170, objs:-/78@8bf03081", + " 219 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", + " 220 ret obj_cmp -> Ok(0)": "cpu:84855182", + " 221 call vec_new_from_slice(4)": "", + " 222 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:84856395, mem:1216282, objs:-/79@df97cf2f", + " 223 call vec_new_from_slice(4)": "", + " 224 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:84857608, mem:1216394, objs:-/80@a4dbe930", + " 225 call bls12_381_g1_msm(Vec(obj#157), Vec(obj#159))": "", + " 226 call vec_len(Vec(obj#157))": "cpu:84857730", + " 227 ret vec_len -> Ok(U32(4))": "cpu:84857852", + " 228 call vec_len(Vec(obj#159))": "cpu:87796295, mem:1216794", + " 229 ret vec_len -> Ok(U32(4))": "cpu:87796417", + " 230 ret bls12_381_g1_msm -> Ok(Bytes(obj#161))": "cpu:93339307, mem:1337691, objs:-/81@9f62a7d5", + " 231 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", + " 232 ret obj_cmp -> Ok(0)": "cpu:93339607", + " 233 call bytes_new_from_slice(96)": "cpu:1322, mem:0", + " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:2307, mem:176, objs:-/82@dd48ce00", + " 235 call bytes_new_from_slice(96)": "cpu:3629", + " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:4614, mem:352, objs:-/83@2ba0a36c", + " 237 call bytes_new_from_slice(96)": "cpu:5936", + " 238 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:6921, mem:528, objs:-/84@a00db887", + " 239 call bytes_new_from_slice(96)": "cpu:8243", + " 240 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:9228, mem:704, objs:-/85@2ff3a0e7", + " 241 call bytes_new_from_slice(96)": "cpu:10550", + " 242 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:11535, mem:880, objs:-/86@67a727f9", + " 243 call bytes_new_from_slice(96)": "cpu:12857", + " 244 ret bytes_new_from_slice -> Ok(Bytes(obj#173))": "cpu:13842, mem:1056, objs:-/87@928f7064", + " 245 call bytes_new_from_slice(96)": "cpu:15164", + " 246 ret bytes_new_from_slice -> Ok(Bytes(obj#175))": "cpu:16149, mem:1232, objs:-/88@8e6f6128", + " 247 call bytes_new_from_slice(96)": "cpu:17471", + " 248 ret bytes_new_from_slice -> Ok(Bytes(obj#177))": "cpu:18456, mem:1408, objs:-/89@8b355a07", + " 249 call bytes_new_from_slice(96)": "cpu:19778", + " 250 ret bytes_new_from_slice -> Ok(Bytes(obj#179))": "cpu:20763, mem:1584, objs:-/90@2bebefc3", + " 251 call bytes_new_from_slice(96)": "cpu:22085", + " 252 ret bytes_new_from_slice -> Ok(Bytes(obj#181))": "cpu:23070, mem:1760, objs:-/91@87d223bb", + " 253 call vec_new_from_slice(10)": "", + " 254 ret vec_new_from_slice -> Ok(Vec(obj#183))": "cpu:24661, mem:1920, objs:-/92@e05d7d45", + " 255 call obj_from_u256_pieces(17618770950827998744, 14662068724577735075, 2249062990298394979, 9977923089826089615)": "", + " 256 ret obj_from_u256_pieces -> Ok(U256(obj#185))": "cpu:25162, mem:1984, objs:-/93@e4abda0a", + " 257 call obj_from_u256_pieces(2821194631792961874, 16547277464900892467, 14819559542962736549, 17981056101655367365)": "", + " 258 ret obj_from_u256_pieces -> Ok(U256(obj#187))": "cpu:25663, mem:2048, objs:-/94@59894c0f", + " 259 call obj_from_u256_pieces(14823680325444367514, 16057910356200631686, 11653412393475167983, 17971148540471083046)": "", + " 260 ret obj_from_u256_pieces -> Ok(U256(obj#189))": "cpu:26164, mem:2112, objs:-/95@f611f183", + " 261 call obj_from_u256_pieces(16502273625602787483, 2713688267813643125, 15061415354752276271, 16690818686241479208)": "", + " 262 ret obj_from_u256_pieces -> Ok(U256(obj#191))": "cpu:26665, mem:2176, objs:-/96@b6efa1b5", + " 263 call obj_from_u256_pieces(7027192125185647877, 17045944964573428771, 10144290202347477085, 10705035438189734679)": "", + " 264 ret obj_from_u256_pieces -> Ok(U256(obj#193))": "cpu:27166, mem:2240, objs:-/97@f626d632", + " 265 call obj_from_u256_pieces(14552017996338670628, 17384320552016825872, 12623460464266321339, 2351693706725345962)": "", + " 266 ret obj_from_u256_pieces -> Ok(U256(obj#195))": "cpu:27667, mem:2304, objs:-/98@dc0fd6a8", + " 267 call obj_from_u256_pieces(4037855643097226315, 3588748593401323528, 18145554024939280631, 6805129555195258487)": "", + " 268 ret obj_from_u256_pieces -> Ok(U256(obj#197))": "cpu:28168, mem:2368, objs:-/99@3a43cf0d", + " 269 call obj_from_u256_pieces(10690484396013942008, 3220507769215303921, 6575779185716732641, 1735816512470570891)": "", + " 270 ret obj_from_u256_pieces -> Ok(U256(obj#199))": "cpu:28669, mem:2432, objs:-/100@72aa4d1", + " 271 call obj_from_u256_pieces(854729243539327218, 14181304886955281704, 12059208175304010597, 16702944845996181439)": "", + " 272 ret obj_from_u256_pieces -> Ok(U256(obj#201))": "cpu:29170, mem:2496, objs:-/101@898aec71", + " 273 call obj_from_u256_pieces(11497158191995684079, 43326291776979156, 14533160951240524555, 12852174102015084654)": "", + " 274 ret obj_from_u256_pieces -> Ok(U256(obj#203))": "cpu:29671, mem:2560, objs:-/102@a0762125", + " 275 call vec_new_from_slice(10)": "", + " 276 ret vec_new_from_slice -> Ok(Vec(obj#205))": "cpu:31262, mem:2720, objs:-/103@d1b8c868", + " 277 call bls12_381_g1_msm(Vec(obj#183), Vec(obj#205))": "", + " 278 call vec_len(Vec(obj#183))": "cpu:31384", + " 279 ret vec_len -> Ok(U32(10))": "cpu:31506", + " 280 call vec_len(Vec(obj#205))": "cpu:7376871, mem:3696", + " 281 ret vec_len -> Ok(U32(10))": "cpu:7376993", + " 282 ret bls12_381_g1_msm -> Ok(Bytes(obj#207))": "cpu:17450878, mem:141410, objs:-/104@5e3fb337", + " 283 call vec_get(Vec(obj#183), U32(0))": "cpu:17453185, mem:141586, objs:-/105@cc1ad99a", + " 284 ret vec_get -> Ok(Bytes(obj#163))": "cpu:17453411", + " 285 call vec_get(Vec(obj#205), U32(0))": "", + " 286 ret vec_get -> Ok(U256(obj#185))": "cpu:17453637", + " 287 call bls12_381_g1_mul(Bytes(obj#163), U256(obj#185))": "", + " 288 ret bls12_381_g1_mul -> Ok(Bytes(obj#211))": "cpu:20744284, mem:141762, objs:-/106@4d87b466", + " 289 call bls12_381_g1_add(Bytes(obj#209), Bytes(obj#211))": "", + " 290 ret bls12_381_g1_add -> Ok(Bytes(obj#213))": "cpu:20855035, mem:141938, objs:-/107@a668862", + " 291 call vec_get(Vec(obj#183), U32(1))": "", + " 292 ret vec_get -> Ok(Bytes(obj#165))": "cpu:20855261", + " 293 call vec_get(Vec(obj#205), U32(1))": "", + " 294 ret vec_get -> Ok(U256(obj#187))": "cpu:20855487", + " 295 call bls12_381_g1_mul(Bytes(obj#165), U256(obj#187))": "", + " 296 ret bls12_381_g1_mul -> Ok(Bytes(obj#215))": "cpu:24146134, mem:142114, objs:-/108@26939bdb", + " 297 call bls12_381_g1_add(Bytes(obj#213), Bytes(obj#215))": "", + " 298 ret bls12_381_g1_add -> Ok(Bytes(obj#217))": "cpu:24256885, mem:142290, objs:-/109@afa942f2", + " 299 call vec_get(Vec(obj#183), U32(2))": "", + " 300 ret vec_get -> Ok(Bytes(obj#167))": "cpu:24257111", + " 301 call vec_get(Vec(obj#205), U32(2))": "", + " 302 ret vec_get -> Ok(U256(obj#189))": "cpu:24257337", + " 303 call bls12_381_g1_mul(Bytes(obj#167), U256(obj#189))": "", + " 304 ret bls12_381_g1_mul -> Ok(Bytes(obj#219))": "cpu:27547984, mem:142466, objs:-/110@80ebabcb", + " 305 call bls12_381_g1_add(Bytes(obj#217), Bytes(obj#219))": "", + " 306 ret bls12_381_g1_add -> Ok(Bytes(obj#221))": "cpu:27658735, mem:142642, objs:-/111@c5129985", + " 307 call vec_get(Vec(obj#183), U32(3))": "", + " 308 ret vec_get -> Ok(Bytes(obj#169))": "cpu:27658961", + " 309 call vec_get(Vec(obj#205), U32(3))": "", + " 310 ret vec_get -> Ok(U256(obj#191))": "cpu:27659187", + " 311 call bls12_381_g1_mul(Bytes(obj#169), U256(obj#191))": "", + " 312 ret bls12_381_g1_mul -> Ok(Bytes(obj#223))": "cpu:30949834, mem:142818, objs:-/112@185b22ec", + " 313 call bls12_381_g1_add(Bytes(obj#221), Bytes(obj#223))": "", + " 314 ret bls12_381_g1_add -> Ok(Bytes(obj#225))": "cpu:31060585, mem:142994, objs:-/113@c4f97300", + " 315 call vec_get(Vec(obj#183), U32(4))": "", + " 316 ret vec_get -> Ok(Bytes(obj#171))": "cpu:31060811", + " 317 call vec_get(Vec(obj#205), U32(4))": "", + " 318 ret vec_get -> Ok(U256(obj#193))": "cpu:31061037", + " 319 call bls12_381_g1_mul(Bytes(obj#171), U256(obj#193))": "", + " 320 ret bls12_381_g1_mul -> Ok(Bytes(obj#227))": "cpu:34351684, mem:143170, objs:-/114@5dcb2245", + " 321 call bls12_381_g1_add(Bytes(obj#225), Bytes(obj#227))": "", + " 322 ret bls12_381_g1_add -> Ok(Bytes(obj#229))": "cpu:34462435, mem:143346, objs:-/115@9b8b7719", + " 323 call vec_get(Vec(obj#183), U32(5))": "", + " 324 ret vec_get -> Ok(Bytes(obj#173))": "cpu:34462661", + " 325 call vec_get(Vec(obj#205), U32(5))": "", + " 326 ret vec_get -> Ok(U256(obj#195))": "cpu:34462887", + " 327 call bls12_381_g1_mul(Bytes(obj#173), U256(obj#195))": "", + " 328 ret bls12_381_g1_mul -> Ok(Bytes(obj#231))": "cpu:37753534, mem:143522, objs:-/116@7e32132b", + " 329 call bls12_381_g1_add(Bytes(obj#229), Bytes(obj#231))": "", + " 330 ret bls12_381_g1_add -> Ok(Bytes(obj#233))": "cpu:37864285, mem:143698, objs:-/117@820927b5", + " 331 call vec_get(Vec(obj#183), U32(6))": "", + " 332 ret vec_get -> Ok(Bytes(obj#175))": "cpu:37864511", + " 333 call vec_get(Vec(obj#205), U32(6))": "", + " 334 ret vec_get -> Ok(U256(obj#197))": "cpu:37864737", + " 335 call bls12_381_g1_mul(Bytes(obj#175), U256(obj#197))": "", + " 336 ret bls12_381_g1_mul -> Ok(Bytes(obj#235))": "cpu:41155384, mem:143874, objs:-/118@734cedc3", + " 337 call bls12_381_g1_add(Bytes(obj#233), Bytes(obj#235))": "", + " 338 ret bls12_381_g1_add -> Ok(Bytes(obj#237))": "cpu:41266135, mem:144050, objs:-/119@9f782901", + " 339 call vec_get(Vec(obj#183), U32(7))": "", + " 340 ret vec_get -> Ok(Bytes(obj#177))": "cpu:41266361", + " 341 call vec_get(Vec(obj#205), U32(7))": "", + " 342 ret vec_get -> Ok(U256(obj#199))": "cpu:41266587", + " 343 call bls12_381_g1_mul(Bytes(obj#177), U256(obj#199))": "", + " 344 ret bls12_381_g1_mul -> Ok(Bytes(obj#239))": "cpu:44557234, mem:144226, objs:-/120@6222b65f", + " 345 call bls12_381_g1_add(Bytes(obj#237), Bytes(obj#239))": "", + " 346 ret bls12_381_g1_add -> Ok(Bytes(obj#241))": "cpu:44667985, mem:144402, objs:-/121@ec08d7b8", + " 347 call vec_get(Vec(obj#183), U32(8))": "", + " 348 ret vec_get -> Ok(Bytes(obj#179))": "cpu:44668211", + " 349 call vec_get(Vec(obj#205), U32(8))": "", + " 350 ret vec_get -> Ok(U256(obj#201))": "cpu:44668437", + " 351 call bls12_381_g1_mul(Bytes(obj#179), U256(obj#201))": "", + " 352 ret bls12_381_g1_mul -> Ok(Bytes(obj#243))": "cpu:47959084, mem:144578, objs:-/122@ed50266c", + " 353 call bls12_381_g1_add(Bytes(obj#241), Bytes(obj#243))": "", + " 354 ret bls12_381_g1_add -> Ok(Bytes(obj#245))": "cpu:48069835, mem:144754, objs:-/123@c4adee2a", + " 355 call vec_get(Vec(obj#183), U32(9))": "", + " 356 ret vec_get -> Ok(Bytes(obj#181))": "cpu:48070061", + " 357 call vec_get(Vec(obj#205), U32(9))": "", + " 358 ret vec_get -> Ok(U256(obj#203))": "cpu:48070287", + " 359 call bls12_381_g1_mul(Bytes(obj#181), U256(obj#203))": "", + " 360 ret bls12_381_g1_mul -> Ok(Bytes(obj#247))": "cpu:51360934, mem:144930, objs:-/124@e5cf2285", + " 361 call bls12_381_g1_add(Bytes(obj#245), Bytes(obj#247))": "", + " 362 ret bls12_381_g1_add -> Ok(Bytes(obj#249))": "cpu:51471685, mem:145106, objs:-/125@e28e8633", + " 363 call obj_cmp(Bytes(obj#249), Bytes(obj#207))": "", + " 364 ret obj_cmp -> Ok(0)": "cpu:51471985", + " 365 end": "cpu:51471985, mem:145106, prngs:-/-, objs:-/125@e28e8633, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__g2_msm.json b/soroban-env-host/observations/22/test__bls12_381__g2_msm.json index 2d22c8642..28c348986 100644 --- a/soroban-env-host/observations/22/test__bls12_381__g2_msm.json +++ b/soroban-env-host/observations/22/test__bls12_381__g2_msm.json @@ -5,296 +5,304 @@ " 3 call vec_new()": "", " 4 ret vec_new -> Ok(Vec(obj#3))": "cpu:1002, mem:128, objs:-/2@14339b3d", " 5 call bls12_381_g2_msm(Vec(obj#1), Vec(obj#3))": "", - " 6 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:1246", - " 7 call bytes_new_from_slice(192)": "cpu:3890", - " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:4899, mem:400, objs:-/3@bd2bad33", - " 9 call bytes_new_from_slice(192)": "cpu:7543", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:8552, mem:672, objs:-/4@84c0214b", - " 11 call vec_new_from_slice(2)": "", - " 12 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:9639, mem:768, objs:-/5@e2867bea", - " 13 call obj_from_u256_pieces(11753201120659576617, 12800183645227990272, 6449591311112480650, 11530214657355711865)": "", - " 14 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:10140, mem:832, objs:-/6@d2c1550a", - " 15 call obj_from_u256_pieces(17867260108045272079, 6594056455511558201, 8394146189024495608, 16477234698079725300)": "", - " 16 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:10641, mem:896, objs:-/7@b83c4f1d", - " 17 call obj_from_u256_pieces(5093470543443933884, 12596616304565341690, 2875592832172597214, 8474459150244119113)": "", - " 18 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:11142, mem:960, objs:-/8@5b2279ba", - " 19 call vec_new_from_slice(3)": "", - " 20 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:12292, mem:1064, objs:-/9@2c5030af", - " 21 call bls12_381_g2_msm(Vec(obj#9), Vec(obj#17))": "", - " 22 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:12536", - " 23 call vec_new_from_slice(3)": "cpu:27148, mem:2152, objs:-/13@c72ec5e5", - " 24 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:28298, mem:2256, objs:-/14@138c972e", - " 25 call obj_from_u256_pieces(2670602178858449459, 7519702381861979968, 12131847362652268029, 15324157160071379208)": "", - " 26 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:28799, mem:2320, objs:-/15@cca0974f", - " 27 call obj_from_u256_pieces(14448951281277473340, 10183372082303375121, 11609568207825743232, 10582668507445555283)": "", - " 28 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:29300, mem:2384, objs:-/16@338703b5", - " 29 call obj_from_u256_pieces(8613971480719722045, 14687201964851969652, 13467859308725023972, 5056481814551667924)": "", - " 30 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:29801, mem:2448, objs:-/17@e29c96a4", - " 31 call vec_new_from_slice(3)": "", - " 32 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:30951, mem:2552, objs:-/18@bd3fe61d", - " 33 call bls12_381_g2_msm(Vec(obj#27), Vec(obj#35))": "", - " 34 call vec_len(Vec(obj#27))": "cpu:31195", - " 35 ret vec_len -> Ok(U32(3))": "cpu:31317", - " 36 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:2167372, mem:3144", - " 37 call vec_new_from_slice(3)": "cpu:2171025, mem:3416, objs:-/19@fc4eae83", - " 38 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:2172175, mem:3520, objs:-/20@fc5a7848", - " 39 call obj_from_u256_pieces(10885390432521285204, 10089357480003724487, 11017657889674374380, 349979284301977343)": "", - " 40 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:2172676, mem:3584, objs:-/21@c11c1e9", - " 41 call obj_from_u256_pieces(15502034860521929120, 5197508503879521041, 10172360046471299633, 18026852881196000031)": "", - " 42 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:2173177, mem:3648, objs:-/22@fbed0030", - " 43 call obj_from_u256_pieces(7434520258580032483, 1508470301556677986, 6272863840242768080, 12830499169355232182)": "", - " 44 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:2173678, mem:3712, objs:-/23@7c759a0d", - " 45 call vec_new_from_slice(3)": "", - " 46 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:2174828, mem:3816, objs:-/24@892a5924", - " 47 call bls12_381_g2_msm(Vec(obj#39), Vec(obj#47))": "", - " 48 call vec_len(Vec(obj#39))": "cpu:2175072", - " 49 ret vec_len -> Ok(U32(3))": "cpu:2175194", - " 50 call vec_len(Vec(obj#47))": "cpu:5378993, mem:4408", - " 51 ret vec_len -> Ok(U32(3))": "cpu:5379115", - " 52 ret bls12_381_g2_msm -> Ok(Bytes(obj#49))": "cpu:20784039, mem:232758, objs:-/25@b3e2fb94", - " 53 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:20787692, mem:233030, objs:-/26@36256f36", - " 54 ret obj_cmp -> Ok(0)": "cpu:20788004", - " 55 call bytes_new_from_slice(192)": "cpu:20790648", - " 56 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:20791657, mem:233302, objs:-/27@8ed979ac", - " 57 call bytes_new_from_slice(192)": "cpu:20794301", - " 58 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:20795310, mem:233574, objs:-/28@a3eb6aea", - " 59 call bytes_new_from_slice(192)": "cpu:20797954", - " 60 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:20798963, mem:233846, objs:-/29@9bc29a7f", - " 61 call vec_new_from_slice(3)": "", - " 62 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:20800113, mem:233950, objs:-/30@379dffd4", - " 63 call vec_new_from_slice(3)": "", - " 64 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:20801080, mem:234054, objs:-/31@f3d911e6", - " 65 call bls12_381_g2_msm(Vec(obj#59), Vec(obj#61))": "", - " 66 call vec_len(Vec(obj#59))": "cpu:20801324", - " 67 ret vec_len -> Ok(U32(3))": "cpu:20801446", - " 68 call vec_len(Vec(obj#61))": "cpu:24005245, mem:234646", - " 69 ret vec_len -> Ok(U32(3))": "cpu:24005367", - " 70 ret bls12_381_g2_msm -> Ok(Bytes(obj#63))": "cpu:39410108, mem:462996, objs:-/32@99e86db8", - " 71 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:39413761, mem:463268, objs:-/33@d5a55acc", - " 72 ret obj_cmp -> Ok(0)": "cpu:39414073", - " 73 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:39421379, mem:463812, objs:-/35@52d12591", - " 74 ret obj_cmp -> Ok(-1)": "cpu:39421691", - " 75 call vec_new_from_slice(2)": "cpu:40493088, mem:464084, objs:-/36@f4b12971", - " 76 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:40494175, mem:464180, objs:-/37@43b753fc", - " 77 call vec_new_from_slice(2)": "", - " 78 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:40495140, mem:464276, objs:-/38@d88a608d", - " 79 call bls12_381_g2_msm(Vec(obj#73), Vec(obj#75))": "", - " 80 call vec_len(Vec(obj#73))": "cpu:40495384", - " 81 ret vec_len -> Ok(U32(2))": "cpu:40495506", - " 82 call vec_len(Vec(obj#75))": "cpu:42631537, mem:464676", - " 83 ret vec_len -> Ok(U32(2))": "cpu:42631659", - " 84 ret bls12_381_g2_msm -> Ok(Bytes(obj#77))": "cpu:55615126, mem:690223, objs:-/39@308f505c", - " 85 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:55618779, mem:690495, objs:-/40@9dfbcd24", - " 86 ret obj_cmp -> Ok(0)": "cpu:55619091", - " 87 call obj_from_u256_pieces(576349249354864704, 6205532040440579369, 13730557568579417905, 2677733454007168321)": "cpu:55633703, mem:691583, objs:-/44@cd73d980", - " 88 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:55634204, mem:691647, objs:-/45@d173b8e8", - " 89 call obj_from_u256_pieces(15107729625736847273, 3736362233123338213, 1310693883286457402, 15587527586950209119)": "", - " 90 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:55634705, mem:691711, objs:-/46@8a8ce1f3", - " 91 call obj_from_u256_pieces(7130333837602304766, 15809650852848135414, 16809337653702689547, 14300891233011973695)": "", - " 92 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:55635206, mem:691775, objs:-/47@eacff4b8", - " 93 call obj_from_u256_pieces(5531006726045309341, 889630097820975985, 16583573122393188327, 9061467097759417586)": "", - " 94 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:55635707, mem:691839, objs:-/48@42874a94", - " 95 call vec_new_from_slice(4)": "", - " 96 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:55636920, mem:691951, objs:-/49@239aaa14", - " 97 call vec_new_from_slice(4)": "", - " 98 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:55638133, mem:692063, objs:-/50@60ff6572", - " 99 call bls12_381_g2_msm(Vec(obj#97), Vec(obj#99))": "", - " 100 call vec_len(Vec(obj#97))": "cpu:55638377", - " 101 ret vec_len -> Ok(U32(4))": "cpu:55638499", - " 102 call vec_len(Vec(obj#99))": "cpu:59910066, mem:692847", - " 103 ret vec_len -> Ok(U32(4))": "cpu:59910188", - " 104 ret bls12_381_g2_msm -> Ok(Bytes(obj#101))": "cpu:77736447, mem:924000, objs:-/51@6bf9c3f3", - " 105 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 106 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:1213, mem:112, objs:-/52@c42f87dd", - " 107 call vec_new_from_slice(4)": "", - " 108 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:2426, mem:224, objs:-/53@6a9d8396", - " 109 call bls12_381_g2_msm(Vec(obj#103), Vec(obj#105))": "", - " 110 call vec_len(Vec(obj#103))": "cpu:2670", - " 111 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 112 call vec_len(Vec(obj#105))": "cpu:4274359, mem:1008", - " 113 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 114 ret bls12_381_g2_msm -> Ok(Bytes(obj#107))": "cpu:22100740, mem:232161, objs:-/54@3472db57", - " 115 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", - " 116 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 117 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 118 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:1213, mem:112, objs:-/55@472ba905", - " 119 call vec_new_from_slice(4)": "", - " 120 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:2426, mem:224, objs:-/56@e84328b6", - " 121 call bls12_381_g2_msm(Vec(obj#109), Vec(obj#111))": "", - " 122 call vec_len(Vec(obj#109))": "cpu:2670", - " 123 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 124 call vec_len(Vec(obj#111))": "cpu:4274359, mem:1008", - " 125 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 126 ret bls12_381_g2_msm -> Ok(Bytes(obj#113))": "cpu:22100740, mem:232161, objs:-/57@5cd90966", - " 127 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", - " 128 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 129 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 130 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:1213, mem:112, objs:-/58@5477447f", - " 131 call vec_new_from_slice(4)": "", - " 132 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:2426, mem:224, objs:-/59@42339f28", - " 133 call bls12_381_g2_msm(Vec(obj#115), Vec(obj#117))": "", - " 134 call vec_len(Vec(obj#115))": "cpu:2670", - " 135 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 136 call vec_len(Vec(obj#117))": "cpu:4274359, mem:1008", - " 137 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 138 ret bls12_381_g2_msm -> Ok(Bytes(obj#119))": "cpu:22100740, mem:232161, objs:-/60@142a3f6", - " 139 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", - " 140 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 141 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 142 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:1213, mem:112, objs:-/61@f554fdda", - " 143 call vec_new_from_slice(4)": "", - " 144 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:2426, mem:224, objs:-/62@392d78a5", - " 145 call bls12_381_g2_msm(Vec(obj#121), Vec(obj#123))": "", - " 146 call vec_len(Vec(obj#121))": "cpu:2670", - " 147 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 148 call vec_len(Vec(obj#123))": "cpu:4274359, mem:1008", - " 149 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 150 ret bls12_381_g2_msm -> Ok(Bytes(obj#125))": "cpu:22100740, mem:232161, objs:-/63@a37c7b18", - " 151 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", - " 152 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 153 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 154 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:1213, mem:112, objs:-/64@d830e19", - " 155 call vec_new_from_slice(4)": "", - " 156 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:2426, mem:224, objs:-/65@de9f2d72", - " 157 call bls12_381_g2_msm(Vec(obj#127), Vec(obj#129))": "", - " 158 call vec_len(Vec(obj#127))": "cpu:2670", - " 159 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 160 call vec_len(Vec(obj#129))": "cpu:4274359, mem:1008", - " 161 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 162 ret bls12_381_g2_msm -> Ok(Bytes(obj#131))": "cpu:22100740, mem:232161, objs:-/66@12bd397c", - " 163 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", - " 164 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 165 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 166 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:1213, mem:112, objs:-/67@9fc98ec8", - " 167 call vec_new_from_slice(4)": "", - " 168 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:2426, mem:224, objs:-/68@2e15d9f1", - " 169 call bls12_381_g2_msm(Vec(obj#133), Vec(obj#135))": "", - " 170 call vec_len(Vec(obj#133))": "cpu:2670", - " 171 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 172 call vec_len(Vec(obj#135))": "cpu:4274359, mem:1008", - " 173 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 174 ret bls12_381_g2_msm -> Ok(Bytes(obj#137))": "cpu:22100740, mem:232161, objs:-/69@516fe495", - " 175 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", - " 176 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 177 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 178 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:1213, mem:112, objs:-/70@745e9418", - " 179 call vec_new_from_slice(4)": "", - " 180 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:2426, mem:224, objs:-/71@db69de4c", - " 181 call bls12_381_g2_msm(Vec(obj#139), Vec(obj#141))": "", - " 182 call vec_len(Vec(obj#139))": "cpu:2670", - " 183 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 184 call vec_len(Vec(obj#141))": "cpu:4274359, mem:1008", - " 185 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 186 ret bls12_381_g2_msm -> Ok(Bytes(obj#143))": "cpu:22100740, mem:232161, objs:-/72@8a46f90c", - " 187 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", - " 188 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 189 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 190 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:1213, mem:112, objs:-/73@1e08429e", - " 191 call vec_new_from_slice(4)": "", - " 192 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:2426, mem:224, objs:-/74@b5ef3ee0", - " 193 call bls12_381_g2_msm(Vec(obj#145), Vec(obj#147))": "", - " 194 call vec_len(Vec(obj#145))": "cpu:2670", - " 195 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 196 call vec_len(Vec(obj#147))": "cpu:4274359, mem:1008", - " 197 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 198 ret bls12_381_g2_msm -> Ok(Bytes(obj#149))": "cpu:22100740, mem:232161, objs:-/75@5ece035c", - " 199 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", - " 200 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 201 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 202 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:1213, mem:112, objs:-/76@f42c812e", - " 203 call vec_new_from_slice(4)": "", - " 204 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:2426, mem:224, objs:-/77@a0486908", - " 205 call bls12_381_g2_msm(Vec(obj#151), Vec(obj#153))": "", - " 206 call vec_len(Vec(obj#151))": "cpu:2670", - " 207 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 208 call vec_len(Vec(obj#153))": "cpu:4274359, mem:1008", - " 209 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 210 ret bls12_381_g2_msm -> Ok(Bytes(obj#155))": "cpu:22100740, mem:232161, objs:-/78@de21d2fc", - " 211 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", - " 212 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 213 call vec_new_from_slice(4)": "cpu:0, mem:0", - " 214 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:1213, mem:112, objs:-/79@4620805c", - " 215 call vec_new_from_slice(4)": "", - " 216 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:2426, mem:224, objs:-/80@89a4898d", - " 217 call bls12_381_g2_msm(Vec(obj#157), Vec(obj#159))": "", - " 218 call vec_len(Vec(obj#157))": "cpu:2670", - " 219 ret vec_len -> Ok(U32(4))": "cpu:2792", - " 220 call vec_len(Vec(obj#159))": "cpu:4274359, mem:1008", - " 221 ret vec_len -> Ok(U32(4))": "cpu:4274481", - " 222 ret bls12_381_g2_msm -> Ok(Bytes(obj#161))": "cpu:22100740, mem:232161, objs:-/81@151aaaa4", - " 223 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", - " 224 ret obj_cmp -> Ok(0)": "cpu:22101052", - " 225 call bytes_new_from_slice(192)": "cpu:2644, mem:0", - " 226 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:3653, mem:272, objs:-/82@526b5995", - " 227 call bytes_new_from_slice(192)": "cpu:6297", - " 228 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:7306, mem:544, objs:-/83@6efe8bf2", - " 229 call bytes_new_from_slice(192)": "cpu:9950", - " 230 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:10959, mem:816, objs:-/84@d65370d1", - " 231 call bytes_new_from_slice(192)": "cpu:13603", - " 232 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:14612, mem:1088, objs:-/85@768353f3", - " 233 call bytes_new_from_slice(192)": "cpu:17256", - " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:18265, mem:1360, objs:-/86@d38309a4", - " 235 call vec_new_from_slice(5)": "", - " 236 ret vec_new_from_slice -> Ok(Vec(obj#173))": "cpu:19541, mem:1480, objs:-/87@3939bbac", - " 237 call obj_from_u256_pieces(17073613341124213686, 9800153404225276109, 6607116724722439497, 842746758976683084)": "", - " 238 ret obj_from_u256_pieces -> Ok(U256(obj#175))": "cpu:20042, mem:1544, objs:-/88@a1c554a1", - " 239 call obj_from_u256_pieces(16040841695964229797, 5061605267848115623, 14000740750614834722, 13904863006945675968)": "", - " 240 ret obj_from_u256_pieces -> Ok(U256(obj#177))": "cpu:20543, mem:1608, objs:-/89@5dbca5f2", - " 241 call obj_from_u256_pieces(5830218664442262694, 4114147737062195718, 16434537214804972826, 1396935906550304884)": "", - " 242 ret obj_from_u256_pieces -> Ok(U256(obj#179))": "cpu:21044, mem:1672, objs:-/90@329f03eb", - " 243 call obj_from_u256_pieces(8756542147870587062, 2334579494105318157, 3880849428716171604, 577514052903835922)": "", - " 244 ret obj_from_u256_pieces -> Ok(U256(obj#181))": "cpu:21545, mem:1736, objs:-/91@8451f38d", - " 245 call obj_from_u256_pieces(5259919734814292314, 1486637374753912723, 9060486243487422013, 18066450239200677051)": "", - " 246 ret obj_from_u256_pieces -> Ok(U256(obj#183))": "cpu:22046, mem:1800, objs:-/92@c5a670c", - " 247 call vec_new_from_slice(5)": "", - " 248 ret vec_new_from_slice -> Ok(Vec(obj#185))": "cpu:23322, mem:1920, objs:-/93@80ddd82c", - " 249 call bls12_381_g2_msm(Vec(obj#173), Vec(obj#185))": "", - " 250 call vec_len(Vec(obj#173))": "cpu:23566", - " 251 ret vec_len -> Ok(U32(5))": "cpu:23688", - " 252 call vec_len(Vec(obj#185))": "cpu:5363023, mem:2896", - " 253 ret vec_len -> Ok(U32(5))": "cpu:5363145", - " 254 ret bls12_381_g2_msm -> Ok(Bytes(obj#187))": "cpu:25610739, mem:236852, objs:-/94@37bd5b7d", - " 255 call vec_get(Vec(obj#173), U32(0))": "cpu:25614392, mem:237124, objs:-/95@47f3520c", - " 256 ret vec_get -> Ok(Bytes(obj#163))": "cpu:25614618", - " 257 call vec_get(Vec(obj#185), U32(0))": "", - " 258 ret vec_get -> Ok(U256(obj#175))": "cpu:25614844", - " 259 call bls12_381_g2_mul(Bytes(obj#163), U256(obj#175))": "", - " 260 ret bls12_381_g2_mul -> Ok(Bytes(obj#191))": "cpu:34662440, mem:237396, objs:-/96@8cc676a4", - " 261 call bls12_381_g2_add(Bytes(obj#189), Bytes(obj#191))": "", - " 262 ret bls12_381_g2_add -> Ok(Bytes(obj#193))": "cpu:34812069, mem:237668, objs:-/97@fd5accef", - " 263 call vec_get(Vec(obj#173), U32(1))": "", - " 264 ret vec_get -> Ok(Bytes(obj#165))": "cpu:34812295", - " 265 call vec_get(Vec(obj#185), U32(1))": "", - " 266 ret vec_get -> Ok(U256(obj#177))": "cpu:34812521", - " 267 call bls12_381_g2_mul(Bytes(obj#165), U256(obj#177))": "", - " 268 ret bls12_381_g2_mul -> Ok(Bytes(obj#195))": "cpu:43860117, mem:237940, objs:-/98@287ee088", - " 269 call bls12_381_g2_add(Bytes(obj#193), Bytes(obj#195))": "", - " 270 ret bls12_381_g2_add -> Ok(Bytes(obj#197))": "cpu:44009746, mem:238212, objs:-/99@85bfd7f9", - " 271 call vec_get(Vec(obj#173), U32(2))": "", - " 272 ret vec_get -> Ok(Bytes(obj#167))": "cpu:44009972", - " 273 call vec_get(Vec(obj#185), U32(2))": "", - " 274 ret vec_get -> Ok(U256(obj#179))": "cpu:44010198", - " 275 call bls12_381_g2_mul(Bytes(obj#167), U256(obj#179))": "", - " 276 ret bls12_381_g2_mul -> Ok(Bytes(obj#199))": "cpu:53057794, mem:238484, objs:-/100@83eb557e", - " 277 call bls12_381_g2_add(Bytes(obj#197), Bytes(obj#199))": "", - " 278 ret bls12_381_g2_add -> Ok(Bytes(obj#201))": "cpu:53207423, mem:238756, objs:-/101@356eda48", - " 279 call vec_get(Vec(obj#173), U32(3))": "", - " 280 ret vec_get -> Ok(Bytes(obj#169))": "cpu:53207649", - " 281 call vec_get(Vec(obj#185), U32(3))": "", - " 282 ret vec_get -> Ok(U256(obj#181))": "cpu:53207875", - " 283 call bls12_381_g2_mul(Bytes(obj#169), U256(obj#181))": "", - " 284 ret bls12_381_g2_mul -> Ok(Bytes(obj#203))": "cpu:62255471, mem:239028, objs:-/102@633754c7", - " 285 call bls12_381_g2_add(Bytes(obj#201), Bytes(obj#203))": "", - " 286 ret bls12_381_g2_add -> Ok(Bytes(obj#205))": "cpu:62405100, mem:239300, objs:-/103@d51e3c43", - " 287 call vec_get(Vec(obj#173), U32(4))": "", - " 288 ret vec_get -> Ok(Bytes(obj#171))": "cpu:62405326", - " 289 call vec_get(Vec(obj#185), U32(4))": "", - " 290 ret vec_get -> Ok(U256(obj#183))": "cpu:62405552", - " 291 call bls12_381_g2_mul(Bytes(obj#171), U256(obj#183))": "", - " 292 ret bls12_381_g2_mul -> Ok(Bytes(obj#207))": "cpu:71453148, mem:239572, objs:-/104@e5da1eed", - " 293 call bls12_381_g2_add(Bytes(obj#205), Bytes(obj#207))": "", - " 294 ret bls12_381_g2_add -> Ok(Bytes(obj#209))": "cpu:71602777, mem:239844, objs:-/105@395f149e", - " 295 call obj_cmp(Bytes(obj#209), Bytes(obj#187))": "", - " 296 ret obj_cmp -> Ok(0)": "cpu:71603089", - " 297 end": "cpu:71603089, mem:239844, prngs:-/-, objs:-/105@395f149e, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 6 call vec_len(Vec(obj#1))": "cpu:1124", + " 7 ret vec_len -> Ok(U32(0))": "cpu:1246", + " 8 call vec_len(Vec(obj#3))": "cpu:1741, mem:144", + " 9 ret vec_len -> Ok(U32(0))": "cpu:1863", + " 10 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:8038326, mem:219814", + " 11 call bytes_new_from_slice(192)": "cpu:8040970", + " 12 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:8041979, mem:220086, objs:-/3@bd2bad33", + " 13 call bytes_new_from_slice(192)": "cpu:8044623", + " 14 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:8045632, mem:220358, objs:-/4@84c0214b", + " 15 call vec_new_from_slice(2)": "", + " 16 ret vec_new_from_slice -> Ok(Vec(obj#9))": "cpu:8046719, mem:220454, objs:-/5@e2867bea", + " 17 call obj_from_u256_pieces(11753201120659576617, 12800183645227990272, 6449591311112480650, 11530214657355711865)": "", + " 18 ret obj_from_u256_pieces -> Ok(U256(obj#11))": "cpu:8047220, mem:220518, objs:-/6@d2c1550a", + " 19 call obj_from_u256_pieces(17867260108045272079, 6594056455511558201, 8394146189024495608, 16477234698079725300)": "", + " 20 ret obj_from_u256_pieces -> Ok(U256(obj#13))": "cpu:8047721, mem:220582, objs:-/7@b83c4f1d", + " 21 call obj_from_u256_pieces(5093470543443933884, 12596616304565341690, 2875592832172597214, 8474459150244119113)": "", + " 22 ret obj_from_u256_pieces -> Ok(U256(obj#15))": "cpu:8048222, mem:220646, objs:-/8@5b2279ba", + " 23 call vec_new_from_slice(3)": "", + " 24 ret vec_new_from_slice -> Ok(Vec(obj#17))": "cpu:8049372, mem:220750, objs:-/9@2c5030af", + " 25 call bls12_381_g2_msm(Vec(obj#9), Vec(obj#17))": "", + " 26 call vec_len(Vec(obj#9))": "cpu:8049494", + " 27 ret vec_len -> Ok(U32(2))": "cpu:8049616", + " 28 call vec_len(Vec(obj#17))": "cpu:10185647, mem:221150", + " 29 ret vec_len -> Ok(U32(3))": "cpu:10185769", + " 30 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:23066961, mem:446457", + " 31 call vec_new_from_slice(3)": "cpu:23081573, mem:447545, objs:-/13@c72ec5e5", + " 32 ret vec_new_from_slice -> Ok(Vec(obj#27))": "cpu:23082723, mem:447649, objs:-/14@138c972e", + " 33 call obj_from_u256_pieces(2670602178858449459, 7519702381861979968, 12131847362652268029, 15324157160071379208)": "", + " 34 ret obj_from_u256_pieces -> Ok(U256(obj#29))": "cpu:23083224, mem:447713, objs:-/15@cca0974f", + " 35 call obj_from_u256_pieces(14448951281277473340, 10183372082303375121, 11609568207825743232, 10582668507445555283)": "", + " 36 ret obj_from_u256_pieces -> Ok(U256(obj#31))": "cpu:23083725, mem:447777, objs:-/16@338703b5", + " 37 call obj_from_u256_pieces(8613971480719722045, 14687201964851969652, 13467859308725023972, 5056481814551667924)": "", + " 38 ret obj_from_u256_pieces -> Ok(U256(obj#33))": "cpu:23084226, mem:447841, objs:-/17@e29c96a4", + " 39 call vec_new_from_slice(3)": "", + " 40 ret vec_new_from_slice -> Ok(Vec(obj#35))": "cpu:23085376, mem:447945, objs:-/18@bd3fe61d", + " 41 call bls12_381_g2_msm(Vec(obj#27), Vec(obj#35))": "", + " 42 call vec_len(Vec(obj#27))": "cpu:23085498", + " 43 ret vec_len -> Ok(U32(3))": "cpu:23085620", + " 44 ret bls12_381_g2_msm -> Err(Error(Crypto, InvalidInput))": "cpu:25221675, mem:448537", + " 45 call vec_new_from_slice(3)": "cpu:25225328, mem:448809, objs:-/19@fc4eae83", + " 46 ret vec_new_from_slice -> Ok(Vec(obj#39))": "cpu:25226478, mem:448913, objs:-/20@fc5a7848", + " 47 call obj_from_u256_pieces(10885390432521285204, 10089357480003724487, 11017657889674374380, 349979284301977343)": "", + " 48 ret obj_from_u256_pieces -> Ok(U256(obj#41))": "cpu:25226979, mem:448977, objs:-/21@c11c1e9", + " 49 call obj_from_u256_pieces(15502034860521929120, 5197508503879521041, 10172360046471299633, 18026852881196000031)": "", + " 50 ret obj_from_u256_pieces -> Ok(U256(obj#43))": "cpu:25227480, mem:449041, objs:-/22@fbed0030", + " 51 call obj_from_u256_pieces(7434520258580032483, 1508470301556677986, 6272863840242768080, 12830499169355232182)": "", + " 52 ret obj_from_u256_pieces -> Ok(U256(obj#45))": "cpu:25227981, mem:449105, objs:-/23@7c759a0d", + " 53 call vec_new_from_slice(3)": "", + " 54 ret vec_new_from_slice -> Ok(Vec(obj#47))": "cpu:25229131, mem:449209, objs:-/24@892a5924", + " 55 call bls12_381_g2_msm(Vec(obj#39), Vec(obj#47))": "", + " 56 call vec_len(Vec(obj#39))": "cpu:25229253", + " 57 ret vec_len -> Ok(U32(3))": "cpu:25229375", + " 58 call vec_len(Vec(obj#47))": "cpu:28433174, mem:449801", + " 59 ret vec_len -> Ok(U32(3))": "cpu:28433296", + " 60 ret bls12_381_g2_msm -> Ok(Bytes(obj#49))": "cpu:43838220, mem:678151, objs:-/25@b3e2fb94", + " 61 call obj_cmp(Bytes(obj#49), Bytes(obj#51))": "cpu:43841873, mem:678423, objs:-/26@36256f36", + " 62 ret obj_cmp -> Ok(0)": "cpu:43842185", + " 63 call bytes_new_from_slice(192)": "cpu:43844829", + " 64 ret bytes_new_from_slice -> Ok(Bytes(obj#53))": "cpu:43845838, mem:678695, objs:-/27@8ed979ac", + " 65 call bytes_new_from_slice(192)": "cpu:43848482", + " 66 ret bytes_new_from_slice -> Ok(Bytes(obj#55))": "cpu:43849491, mem:678967, objs:-/28@a3eb6aea", + " 67 call bytes_new_from_slice(192)": "cpu:43852135", + " 68 ret bytes_new_from_slice -> Ok(Bytes(obj#57))": "cpu:43853144, mem:679239, objs:-/29@9bc29a7f", + " 69 call vec_new_from_slice(3)": "", + " 70 ret vec_new_from_slice -> Ok(Vec(obj#59))": "cpu:43854294, mem:679343, objs:-/30@379dffd4", + " 71 call vec_new_from_slice(3)": "", + " 72 ret vec_new_from_slice -> Ok(Vec(obj#61))": "cpu:43855261, mem:679447, objs:-/31@f3d911e6", + " 73 call bls12_381_g2_msm(Vec(obj#59), Vec(obj#61))": "", + " 74 call vec_len(Vec(obj#59))": "cpu:43855383", + " 75 ret vec_len -> Ok(U32(3))": "cpu:43855505", + " 76 call vec_len(Vec(obj#61))": "cpu:47059304, mem:680039", + " 77 ret vec_len -> Ok(U32(3))": "cpu:47059426", + " 78 ret bls12_381_g2_msm -> Ok(Bytes(obj#63))": "cpu:62464167, mem:908389, objs:-/32@99e86db8", + " 79 call obj_cmp(Bytes(obj#63), Bytes(obj#65))": "cpu:62467820, mem:908661, objs:-/33@d5a55acc", + " 80 ret obj_cmp -> Ok(0)": "cpu:62468132", + " 81 call obj_cmp(Bytes(obj#67), Bytes(obj#69))": "cpu:7306, mem:544, objs:-/35@52d12591", + " 82 ret obj_cmp -> Ok(-1)": "cpu:7618", + " 83 call vec_new_from_slice(2)": "cpu:1079015, mem:816, objs:-/36@f4b12971", + " 84 ret vec_new_from_slice -> Ok(Vec(obj#73))": "cpu:1080102, mem:912, objs:-/37@43b753fc", + " 85 call vec_new_from_slice(2)": "", + " 86 ret vec_new_from_slice -> Ok(Vec(obj#75))": "cpu:1081067, mem:1008, objs:-/38@d88a608d", + " 87 call bls12_381_g2_msm(Vec(obj#73), Vec(obj#75))": "", + " 88 call vec_len(Vec(obj#73))": "cpu:1081189", + " 89 ret vec_len -> Ok(U32(2))": "cpu:1081311", + " 90 call vec_len(Vec(obj#75))": "cpu:3217342, mem:1408", + " 91 ret vec_len -> Ok(U32(2))": "cpu:3217464", + " 92 ret bls12_381_g2_msm -> Ok(Bytes(obj#77))": "cpu:16200931, mem:226955, objs:-/39@308f505c", + " 93 call obj_cmp(Bytes(obj#77), Bytes(obj#79))": "cpu:16204584, mem:227227, objs:-/40@9dfbcd24", + " 94 ret obj_cmp -> Ok(0)": "cpu:16204896", + " 95 call obj_from_u256_pieces(576349249354864704, 6205532040440579369, 13730557568579417905, 2677733454007168321)": "cpu:16219508, mem:228315, objs:-/44@cd73d980", + " 96 ret obj_from_u256_pieces -> Ok(U256(obj#89))": "cpu:16220009, mem:228379, objs:-/45@d173b8e8", + " 97 call obj_from_u256_pieces(15107729625736847273, 3736362233123338213, 1310693883286457402, 15587527586950209119)": "", + " 98 ret obj_from_u256_pieces -> Ok(U256(obj#91))": "cpu:16220510, mem:228443, objs:-/46@8a8ce1f3", + " 99 call obj_from_u256_pieces(7130333837602304766, 15809650852848135414, 16809337653702689547, 14300891233011973695)": "", + " 100 ret obj_from_u256_pieces -> Ok(U256(obj#93))": "cpu:16221011, mem:228507, objs:-/47@eacff4b8", + " 101 call obj_from_u256_pieces(5531006726045309341, 889630097820975985, 16583573122393188327, 9061467097759417586)": "", + " 102 ret obj_from_u256_pieces -> Ok(U256(obj#95))": "cpu:16221512, mem:228571, objs:-/48@42874a94", + " 103 call vec_new_from_slice(4)": "", + " 104 ret vec_new_from_slice -> Ok(Vec(obj#97))": "cpu:16222725, mem:228683, objs:-/49@239aaa14", + " 105 call vec_new_from_slice(4)": "", + " 106 ret vec_new_from_slice -> Ok(Vec(obj#99))": "cpu:16223938, mem:228795, objs:-/50@60ff6572", + " 107 call bls12_381_g2_msm(Vec(obj#97), Vec(obj#99))": "", + " 108 call vec_len(Vec(obj#97))": "cpu:16224060", + " 109 ret vec_len -> Ok(U32(4))": "cpu:16224182", + " 110 call vec_len(Vec(obj#99))": "cpu:20495749, mem:229579", + " 111 ret vec_len -> Ok(U32(4))": "cpu:20495871", + " 112 ret bls12_381_g2_msm -> Ok(Bytes(obj#101))": "cpu:38322130, mem:460732, objs:-/51@6bf9c3f3", + " 113 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 114 ret vec_new_from_slice -> Ok(Vec(obj#103))": "cpu:1213, mem:112, objs:-/52@c42f87dd", + " 115 call vec_new_from_slice(4)": "", + " 116 ret vec_new_from_slice -> Ok(Vec(obj#105))": "cpu:2426, mem:224, objs:-/53@6a9d8396", + " 117 call bls12_381_g2_msm(Vec(obj#103), Vec(obj#105))": "", + " 118 call vec_len(Vec(obj#103))": "cpu:2548", + " 119 ret vec_len -> Ok(U32(4))": "cpu:2670", + " 120 call vec_len(Vec(obj#105))": "cpu:4274237, mem:1008", + " 121 ret vec_len -> Ok(U32(4))": "cpu:4274359", + " 122 ret bls12_381_g2_msm -> Ok(Bytes(obj#107))": "cpu:22100618, mem:232161, objs:-/54@3472db57", + " 123 call obj_cmp(Bytes(obj#107), Bytes(obj#101))": "", + " 124 ret obj_cmp -> Ok(0)": "cpu:22100930", + " 125 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 126 ret vec_new_from_slice -> Ok(Vec(obj#109))": "cpu:1213, mem:112, objs:-/55@472ba905", + " 127 call vec_new_from_slice(4)": "", + " 128 ret vec_new_from_slice -> Ok(Vec(obj#111))": "cpu:2426, mem:224, objs:-/56@e84328b6", + " 129 call bls12_381_g2_msm(Vec(obj#109), Vec(obj#111))": "", + " 130 call vec_len(Vec(obj#109))": "cpu:2548", + " 131 ret vec_len -> Ok(U32(4))": "cpu:2670", + " 132 call vec_len(Vec(obj#111))": "cpu:4274237, mem:1008", + " 133 ret vec_len -> Ok(U32(4))": "cpu:4274359", + " 134 ret bls12_381_g2_msm -> Ok(Bytes(obj#113))": "cpu:22100618, mem:232161, objs:-/57@5cd90966", + " 135 call obj_cmp(Bytes(obj#113), Bytes(obj#101))": "", + " 136 ret obj_cmp -> Ok(0)": "cpu:22100930", + " 137 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 138 ret vec_new_from_slice -> Ok(Vec(obj#115))": "cpu:1213, mem:112, objs:-/58@5477447f", + " 139 call vec_new_from_slice(4)": "", + " 140 ret vec_new_from_slice -> Ok(Vec(obj#117))": "cpu:2426, mem:224, objs:-/59@42339f28", + " 141 call bls12_381_g2_msm(Vec(obj#115), Vec(obj#117))": "", + " 142 call vec_len(Vec(obj#115))": "cpu:2548", + " 143 ret vec_len -> Ok(U32(4))": "cpu:2670", + " 144 call vec_len(Vec(obj#117))": "cpu:4274237, mem:1008", + " 145 ret vec_len -> Ok(U32(4))": "cpu:4274359", + " 146 ret bls12_381_g2_msm -> Ok(Bytes(obj#119))": "cpu:22100618, mem:232161, objs:-/60@142a3f6", + " 147 call obj_cmp(Bytes(obj#119), Bytes(obj#101))": "", + " 148 ret obj_cmp -> Ok(0)": "cpu:22100930", + " 149 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 150 ret vec_new_from_slice -> Ok(Vec(obj#121))": "cpu:1213, mem:112, objs:-/61@f554fdda", + " 151 call vec_new_from_slice(4)": "", + " 152 ret vec_new_from_slice -> Ok(Vec(obj#123))": "cpu:2426, mem:224, objs:-/62@392d78a5", + " 153 call bls12_381_g2_msm(Vec(obj#121), Vec(obj#123))": "", + " 154 call vec_len(Vec(obj#121))": "cpu:2548", + " 155 ret vec_len -> Ok(U32(4))": "cpu:2670", + " 156 call vec_len(Vec(obj#123))": "cpu:4274237, mem:1008", + " 157 ret vec_len -> Ok(U32(4))": "cpu:4274359", + " 158 ret bls12_381_g2_msm -> Ok(Bytes(obj#125))": "cpu:22100618, mem:232161, objs:-/63@a37c7b18", + " 159 call obj_cmp(Bytes(obj#125), Bytes(obj#101))": "", + " 160 ret obj_cmp -> Ok(0)": "cpu:22100930", + " 161 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 162 ret vec_new_from_slice -> Ok(Vec(obj#127))": "cpu:1213, mem:112, objs:-/64@d830e19", + " 163 call vec_new_from_slice(4)": "", + " 164 ret vec_new_from_slice -> Ok(Vec(obj#129))": "cpu:2426, mem:224, objs:-/65@de9f2d72", + " 165 call bls12_381_g2_msm(Vec(obj#127), Vec(obj#129))": "", + " 166 call vec_len(Vec(obj#127))": "cpu:2548", + " 167 ret vec_len -> Ok(U32(4))": "cpu:2670", + " 168 call vec_len(Vec(obj#129))": "cpu:4274237, mem:1008", + " 169 ret vec_len -> Ok(U32(4))": "cpu:4274359", + " 170 ret bls12_381_g2_msm -> Ok(Bytes(obj#131))": "cpu:22100618, mem:232161, objs:-/66@12bd397c", + " 171 call obj_cmp(Bytes(obj#131), Bytes(obj#101))": "", + " 172 ret obj_cmp -> Ok(0)": "cpu:22100930", + " 173 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 174 ret vec_new_from_slice -> Ok(Vec(obj#133))": "cpu:1213, mem:112, objs:-/67@9fc98ec8", + " 175 call vec_new_from_slice(4)": "", + " 176 ret vec_new_from_slice -> Ok(Vec(obj#135))": "cpu:2426, mem:224, objs:-/68@2e15d9f1", + " 177 call bls12_381_g2_msm(Vec(obj#133), Vec(obj#135))": "", + " 178 call vec_len(Vec(obj#133))": "cpu:2548", + " 179 ret vec_len -> Ok(U32(4))": "cpu:2670", + " 180 call vec_len(Vec(obj#135))": "cpu:4274237, mem:1008", + " 181 ret vec_len -> Ok(U32(4))": "cpu:4274359", + " 182 ret bls12_381_g2_msm -> Ok(Bytes(obj#137))": "cpu:22100618, mem:232161, objs:-/69@516fe495", + " 183 call obj_cmp(Bytes(obj#137), Bytes(obj#101))": "", + " 184 ret obj_cmp -> Ok(0)": "cpu:22100930", + " 185 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 186 ret vec_new_from_slice -> Ok(Vec(obj#139))": "cpu:1213, mem:112, objs:-/70@745e9418", + " 187 call vec_new_from_slice(4)": "", + " 188 ret vec_new_from_slice -> Ok(Vec(obj#141))": "cpu:2426, mem:224, objs:-/71@db69de4c", + " 189 call bls12_381_g2_msm(Vec(obj#139), Vec(obj#141))": "", + " 190 call vec_len(Vec(obj#139))": "cpu:2548", + " 191 ret vec_len -> Ok(U32(4))": "cpu:2670", + " 192 call vec_len(Vec(obj#141))": "cpu:4274237, mem:1008", + " 193 ret vec_len -> Ok(U32(4))": "cpu:4274359", + " 194 ret bls12_381_g2_msm -> Ok(Bytes(obj#143))": "cpu:22100618, mem:232161, objs:-/72@8a46f90c", + " 195 call obj_cmp(Bytes(obj#143), Bytes(obj#101))": "", + " 196 ret obj_cmp -> Ok(0)": "cpu:22100930", + " 197 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 198 ret vec_new_from_slice -> Ok(Vec(obj#145))": "cpu:1213, mem:112, objs:-/73@1e08429e", + " 199 call vec_new_from_slice(4)": "", + " 200 ret vec_new_from_slice -> Ok(Vec(obj#147))": "cpu:2426, mem:224, objs:-/74@b5ef3ee0", + " 201 call bls12_381_g2_msm(Vec(obj#145), Vec(obj#147))": "", + " 202 call vec_len(Vec(obj#145))": "cpu:2548", + " 203 ret vec_len -> Ok(U32(4))": "cpu:2670", + " 204 call vec_len(Vec(obj#147))": "cpu:4274237, mem:1008", + " 205 ret vec_len -> Ok(U32(4))": "cpu:4274359", + " 206 ret bls12_381_g2_msm -> Ok(Bytes(obj#149))": "cpu:22100618, mem:232161, objs:-/75@5ece035c", + " 207 call obj_cmp(Bytes(obj#149), Bytes(obj#101))": "", + " 208 ret obj_cmp -> Ok(0)": "cpu:22100930", + " 209 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 210 ret vec_new_from_slice -> Ok(Vec(obj#151))": "cpu:1213, mem:112, objs:-/76@f42c812e", + " 211 call vec_new_from_slice(4)": "", + " 212 ret vec_new_from_slice -> Ok(Vec(obj#153))": "cpu:2426, mem:224, objs:-/77@a0486908", + " 213 call bls12_381_g2_msm(Vec(obj#151), Vec(obj#153))": "", + " 214 call vec_len(Vec(obj#151))": "cpu:2548", + " 215 ret vec_len -> Ok(U32(4))": "cpu:2670", + " 216 call vec_len(Vec(obj#153))": "cpu:4274237, mem:1008", + " 217 ret vec_len -> Ok(U32(4))": "cpu:4274359", + " 218 ret bls12_381_g2_msm -> Ok(Bytes(obj#155))": "cpu:22100618, mem:232161, objs:-/78@de21d2fc", + " 219 call obj_cmp(Bytes(obj#155), Bytes(obj#101))": "", + " 220 ret obj_cmp -> Ok(0)": "cpu:22100930", + " 221 call vec_new_from_slice(4)": "cpu:0, mem:0", + " 222 ret vec_new_from_slice -> Ok(Vec(obj#157))": "cpu:1213, mem:112, objs:-/79@4620805c", + " 223 call vec_new_from_slice(4)": "", + " 224 ret vec_new_from_slice -> Ok(Vec(obj#159))": "cpu:2426, mem:224, objs:-/80@89a4898d", + " 225 call bls12_381_g2_msm(Vec(obj#157), Vec(obj#159))": "", + " 226 call vec_len(Vec(obj#157))": "cpu:2548", + " 227 ret vec_len -> Ok(U32(4))": "cpu:2670", + " 228 call vec_len(Vec(obj#159))": "cpu:4274237, mem:1008", + " 229 ret vec_len -> Ok(U32(4))": "cpu:4274359", + " 230 ret bls12_381_g2_msm -> Ok(Bytes(obj#161))": "cpu:22100618, mem:232161, objs:-/81@151aaaa4", + " 231 call obj_cmp(Bytes(obj#161), Bytes(obj#101))": "", + " 232 ret obj_cmp -> Ok(0)": "cpu:22100930", + " 233 call bytes_new_from_slice(192)": "cpu:2644, mem:0", + " 234 ret bytes_new_from_slice -> Ok(Bytes(obj#163))": "cpu:3653, mem:272, objs:-/82@526b5995", + " 235 call bytes_new_from_slice(192)": "cpu:6297", + " 236 ret bytes_new_from_slice -> Ok(Bytes(obj#165))": "cpu:7306, mem:544, objs:-/83@6efe8bf2", + " 237 call bytes_new_from_slice(192)": "cpu:9950", + " 238 ret bytes_new_from_slice -> Ok(Bytes(obj#167))": "cpu:10959, mem:816, objs:-/84@d65370d1", + " 239 call bytes_new_from_slice(192)": "cpu:13603", + " 240 ret bytes_new_from_slice -> Ok(Bytes(obj#169))": "cpu:14612, mem:1088, objs:-/85@768353f3", + " 241 call bytes_new_from_slice(192)": "cpu:17256", + " 242 ret bytes_new_from_slice -> Ok(Bytes(obj#171))": "cpu:18265, mem:1360, objs:-/86@d38309a4", + " 243 call vec_new_from_slice(5)": "", + " 244 ret vec_new_from_slice -> Ok(Vec(obj#173))": "cpu:19541, mem:1480, objs:-/87@3939bbac", + " 245 call obj_from_u256_pieces(17073613341124213686, 9800153404225276109, 6607116724722439497, 842746758976683084)": "", + " 246 ret obj_from_u256_pieces -> Ok(U256(obj#175))": "cpu:20042, mem:1544, objs:-/88@a1c554a1", + " 247 call obj_from_u256_pieces(16040841695964229797, 5061605267848115623, 14000740750614834722, 13904863006945675968)": "", + " 248 ret obj_from_u256_pieces -> Ok(U256(obj#177))": "cpu:20543, mem:1608, objs:-/89@5dbca5f2", + " 249 call obj_from_u256_pieces(5830218664442262694, 4114147737062195718, 16434537214804972826, 1396935906550304884)": "", + " 250 ret obj_from_u256_pieces -> Ok(U256(obj#179))": "cpu:21044, mem:1672, objs:-/90@329f03eb", + " 251 call obj_from_u256_pieces(8756542147870587062, 2334579494105318157, 3880849428716171604, 577514052903835922)": "", + " 252 ret obj_from_u256_pieces -> Ok(U256(obj#181))": "cpu:21545, mem:1736, objs:-/91@8451f38d", + " 253 call obj_from_u256_pieces(5259919734814292314, 1486637374753912723, 9060486243487422013, 18066450239200677051)": "", + " 254 ret obj_from_u256_pieces -> Ok(U256(obj#183))": "cpu:22046, mem:1800, objs:-/92@c5a670c", + " 255 call vec_new_from_slice(5)": "", + " 256 ret vec_new_from_slice -> Ok(Vec(obj#185))": "cpu:23322, mem:1920, objs:-/93@80ddd82c", + " 257 call bls12_381_g2_msm(Vec(obj#173), Vec(obj#185))": "", + " 258 call vec_len(Vec(obj#173))": "cpu:23444", + " 259 ret vec_len -> Ok(U32(5))": "cpu:23566", + " 260 call vec_len(Vec(obj#185))": "cpu:5362901, mem:2896", + " 261 ret vec_len -> Ok(U32(5))": "cpu:5363023", + " 262 ret bls12_381_g2_msm -> Ok(Bytes(obj#187))": "cpu:25610617, mem:236852, objs:-/94@37bd5b7d", + " 263 call vec_get(Vec(obj#173), U32(0))": "cpu:25614270, mem:237124, objs:-/95@47f3520c", + " 264 ret vec_get -> Ok(Bytes(obj#163))": "cpu:25614496", + " 265 call vec_get(Vec(obj#185), U32(0))": "", + " 266 ret vec_get -> Ok(U256(obj#175))": "cpu:25614722", + " 267 call bls12_381_g2_mul(Bytes(obj#163), U256(obj#175))": "", + " 268 ret bls12_381_g2_mul -> Ok(Bytes(obj#191))": "cpu:34662318, mem:237396, objs:-/96@8cc676a4", + " 269 call bls12_381_g2_add(Bytes(obj#189), Bytes(obj#191))": "", + " 270 ret bls12_381_g2_add -> Ok(Bytes(obj#193))": "cpu:34811947, mem:237668, objs:-/97@fd5accef", + " 271 call vec_get(Vec(obj#173), U32(1))": "", + " 272 ret vec_get -> Ok(Bytes(obj#165))": "cpu:34812173", + " 273 call vec_get(Vec(obj#185), U32(1))": "", + " 274 ret vec_get -> Ok(U256(obj#177))": "cpu:34812399", + " 275 call bls12_381_g2_mul(Bytes(obj#165), U256(obj#177))": "", + " 276 ret bls12_381_g2_mul -> Ok(Bytes(obj#195))": "cpu:43859995, mem:237940, objs:-/98@287ee088", + " 277 call bls12_381_g2_add(Bytes(obj#193), Bytes(obj#195))": "", + " 278 ret bls12_381_g2_add -> Ok(Bytes(obj#197))": "cpu:44009624, mem:238212, objs:-/99@85bfd7f9", + " 279 call vec_get(Vec(obj#173), U32(2))": "", + " 280 ret vec_get -> Ok(Bytes(obj#167))": "cpu:44009850", + " 281 call vec_get(Vec(obj#185), U32(2))": "", + " 282 ret vec_get -> Ok(U256(obj#179))": "cpu:44010076", + " 283 call bls12_381_g2_mul(Bytes(obj#167), U256(obj#179))": "", + " 284 ret bls12_381_g2_mul -> Ok(Bytes(obj#199))": "cpu:53057672, mem:238484, objs:-/100@83eb557e", + " 285 call bls12_381_g2_add(Bytes(obj#197), Bytes(obj#199))": "", + " 286 ret bls12_381_g2_add -> Ok(Bytes(obj#201))": "cpu:53207301, mem:238756, objs:-/101@356eda48", + " 287 call vec_get(Vec(obj#173), U32(3))": "", + " 288 ret vec_get -> Ok(Bytes(obj#169))": "cpu:53207527", + " 289 call vec_get(Vec(obj#185), U32(3))": "", + " 290 ret vec_get -> Ok(U256(obj#181))": "cpu:53207753", + " 291 call bls12_381_g2_mul(Bytes(obj#169), U256(obj#181))": "", + " 292 ret bls12_381_g2_mul -> Ok(Bytes(obj#203))": "cpu:62255349, mem:239028, objs:-/102@633754c7", + " 293 call bls12_381_g2_add(Bytes(obj#201), Bytes(obj#203))": "", + " 294 ret bls12_381_g2_add -> Ok(Bytes(obj#205))": "cpu:62404978, mem:239300, objs:-/103@d51e3c43", + " 295 call vec_get(Vec(obj#173), U32(4))": "", + " 296 ret vec_get -> Ok(Bytes(obj#171))": "cpu:62405204", + " 297 call vec_get(Vec(obj#185), U32(4))": "", + " 298 ret vec_get -> Ok(U256(obj#183))": "cpu:62405430", + " 299 call bls12_381_g2_mul(Bytes(obj#171), U256(obj#183))": "", + " 300 ret bls12_381_g2_mul -> Ok(Bytes(obj#207))": "cpu:71453026, mem:239572, objs:-/104@e5da1eed", + " 301 call bls12_381_g2_add(Bytes(obj#205), Bytes(obj#207))": "", + " 302 ret bls12_381_g2_add -> Ok(Bytes(obj#209))": "cpu:71602655, mem:239844, objs:-/105@395f149e", + " 303 call obj_cmp(Bytes(obj#209), Bytes(obj#187))": "", + " 304 ret obj_cmp -> Ok(0)": "cpu:71602967", + " 305 end": "cpu:71602967, mem:239844, prngs:-/-, objs:-/105@395f149e, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json b/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json index a79ebc546..b8f848fdf 100644 --- a/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json +++ b/soroban-env-host/observations/22/test__bls12_381__hash_to_g1.json @@ -5,54 +5,54 @@ " 3 call bytes_new_from_slice(12)": "", " 4 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:1924, mem:172, objs:-/2@aa596e87", " 5 call bls12_381_hash_to_g1(Bytes(obj#3), Bytes(obj#1))": "", - " 6 ret bls12_381_hash_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:2168", + " 6 ret bls12_381_hash_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:3213988, mem:9596", " 7 call bytes_new_from_slice(256)": "", - " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:3193, mem:508, objs:-/3@3a5eafff", + " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:3215013, mem:9932, objs:-/3@3a5eafff", " 9 call bytes_new_from_slice(12)": "", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:4156, mem:600, objs:-/4@88a2acc3", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:3215976, mem:10024, objs:-/4@88a2acc3", " 11 call bls12_381_hash_to_g1(Bytes(obj#7), Bytes(obj#5))": "", - " 12 ret bls12_381_hash_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:4400", + " 12 ret bls12_381_hash_to_g1 -> Err(Error(Crypto, InvalidInput))": "cpu:6428040, mem:19448", " 13 call bytes_new_from_slice(50)": "", - " 14 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:5373, mem:730, objs:-/5@28b6d694", + " 14 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:6429013, mem:19578, objs:-/5@28b6d694", " 15 call bytes_new_from_slice(0)": "", - " 16 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:6334, mem:810, objs:-/6@56ac3668", + " 16 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:6429974, mem:19658, objs:-/6@56ac3668", " 17 call bls12_381_hash_to_g1(Bytes(obj#11), Bytes(obj#9))": "", - " 18 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#13))": "cpu:3220137, mem:10410, objs:-/7@9efbbcc1", + " 18 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#13))": "cpu:9643777, mem:29258, objs:-/7@9efbbcc1", " 19 call bytes_new_from_slice(96)": "", - " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:3221122, mem:10586, objs:-/8@51896357", + " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:9644762, mem:29434, objs:-/8@51896357", " 21 call obj_cmp(Bytes(obj#13), Bytes(obj#15))": "", - " 22 ret obj_cmp -> Ok(0)": "cpu:3221422", + " 22 ret obj_cmp -> Ok(0)": "cpu:9645062", " 23 call bytes_new_from_slice(3)": "", - " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:3222383, mem:10669, objs:-/9@5ec59f82", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:9646023, mem:29517, objs:-/9@5ec59f82", " 25 call bls12_381_hash_to_g1(Bytes(obj#17), Bytes(obj#9))": "", - " 26 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#19))": "cpu:6436343, mem:20269, objs:-/10@e79bbbfb", + " 26 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#19))": "cpu:12859983, mem:39117, objs:-/10@e79bbbfb", " 27 call bytes_new_from_slice(96)": "", - " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:6437328, mem:20445, objs:-/11@68e099a7", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:12860968, mem:39293, objs:-/11@68e099a7", " 29 call obj_cmp(Bytes(obj#19), Bytes(obj#21))": "", - " 30 ret obj_cmp -> Ok(0)": "cpu:6437628", + " 30 ret obj_cmp -> Ok(0)": "cpu:12861268", " 31 call bytes_new_from_slice(16)": "", - " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:6438593, mem:20541, objs:-/12@42e4358e", + " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:12862233, mem:39389, objs:-/12@42e4358e", " 33 call bls12_381_hash_to_g1(Bytes(obj#23), Bytes(obj#9))": "", - " 34 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#25))": "cpu:9653235, mem:30141, objs:-/13@a5112be9", + " 34 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#25))": "cpu:16076875, mem:48989, objs:-/13@a5112be9", " 35 call bytes_new_from_slice(96)": "", - " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:9654220, mem:30317, objs:-/14@c90f15b6", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:16077860, mem:49165, objs:-/14@c90f15b6", " 37 call obj_cmp(Bytes(obj#25), Bytes(obj#27))": "", - " 38 ret obj_cmp -> Ok(0)": "cpu:9654520", + " 38 ret obj_cmp -> Ok(0)": "cpu:16078160", " 39 call bytes_new_from_slice(133)": "", - " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:9655513, mem:30530, objs:-/15@78b64378", + " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:16079153, mem:49378, objs:-/15@78b64378", " 41 call bls12_381_hash_to_g1(Bytes(obj#29), Bytes(obj#9))": "", - " 42 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#31))": "cpu:12876291, mem:40130, objs:-/16@eb416cc7", + " 42 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#31))": "cpu:19299931, mem:58978, objs:-/16@eb416cc7", " 43 call bytes_new_from_slice(96)": "", - " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:12877276, mem:40306, objs:-/17@14001e17", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:19300916, mem:59154, objs:-/17@14001e17", " 45 call obj_cmp(Bytes(obj#31), Bytes(obj#33))": "", - " 46 ret obj_cmp -> Ok(0)": "cpu:12877576", + " 46 ret obj_cmp -> Ok(0)": "cpu:19301216", " 47 call bytes_new_from_slice(517)": "", - " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:12878665, mem:40903, objs:-/18@3077ed4e", + " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:19302305, mem:59751, objs:-/18@3077ed4e", " 49 call bls12_381_hash_to_g1(Bytes(obj#35), Bytes(obj#9))": "", - " 50 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#37))": "cpu:16119582, mem:50503, objs:-/19@70daa102", + " 50 ret bls12_381_hash_to_g1 -> Ok(Bytes(obj#37))": "cpu:22543222, mem:69351, objs:-/19@70daa102", " 51 call bytes_new_from_slice(96)": "", - " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:16120567, mem:50679, objs:-/20@19d2fca4", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:22544207, mem:69527, objs:-/20@19d2fca4", " 53 call obj_cmp(Bytes(obj#37), Bytes(obj#39))": "", - " 54 ret obj_cmp -> Ok(0)": "cpu:16120867", - " 55 end": "cpu:16120867, mem:50679, prngs:-/-, objs:-/20@19d2fca4, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 54 ret obj_cmp -> Ok(0)": "cpu:22544507", + " 55 end": "cpu:22544507, mem:69527, prngs:-/-, objs:-/20@19d2fca4, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json b/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json index 46064e779..fbeccc98f 100644 --- a/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json +++ b/soroban-env-host/observations/22/test__bls12_381__hash_to_g2.json @@ -5,54 +5,54 @@ " 3 call bytes_new_from_slice(12)": "", " 4 ret bytes_new_from_slice -> Ok(Bytes(obj#3))": "cpu:1924, mem:172, objs:-/2@aa596e87", " 5 call bls12_381_hash_to_g2(Bytes(obj#3), Bytes(obj#1))": "", - " 6 ret bls12_381_hash_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:2168", + " 6 ret bls12_381_hash_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:7053369, mem:6988", " 7 call bytes_new_from_slice(256)": "", - " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:3193, mem:508, objs:-/3@3a5eafff", + " 8 ret bytes_new_from_slice -> Ok(Bytes(obj#5))": "cpu:7054394, mem:7324, objs:-/3@3a5eafff", " 9 call bytes_new_from_slice(12)": "", - " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:4156, mem:600, objs:-/4@88a2acc3", + " 10 ret bytes_new_from_slice -> Ok(Bytes(obj#7))": "cpu:7055357, mem:7416, objs:-/4@88a2acc3", " 11 call bls12_381_hash_to_g2(Bytes(obj#7), Bytes(obj#5))": "", - " 12 ret bls12_381_hash_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:4400", + " 12 ret bls12_381_hash_to_g2 -> Err(Error(Crypto, InvalidInput))": "cpu:14106802, mem:14232", " 13 call bytes_new_from_slice(50)": "", - " 14 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:5373, mem:730, objs:-/5@3f4657f8", + " 14 ret bytes_new_from_slice -> Ok(Bytes(obj#9))": "cpu:14107775, mem:14362, objs:-/5@3f4657f8", " 15 call bytes_new_from_slice(0)": "", - " 16 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:6334, mem:810, objs:-/6@2e40259c", + " 16 ret bytes_new_from_slice -> Ok(Bytes(obj#11))": "cpu:14108736, mem:14442, objs:-/6@2e40259c", " 17 call bls12_381_hash_to_g2(Bytes(obj#11), Bytes(obj#9))": "", - " 18 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#13))": "cpu:7060856, mem:7898, objs:-/7@2d317ca4", + " 18 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#13))": "cpu:21163258, mem:21530, objs:-/7@2d317ca4", " 19 call bytes_new_from_slice(192)": "", - " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:7061865, mem:8170, objs:-/8@f21b2fa0", + " 20 ret bytes_new_from_slice -> Ok(Bytes(obj#15))": "cpu:21164267, mem:21802, objs:-/8@f21b2fa0", " 21 call obj_cmp(Bytes(obj#13), Bytes(obj#15))": "", - " 22 ret obj_cmp -> Ok(0)": "cpu:7062177", + " 22 ret obj_cmp -> Ok(0)": "cpu:21164579", " 23 call bytes_new_from_slice(3)": "", - " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:7063138, mem:8253, objs:-/9@aba7a202", + " 24 ret bytes_new_from_slice -> Ok(Bytes(obj#17))": "cpu:21165540, mem:21885, objs:-/9@aba7a202", " 25 call bls12_381_hash_to_g2(Bytes(obj#17), Bytes(obj#9))": "", - " 26 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#19))": "cpu:14117819, mem:15341, objs:-/10@ba39dec3", + " 26 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#19))": "cpu:28220221, mem:28973, objs:-/10@ba39dec3", " 27 call bytes_new_from_slice(192)": "", - " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:14118828, mem:15613, objs:-/11@dd6c306d", + " 28 ret bytes_new_from_slice -> Ok(Bytes(obj#21))": "cpu:28221230, mem:29245, objs:-/11@dd6c306d", " 29 call obj_cmp(Bytes(obj#19), Bytes(obj#21))": "", - " 30 ret obj_cmp -> Ok(0)": "cpu:14119140", + " 30 ret obj_cmp -> Ok(0)": "cpu:28221542", " 31 call bytes_new_from_slice(16)": "", - " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:14120105, mem:15709, objs:-/12@aab36c6f", + " 32 ret bytes_new_from_slice -> Ok(Bytes(obj#23))": "cpu:28222507, mem:29341, objs:-/12@aab36c6f", " 33 call bls12_381_hash_to_g2(Bytes(obj#23), Bytes(obj#9))": "", - " 34 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#25))": "cpu:21175476, mem:22797, objs:-/13@860c1403", + " 34 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#25))": "cpu:35277878, mem:36429, objs:-/13@860c1403", " 35 call bytes_new_from_slice(192)": "", - " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:21176485, mem:23069, objs:-/14@ca75fa0f", + " 36 ret bytes_new_from_slice -> Ok(Bytes(obj#27))": "cpu:35278887, mem:36701, objs:-/14@ca75fa0f", " 37 call obj_cmp(Bytes(obj#25), Bytes(obj#27))": "", - " 38 ret obj_cmp -> Ok(0)": "cpu:21176797", + " 38 ret obj_cmp -> Ok(0)": "cpu:35279199", " 39 call bytes_new_from_slice(133)": "", - " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:21177790, mem:23282, objs:-/15@55b1f41", + " 40 ret bytes_new_from_slice -> Ok(Bytes(obj#29))": "cpu:35280192, mem:36914, objs:-/15@55b1f41", " 41 call bls12_381_hash_to_g2(Bytes(obj#29), Bytes(obj#9))": "", - " 42 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#31))": "cpu:28239374, mem:30370, objs:-/16@67cc16f5", + " 42 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#31))": "cpu:42341776, mem:44002, objs:-/16@67cc16f5", " 43 call bytes_new_from_slice(192)": "", - " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:28240383, mem:30642, objs:-/17@91beebd2", + " 44 ret bytes_new_from_slice -> Ok(Bytes(obj#33))": "cpu:42342785, mem:44274, objs:-/17@91beebd2", " 45 call obj_cmp(Bytes(obj#31), Bytes(obj#33))": "", - " 46 ret obj_cmp -> Ok(0)": "cpu:28240695", + " 46 ret obj_cmp -> Ok(0)": "cpu:42343097", " 47 call bytes_new_from_slice(517)": "", - " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:28241784, mem:31239, objs:-/18@77fa1166", + " 48 ret bytes_new_from_slice -> Ok(Bytes(obj#35))": "cpu:42344186, mem:44871, objs:-/18@77fa1166", " 49 call bls12_381_hash_to_g2(Bytes(obj#35), Bytes(obj#9))": "", - " 50 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#37))": "cpu:35323759, mem:38327, objs:-/19@42a8b15f", + " 50 ret bls12_381_hash_to_g2 -> Ok(Bytes(obj#37))": "cpu:49426161, mem:51959, objs:-/19@42a8b15f", " 51 call bytes_new_from_slice(192)": "", - " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:35324768, mem:38599, objs:-/20@dd93bdf4", + " 52 ret bytes_new_from_slice -> Ok(Bytes(obj#39))": "cpu:49427170, mem:52231, objs:-/20@dd93bdf4", " 53 call obj_cmp(Bytes(obj#37), Bytes(obj#39))": "", - " 54 ret obj_cmp -> Ok(0)": "cpu:35325080", - " 55 end": "cpu:35325080, mem:38599, prngs:-/-, objs:-/20@dd93bdf4, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" + " 54 ret obj_cmp -> Ok(0)": "cpu:49427482", + " 55 end": "cpu:49427482, mem:52231, prngs:-/-, objs:-/20@dd93bdf4, vm:-/-, evt:-, store:-/-, foot:-, stk:-, auth:-/-" } \ No newline at end of file diff --git a/soroban-env-host/src/host.rs b/soroban-env-host/src/host.rs index 16d93eb6e..c371ba460 100644 --- a/soroban-env-host/src/host.rs +++ b/soroban-env-host/src/host.rs @@ -2952,20 +2952,10 @@ impl VmCallerEnv for Host { fn bls12_381_g1_msm( &self, - vmcaller: &mut VmCaller, + _vmcaller: &mut VmCaller, vp: VecObject, vs: VecObject, ) -> Result { - let p_len = self.vec_len(vmcaller, vp)?; - let s_len = self.vec_len(vmcaller, vs)?; - if u32::from(p_len) != u32::from(s_len) || u32::from(p_len) == 0 { - return Err(self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "g1_msm: invalid input vector lengths", - &[p_len.to_val(), s_len.to_val()], - )); - } let points = self.checked_g1_vec_from_vecobj(vp)?; let scalars = self.fr_vec_from_vecobj(vs)?; let res = self.msm_internal(&points, &scalars, &ContractCostType::Bls12381G1Msm, "G1")?; @@ -2990,18 +2980,6 @@ impl VmCallerEnv for Host { ) -> Result { let g1 = self.visit_obj(mo, |msg: &ScBytes| { self.visit_obj(dst, |dst: &ScBytes| { - let dst_len = dst.len(); - if dst_len == 0 || dst_len > 255 { - return Err(self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - format!( - "hash_to_g1: invalid input dst length {dst_len}, must be > 0 and < 256" - ) - .as_str(), - &[], - )); - } self.hash_to_curve( dst.as_slice(), msg.as_slice(), @@ -3048,20 +3026,10 @@ impl VmCallerEnv for Host { fn bls12_381_g2_msm( &self, - vmcaller: &mut VmCaller, + _vmcaller: &mut VmCaller, vp: VecObject, vs: VecObject, ) -> Result { - let p_len = self.vec_len(vmcaller, vp)?; - let s_len = self.vec_len(vmcaller, vs)?; - if u32::from(p_len) != u32::from(s_len) || u32::from(p_len) == 0 { - return Err(self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - "g2_msm: invalid input vector lengths", - &[p_len.to_val(), s_len.to_val()], - )); - } let points = self.checked_g2_vec_from_vecobj(vp)?; let scalars = self.fr_vec_from_vecobj(vs)?; let res = self.msm_internal(&points, &scalars, &ContractCostType::Bls12381G2Msm, "G2")?; @@ -3086,18 +3054,6 @@ impl VmCallerEnv for Host { ) -> Result { let g2 = self.visit_obj(msg, |msg: &ScBytes| { self.visit_obj(dst, |dst: &ScBytes| { - let dst_len = dst.len(); - if dst_len == 0 || dst_len > 255 { - return Err(self.err( - ScErrorType::Crypto, - ScErrorCode::InvalidInput, - format!( - "hash_to_g2: invalid input dst length {dst_len}, must be > 0 and < 256" - ) - .as_str(), - &[], - )); - } self.hash_to_curve( dst.as_slice(), msg.as_slice(), diff --git a/soroban-env-host/src/test/bls12_381.rs b/soroban-env-host/src/test/bls12_381.rs index 051385dd1..805179af2 100644 --- a/soroban-env-host/src/test/bls12_381.rs +++ b/soroban-env-host/src/test/bls12_381.rs @@ -1312,6 +1312,7 @@ fn g2_msm() -> Result<(), HostError> { } // 6. g2 * (1) + g2 (-1) = 0 { + host.budget_ref().reset_default()?; let pt = sample_g2(&host, &mut rng)?; let zero = g2_zero(&host)?; assert_ne!(