Module risc0_zkp::core

source ·
Expand description

Core module used to implement a zk-STARK prover and verifier.

This includes support for:

  • ntt: Number-theoretic transform (NTT)
  • sha: SHA-256 hashing support
  • sha_rng: Cryptographic random number generator (CRNG) based on SHA-256
  • Other basic ZKP utilities

Modules

  • A Blake2b HashSuite.
  • Traits to configure which cryptographic primitives the ZKP uses
  • A generic (cross hash) digest, which is always 256 bits and composed of 8 words
  • An implementation of a number-theoretic transform (NTT).
  • Polynomial utilities (currently only those used in polynomial evaluation).
  • An implementation of Poseidon targeting the Baby Bear field with a security of 128 bits.
  • Simple SHA-256 wrappers.
  • Simple wrappers for a CPU-based SHA-256 implementation.
  • A SHA-256 based CRNG used in Fiat-Shamir.

Traits

  • Generic trait for generating random values.

Functions

  • Compute ceil(log_2(value))
  • For x = (1 << po2), given x, find po2.