Trait HashableKey

Source
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§

Source

fn hash_babybear(&self) -> [BabyBear; 8]

Hash the key into a digest of BabyBear elements.

Source

fn hash_u32(&self) -> [u32; 8]

Hash the key into a digest of u32 elements.

Provided Methods§

Source

fn hash_bn254(&self) -> Bn254Fr

Hash the key into a Bn254Fr element.

Source

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.

Source

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.

Source

fn hash_bytes(&self) -> [u8; 32]

Hash the key into a digest of bytes elements.

Implementations on Foreign Types§

Source§

impl<SC> HashableKey for StarkVerifyingKey<SC>

Source§

fn hash_babybear(&self) -> [BabyBear; 8]

Source§

fn hash_u32(&self) -> [u32; 8]

Implementors§