Skip to content

Commit

Permalink
chore: replicate noir-lang/noir#4946 (#7202)
Browse files Browse the repository at this point in the history
This PR pulls out the `dep::` change from the sync PR so we can remove a
lot of the diff.
  • Loading branch information
TomAFrench authored and AztecBot committed Jun 27, 2024
1 parent 6b4942f commit 5d4a08f
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion aztec/src/encrypted_logs/header.nr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use dep::protocol_types::{address::AztecAddress, grumpkin_private_key::GrumpkinP

use crate::keys::point_to_symmetric_key::point_to_symmetric_key;

use dep::std::aes128::aes128_encrypt;
use std::aes128::aes128_encrypt;

struct EncryptedLogHeader {
address: AztecAddress,
Expand Down
2 changes: 1 addition & 1 deletion aztec/src/encrypted_logs/incoming_body.nr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::note::note_interface::NoteInterface;
use crate::event::event_interface::EventInterface;
use dep::protocol_types::{grumpkin_private_key::GrumpkinPrivateKey, grumpkin_point::GrumpkinPoint};

use dep::std::aes128::aes128_encrypt;
use std::aes128::aes128_encrypt;
use crate::keys::point_to_symmetric_key::point_to_symmetric_key;

struct EncryptedLogIncomingBody<M> {
Expand Down
3 changes: 1 addition & 2 deletions aztec/src/encrypted_logs/outgoing_body.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use dep::protocol_types::{
constants::GENERATOR_INDEX__SYMMETRIC_KEY, hash::poseidon2_hash
};

use dep::std::aes128::aes128_encrypt;
use dep::std::println;
use std::aes128::aes128_encrypt;

use crate::keys::point_to_symmetric_key::point_to_symmetric_key;

Expand Down
2 changes: 1 addition & 1 deletion aztec/src/encrypted_logs/payload.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use dep::protocol_types::{
constants::{GENERATOR_INDEX__IVSK_M, GENERATOR_INDEX__OVSK_M}, hash::poseidon2_hash
};

use dep::std::{embedded_curve_ops::{embedded_curve_add, EmbeddedCurvePoint}, field::bytes32_to_field};
use std::{embedded_curve_ops::{embedded_curve_add, EmbeddedCurvePoint}, field::bytes32_to_field};

use crate::oracle::unsafe_rand::unsafe_rand;

Expand Down
2 changes: 1 addition & 1 deletion aztec/src/history/note_inclusion.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dep::std::merkle::compute_merkle_root;
use std::merkle::compute_merkle_root;
use dep::protocol_types::header::Header;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion aztec/src/history/nullifier_inclusion.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dep::std::merkle::compute_merkle_root;
use std::merkle::compute_merkle_root;
use dep::protocol_types::header::Header;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion aztec/src/history/nullifier_non_inclusion.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dep::std::merkle::compute_merkle_root;
use std::merkle::compute_merkle_root;
use dep::protocol_types::{header::Header, utils::field::{full_field_less_than, full_field_greater_than}};
use crate::{
context::PrivateContext, note::{utils::compute_siloed_nullifier, note_interface::NoteInterface},
Expand Down
2 changes: 1 addition & 1 deletion aztec/src/history/public_storage.nr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use dep::protocol_types::{
constants::GENERATOR_INDEX__PUBLIC_LEAF_INDEX, hash::pedersen_hash, address::AztecAddress,
header::Header, utils::field::full_field_less_than
};
use dep::std::merkle::compute_merkle_root;
use std::merkle::compute_merkle_root;

use crate::{context::PrivateContext, oracle::get_public_data_witness::get_public_data_witness};

Expand Down
2 changes: 1 addition & 1 deletion aztec/src/keys/point_to_symmetric_key.nr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use dep::protocol_types::{
constants::GENERATOR_INDEX__SYMMETRIC_KEY, grumpkin_private_key::GrumpkinPrivateKey,
grumpkin_point::GrumpkinPoint, utils::arr_copy_slice
};
use dep::std::{hash::sha256, embedded_curve_ops::{EmbeddedCurvePoint, EmbeddedCurveScalar, multi_scalar_mul}};
use std::{hash::sha256, embedded_curve_ops::{EmbeddedCurvePoint, EmbeddedCurveScalar, multi_scalar_mul}};

// TODO(#5726): This function is called deriveAESSecret in TS. I don't like point_to_symmetric_key name much since
// point is not the only input of the function. Unify naming with TS once we have a better name.
Expand Down
2 changes: 1 addition & 1 deletion aztec/src/messaging.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
oracle::get_l1_to_l2_membership_witness::get_l1_to_l2_membership_witness
};

use dep::std::merkle::compute_merkle_root;
use std::merkle::compute_merkle_root;
use dep::protocol_types::{constants::L1_TO_L2_MSG_TREE_HEIGHT, address::{AztecAddress, EthAddress}, utils::arr_copy_slice};

pub fn process_l1_to_l2_message(
Expand Down
2 changes: 1 addition & 1 deletion aztec/src/note/note_getter_options.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dep::std::option::Option;
use std::option::Option;
use dep::protocol_types::{constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, traits::ToField};
use crate::note::note_interface::NoteInterface;

Expand Down
2 changes: 1 addition & 1 deletion aztec/src/note/note_viewer_options.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dep::std::option::Option;
use std::option::Option;
use crate::note::note_getter_options::{PropertySelector, Select, Sort, Comparator, NoteStatus};
use dep::protocol_types::traits::ToField;
use crate::note::note_interface::NoteInterface;
Expand Down
2 changes: 1 addition & 1 deletion aztec/src/oracle/header.nr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dep::std::merkle::compute_merkle_root;
use std::merkle::compute_merkle_root;
use dep::protocol_types::{constants::HEADER_LENGTH, header::Header};

use crate::{context::PrivateContext, oracle::get_membership_witness::get_archive_membership_witness};
Expand Down
2 changes: 1 addition & 1 deletion aztec/src/public_storage.nr
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn write<T, N>(storage_slot: Field, value: T) where T: Serialize<N> {
// }

mod tests {
use dep::std::test::OracleMock;
use std::test::OracleMock;
use dep::protocol_types::traits::{Deserialize, Serialize};
use crate::public_storage;

Expand Down
2 changes: 1 addition & 1 deletion aztec/src/state_vars/private_mutable/test.nr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use dep::protocol_types::{address::AztecAddress, grumpkin_point::GrumpkinPoint};
use crate::{context::PrivateContext, state_vars::private_mutable::PrivateMutable};
use crate::test::{mocks::mock_note::MockNote, helpers::{cheatcodes, test_environment::TestEnvironment}};
use dep::std::{unsafe::zeroed, test::OracleMock};
use std::{unsafe::zeroed, test::OracleMock};

global storage_slot = 17;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::protocol_types::traits::{Serialize, Deserialize, FromField, ToField};
use dep::std::cmp::min;
use std::cmp::min;

mod test;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dep::protocol_types::traits::{Serialize, Deserialize, FromField, ToField};
use dep::std::cmp::min;
use std::cmp::min;

mod test;

Expand Down
2 changes: 1 addition & 1 deletion aztec/src/utils.nr
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn verify_collapse_hints<T, N>(
} else {
// BoundedVec assumes that the unused parts of the storage are zeroed out (e.g. in the Eq impl), so we make
// sure that this property holds.
assert_eq(collapsed.get_unchecked(i), dep::std::unsafe::zeroed(), "Dirty collapsed vec storage");
assert_eq(collapsed.get_unchecked(i), std::unsafe::zeroed(), "Dirty collapsed vec storage");
}
}
// We now know that:
Expand Down

0 comments on commit 5d4a08f

Please sign in to comment.