Skip to main content

HashableKey

Trait HashableKey 

Source
pub trait HashableKey {
    // Required methods
    fn hash_koalabear(&self) -> [SP1Field; 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] { ... }
    fn hash_u64(&self) -> [u64; 4] { ... }
}
Expand description

A trait for keys that can be hashed into a digest.

Required Methods§

Source

fn hash_koalabear(&self) -> [SP1Field; 8]

Hash the key into a digest of SP1Field 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.

Source

fn hash_u64(&self) -> [u64; 4]

Hash the key into a digest of u64 elements.

Implementors§