Skip to content

Commit

Permalink
feat!: don't prepend signature scheme flag before public key (#6)
Browse files Browse the repository at this point in the history
* feat!: Don't prepend signature scheme flag before public key

* Cleanup
  • Loading branch information
Thoralf-M authored Jun 12, 2024
1 parent 79c427b commit c3620d6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions rust-app/src/implementation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ impl Address<SuiPubKeyAddress, ledger_device_sdk::ecc::ECPublicKey<65, 'E'>> for
key: &ledger_device_sdk::ecc::ECPublicKey<65, 'E'>,
) -> Result<Self, SyscallError> {
let key_bytes = ed25519_public_key_bytes(key);
let mut tmp = ArrayVec::<u8, 33>::new();
let _ = tmp.try_push(0); // SIGNATURE_SCHEME_TO_FLAG['ED25519']
let _ = tmp.try_extend_from_slice(key_bytes);
let mut hasher: Blake2b = Hasher::new();
hasher.update(&tmp);
hasher.update(&key_bytes);
let hash: [u8; SUI_ADDRESS_LENGTH] = hasher.finalize();
Ok(SuiPubKeyAddress(key.clone(), hash))
}
Expand Down

0 comments on commit c3620d6

Please sign in to comment.