pub trait HashableKey {
// Required methods
fn hash_babybear(&self) -> [BabyBear; 8];
fn hash_u32(&self) -> [u32; 8];
// Provided methods
fn hash_bn254(&self) -> Bn254Fr { ... }
fn bytes32(&self) -> String { ... }
fn bytes32_raw(&self) -> [u8; 32] { ... }
fn hash_bytes(&self) -> [u8; 32] { ... }
}
Expand description
A trait for keys that can be hashed into a digest.
Required Methods§
Sourcefn hash_babybear(&self) -> [BabyBear; 8]
fn hash_babybear(&self) -> [BabyBear; 8]
Hash the key into a digest of BabyBear elements.
Provided Methods§
Sourcefn hash_bn254(&self) -> Bn254Fr
fn hash_bn254(&self) -> Bn254Fr
Hash the key into a Bn254Fr element.
Sourcefn bytes32(&self) -> String
fn bytes32(&self) -> String
Hash the key into a 32 byte hex string, prefixed with “0x”.
This is ideal for generating a vkey hash for onchain verification.
Sourcefn bytes32_raw(&self) -> [u8; 32]
fn bytes32_raw(&self) -> [u8; 32]
Hash the key into a 32 byte array.
This has the same value as bytes32
, but as a raw byte array.
Sourcefn hash_bytes(&self) -> [u8; 32]
fn hash_bytes(&self) -> [u8; 32]
Hash the key into a digest of bytes elements.