Skip to content

Commit

Permalink
build: ➕ switch to array_helpers dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
colinnielsen committed Jun 13, 2023
1 parent 6817bba commit 01fdab7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 302 deletions.
1 change: 1 addition & 0 deletions Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ compiler_version = "0.6.0"
notes = "AMDG"

[dependencies]
array_helpers = { tag = "v0.1.0", git = "https://github.com/colinnielsen/noir-array-helpers" }
8 changes: 4 additions & 4 deletions src/secp256k1.nr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use dep::std;

mod helpers;
use dep::array_helpers;

struct PubKey {
pub_x: [u8; 32],
Expand Down Expand Up @@ -31,7 +31,7 @@ impl PubKey {
}

fn from_unified(pub_key: [u8; 64]) -> PubKey {
let (key_x, key_y) = helpers::split_u8_64_unconstrained(pub_key);
let (key_x, key_y) = array_helpers::split_u8_64_unconstrained(pub_key);

PubKey {
pub_x: key_x,
Expand All @@ -54,14 +54,14 @@ impl PubKey {
}

fn to_eth_address(self) -> Field {
let pub_key = helpers::u8_32_to_u8_64_unconstrained(self.pub_x, self.pub_y);
let pub_key = array_helpers::u8_32_to_u8_64_unconstrained(self.pub_x, self.pub_y);
let hashed_pub_key = std::hash::keccak256(pub_key);

let mut right_20_bytes: [u8; 20] = [0; 20];
for i in 0..20 {
right_20_bytes[i] = hashed_pub_key[i + 12];
}

helpers::u8_to_eth_address(right_20_bytes)
array_helpers::u8_to_eth_address(right_20_bytes)
}
}
298 changes: 0 additions & 298 deletions src/secp256k1/helpers.nr

This file was deleted.

0 comments on commit 01fdab7

Please sign in to comment.