Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jul 9, 2024
1 parent 13c5a75 commit 69465d8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
14 changes: 7 additions & 7 deletions noir-projects/aztec-nr/aztec/src/oracle/keys.nr
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ use crate::keys::PublicKeys;
use dep::protocol_types::{address::{AztecAddress, PartialAddress}, embedded_curve_point::EmbeddedCurvePoint};

#[oracle(getPublicKeysAndPartialAddress)]
unconstrained fn get_public_keys_and_partial_address_oracle(_address: AztecAddress) -> [Field; 9] {}
unconstrained fn get_public_keys_and_partial_address_oracle(_address: AztecAddress) -> [Field; 13] {}

unconstrained fn get_public_keys_and_partial_address_oracle_wrapper(address: AztecAddress) -> [Field; 9] {
unconstrained fn get_public_keys_and_partial_address_oracle_wrapper(address: AztecAddress) -> [Field; 13] {
get_public_keys_and_partial_address_oracle(address)
}

fn get_public_keys_and_partial_address(address: AztecAddress) -> (PublicKeys, PartialAddress) {
let result = get_public_keys_and_partial_address_oracle_wrapper(address);

let keys = PublicKeys {
npk_m: EmbeddedCurvePoint::new(result[0], result[1], false),
ivpk_m: EmbeddedCurvePoint::new(result[2], result[3], false),
ovpk_m: EmbeddedCurvePoint::new(result[4], result[5], false),
tpk_m: EmbeddedCurvePoint::new(result[6], result[7], false)
npk_m: EmbeddedCurvePoint::new(result[0], result[1], result[2] as bool),
ivpk_m: EmbeddedCurvePoint::new(result[3], result[4], result[5] as bool),
ovpk_m: EmbeddedCurvePoint::new(result[6], result[7], result[8] as bool),
tpk_m: EmbeddedCurvePoint::new(result[9], result[10], result[11] as bool)
};

let partial_address = PartialAddress::from_field(result[8]);
let partial_address = PartialAddress::from_field(result[12]);

(keys, partial_address)
}
2 changes: 1 addition & 1 deletion yarn-project/circuits.js/src/types/public_keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('PublicKeys', () => {

const hash = keys.hash().toString();
expect(hash).toMatchInlineSnapshot(`"0x0000000000000000000000000000000000000000000000000000000000000000"`);

// Run with AZTEC_GENERATE_TEST_DATA=1 to update noir test data
updateInlineTestData('noir-projects/aztec-nr/aztec/src/keys/public_keys.nr', 'test_data_empty_hash', hash);
});
Expand Down
8 changes: 5 additions & 3 deletions yarn-project/txe/src/txe_service/txe_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,13 +574,15 @@ export class TXEService {
ovskApp: ForeignCallSingle,
ovpkMX: ForeignCallSingle,
ovpkMY: ForeignCallSingle,
ovpkMIsInfinite: ForeignCallSingle,
ivpkMX: ForeignCallSingle,
ivpkMY: ForeignCallSingle,
ivpkMIsInfinite: ForeignCallSingle,
preimage: ForeignCallArray,
) {
const ovpkM = new Point(fromSingle(ovpkMX), fromSingle(ovpkMY));
const ovpkM = new Point(fromSingle(ovpkMX), fromSingle(ovpkMY), !fromSingle(ovpkMIsInfinite).isZero());
const ovKeys = new KeyValidationRequest(ovpkM, Fr.fromString(fromSingle(ovskApp).toString()));
const ivpkM = new Point(fromSingle(ivpkMX), fromSingle(ivpkMY));
const ivpkM = new Point(fromSingle(ivpkMX), fromSingle(ivpkMY), !fromSingle(ivpkMIsInfinite).isZero());
const encLog = this.typedOracle.computeEncryptedNoteLog(
AztecAddress.fromString(fromSingle(contractAddress).toString()),
Fr.fromString(fromSingle(storageSlot).toString()),
Expand All @@ -599,7 +601,7 @@ export class TXEService {

emitEncryptedLog(
_contractAddress: ForeignCallSingle,
_randomandomness: ForeignCallSingle,
_randomness: ForeignCallSingle,
_encryptedLog: ForeignCallSingle,
_counter: ForeignCallSingle,
) {
Expand Down

0 comments on commit 69465d8

Please sign in to comment.