|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Plookup tables for SHA-256 using sparse form representation. More...
#include "barretenberg/numeric/bitop/pow.hpp"#include "barretenberg/numeric/bitop/rotate.hpp"#include "barretenberg/numeric/bitop/sparse_form.hpp"#include "sparse.hpp"#include "types.hpp"Go to the source code of this file.
Namespaces | |
| namespace | bb |
| Entry point for Barretenberg command-line interface. | |
| namespace | bb::plookup |
| namespace | bb::plookup::sha256_tables |
Plookup tables for SHA-256 using sparse form representation.
This file defines lookup tables that enable efficient SHA-256 computation in circuits by converting bitwise XOR operations into arithmetic additions via "sparse form" representation.
In sparse form, each bit of a value is stored in its own base-B digit, where B is chosen large enough to prevent overflow when multiple values are added. This allows:
Each SHA-256 operation proceeds in three stages:
| Operation | Input Table | Output Table | Base |
|---|---|---|---|
| Message extension σ₀/σ₁ | SHA256_WITNESS_INPUT | SHA256_WITNESS_OUTPUT | 16 |
| Choose + Σ₁ | SHA256_CH_INPUT | SHA256_CH_OUTPUT | 28 |
| Majority + Σ₀ | SHA256_MAJ_INPUT | SHA256_MAJ_OUTPUT | 16 |
See corresponding table generation functions for details, including choice of base and limb structure.
Definition in file sha256.hpp.