Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

poseidon

Poseidon hash related traits implementations and functions.

This module provides cryptographic hash functions based on the Poseidon permutation.

The Poseidon hash function is an arithmetic-friendly hash function optimized for use in zero-knowledge proof systems. This module implements the Poseidon hash using a sponge construction for arbitrary-length inputs.

Examples

use core::hash::HashStateTrait;
use core::poseidon::PoseidonTrait;

// Create a new hash state
let mut state = PoseidonTrait::new();

// Update with values
state = state.update(1);
state = state.update(2);

// Finalize to get the hash
let hash = state.finalize();

Fully qualified path: core::poseidon

Extern functions