Skip to Content
oxcrypto

Permutations

Apply raw sponge permutations to state bytes.

Warning

oxcrypto.hazmat.permutation exposes the permutations inside sponge constructions. They are not hashes, ciphers or MACs: they give no security on their own, and building a mode on top needs protocol expertise. Use them for interoperability, testing, and research.

permute takes the full state as bytes and returns the new state; the input is not modified. A state of the wrong length raises ValueError. Where a permutation is defined with fewer rounds, the keyword-only rounds option applies the last rounds rounds and defaults to the full permutation.

Permutations

  • Keccak Keccak-f[200], [400], [800], [1600] and Keccak-p rounds.
  • Ascon The Ascon permutation from NIST SP 800-232.
  • bash-f The bash-f permutation from STB 34.101.77-2020.

Curves

oxcrypto.hazmat.curve exposes elliptic-curve building blocks for protocol implementers.

  • Hash to curve RFC 9380 hash-to-curve and encode-to-curve for P-256, P-384, P-521 and secp256k1.

Groups

oxcrypto.hazmat.group exposes the RFC 9496 prime-order groups as operations on encoded elements and scalars. They are building blocks for protocols such as OPRFs and PAKEs, not a signature or key-exchange scheme on their own.

  • ristretto255 The prime-order group built on Curve25519.
  • decaf448 The prime-order group built on Ed448-Goldilocks.

On this page