Module permutation

Source
Expand description

State of a rescue-based, overwrite-mode cryptographic sponge (compliant with spongefish)

§Historical note

In 0.2.0 (and earlier versions), we used to have RescueSponge which consists of a permutation function and an internal state. RescueSponge implements what ark-sponge’s trait CryptographicSponge (absorb, squeeze etc.) and Absorb is implemented on RescueParameter config-marker trait for finite field types that support rescue permutation.

When we migrate to spongefish’s API design, here are the mapping:

  • Absorb -> Unit (which can be u8 or Fp)
  • CryptographicSponge -> DuplexSpongeInterface
    • but we don’t manually implement DuplexSpongeInterface, instead we define a new replacement for RescueSponge named RescuePermutation which implements trait Permutation, and directly use DuplexSponge<C:Permutation> in spongefish

Thus the old RescueSponge is now replaced by the new RescueSponge (same name) with the similar duplex sponge APIs, except that by following spongefish’s design, the state and the sponge behavior are not implemented on the same struct.

Structs§

RescuePermutation
State of rescue sponge, containing necessary permutation instance. Replacing RescueSponge, see module doc.

Type Aliases§

RescueSponge
Duplex sponge from RescuePermutation