Skip to main content

Module generic

Module generic 

Source
Expand description

Generic implementations of Poseidon1 linear layers.

This module provides two things:

  1. GenericPoseidon1LinearLayers — a trait with default dense/sparse linear layer methods, used by field-specific implementations that only need to override individual operations.

  2. Poseidon1ExternalLayerGeneric and Poseidon1InternalLayerGeneric — ready-to-use layer structs that implement FullRoundLayer and PartialRoundLayer for any field with a conforming MDS permutation. These are suitable for fields without hand-tuned SIMD implementations (e.g., Goldilocks, Mersenne-31).

Structs§

Poseidon1ExternalLayerGeneric
Generic external (full round) layer for the Poseidon1 permutation.
Poseidon1InternalLayerGeneric
Generic internal (partial round) layer for the Poseidon1 permutation.
Poseidon1InternalLayerTextbook
Textbook internal (partial round) layer for the Poseidon1 permutation.

Traits§

GenericPoseidon1LinearLayers
Generic linear layer trait for Poseidon1.

Functions§

add_rc_and_sbox_generic
Generic round-constant addition followed by S-box evaluation: val <- (val + rc)^D.