From afe3749d6b3b5fd4686775a3b482dcddf216e5e3 Mon Sep 17 00:00:00 2001 From: Aztec Bot <49558828+AztecBot@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:25:05 -0500 Subject: [PATCH] feat: Sync from noir (#11051) Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE feat: impl Default for U128 (https://github.com/noir-lang/noir/pull/6984) fix: Do not emit range check for multiplication by bool (https://github.com/noir-lang/noir/pull/6983) fix: do not panic on indices which are not valid `u32`s (https://github.com/noir-lang/noir/pull/6976) feat!: require trait method calls (`foo.bar()`) to have the trait in scope (imported) (https://github.com/noir-lang/noir/pull/6895) feat!: type-check trait default methods (https://github.com/noir-lang/noir/pull/6645) feat: `--pedantic-solving` flag (https://github.com/noir-lang/noir/pull/6716) feat!: update `aes128_encrypt` to return an array (https://github.com/noir-lang/noir/pull/6973) fix: wrong module to lookup trait when using crate or super (https://github.com/noir-lang/noir/pull/6974) fix: Start RC at 1 again (https://github.com/noir-lang/noir/pull/6958) feat!: turn TypeIsMorePrivateThenItem into an error (https://github.com/noir-lang/noir/pull/6953) fix: don't fail parsing macro if there are parser warnings (https://github.com/noir-lang/noir/pull/6969) fix: error on missing function parameters (https://github.com/noir-lang/noir/pull/6967) feat: don't report warnings for dependencies (https://github.com/noir-lang/noir/pull/6926) chore: simplify boolean in a mul of a mul (https://github.com/noir-lang/noir/pull/6951) feat(ssa): Immediately simplify away RefCount instructions in ACIR functions (https://github.com/noir-lang/noir/pull/6893) chore: Move comment as part of #6945 (https://github.com/noir-lang/noir/pull/6959) chore: Separate unconstrained functions during monomorphization (https://github.com/noir-lang/noir/pull/6894) feat!: turn CannotReexportItemWithLessVisibility into an error (https://github.com/noir-lang/noir/pull/6952) feat: lock on Nargo.toml on several nargo commands (https://github.com/noir-lang/noir/pull/6941) feat: don't simplify SSA instructions when creating them from a string (https://github.com/noir-lang/noir/pull/6948) chore: add reproduction case for bignum test failure (https://github.com/noir-lang/noir/pull/6464) chore: bump `noir-gates-diff` (https://github.com/noir-lang/noir/pull/6949) feat(test): Enable the test fuzzer for Wasm (https://github.com/noir-lang/noir/pull/6835) chore: also print test output to stdout in CI (https://github.com/noir-lang/noir/pull/6930) fix: Non-determinism from under constrained checks (https://github.com/noir-lang/noir/pull/6945) chore: use logs for benchmarking (https://github.com/noir-lang/noir/pull/6911) chore: bump `noir-gates-diff` (https://github.com/noir-lang/noir/pull/6944) chore: bump `noir-gates-diff` (https://github.com/noir-lang/noir/pull/6943) fix: Show output of `test_program_is_idempotent` on failure (https://github.com/noir-lang/noir/pull/6942) chore: delete a bunch of dead code from `noirc_evaluator` (https://github.com/noir-lang/noir/pull/6939) feat: require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (https://github.com/noir-lang/noir/pull/6882) chore: Bump arkworks to version `0.5.0` (https://github.com/noir-lang/noir/pull/6871) END_COMMIT_OVERRIDE --------- Co-authored-by: Michael J Klein Co-authored-by: Michael Klein Co-authored-by: Tom French Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com> Co-authored-by: Charlie Lye Co-authored-by: ludamad --- aztec/src/encrypted_logs/header.nr | 2 +- aztec/src/encrypted_logs/payload.nr | 2 +- aztec/src/macros/events/mod.nr | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aztec/src/encrypted_logs/header.nr b/aztec/src/encrypted_logs/header.nr index 64a8e09..05428f2 100644 --- a/aztec/src/encrypted_logs/header.nr +++ b/aztec/src/encrypted_logs/header.nr @@ -32,7 +32,7 @@ impl EncryptedLogHeader { } let input: [u8; 32] = self.address.to_field().to_be_bytes(); - aes128_encrypt(input, iv, sym_key).as_array() + aes128_encrypt(input, iv, sym_key) } } diff --git a/aztec/src/encrypted_logs/payload.nr b/aztec/src/encrypted_logs/payload.nr index 1b396ef..440cebd 100644 --- a/aztec/src/encrypted_logs/payload.nr +++ b/aztec/src/encrypted_logs/payload.nr @@ -207,7 +207,7 @@ pub fn compute_incoming_body_ciphertext( plaintext: [u8; P], eph_sk: Scalar, address_point: AddressPoint, -) -> [u8] { +) -> [u8; P + 16 - P % 16] { let full_key = derive_aes_secret(eph_sk, address_point.to_point()); let mut sym_key = [0; 16]; let mut iv = [0; 16]; diff --git a/aztec/src/macros/events/mod.nr b/aztec/src/macros/events/mod.nr index 1fc3671..204bca4 100644 --- a/aztec/src/macros/events/mod.nr +++ b/aztec/src/macros/events/mod.nr @@ -20,7 +20,7 @@ comptime fn generate_event_interface(s: StructDefinition) -> Quoted { buffer[i] = event_type_id_bytes[i]; } - let serialized_event = self.serialize(); + let serialized_event = Serialize::<$content_len>::serialize(self); for i in 0..serialized_event.len() { let bytes: [u8; 32] = serialized_event[i].to_be_bytes();