Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
booth_recode.hpp File Reference
#include "barretenberg/common/assert.hpp"
#include <array>
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Classes

struct  bb::ecc::booth::BoothSliceParams
 Per-window precomputed slice parameters for the carry-less signed-Booth window recoding. Read out by the per-(point, window) hot loop as two i32 loads + a fixed bit-twiddle (no branches, no per-iter address arithmetic). More...
 

Namespaces

namespace  bb
 Entry point for Barretenberg command-line interface.
 
namespace  bb::ecc
 
namespace  bb::ecc::booth
 

Functions

constexpr BoothSliceParams bb::ecc::booth::compute_booth_slice_params_unchecked (size_t bit_offset, size_t window_bits, size_t num_uint64_limbs) noexcept
 Compute the Booth slice params for a window starting at absolute bit position bit_offset. The slice is [bit_offset - 1, bit_offset + window_bits); the bit at bit_offset - 1 is the shared boundary bit. The bottom window (bit_offset == 0) is encoded specially so the same recoding algebra applies — read "limb -1" as a zero-masked load.
 
BoothSliceParams bb::ecc::booth::compute_booth_slice_params (size_t bit_offset, size_t window_bits, size_t num_uint64_limbs) noexcept
 
template<size_t NUM_WINDOWS, size_t WINDOW_BITS, size_t NUM_UINT64_LIMBS>
constexpr std::array< BoothSliceParams, NUM_WINDOWS > bb::ecc::booth::make_booth_slice_params () noexcept
 
template<size_t NUM_WINDOWS, size_t WINDOW_BITS, size_t LOW_WINDOW_BITS, size_t NUM_UINT64_LIMBS>
constexpr std::array< BoothSliceParams, NUM_WINDOWS > bb::ecc::booth::make_offset_booth_slice_params () noexcept
 
uint32_t bb::ecc::booth::booth_packed_digit (const uint64_t *s, const BoothSliceParams &sp, size_t window_bits) noexcept
 Read a (window_bits+1)-bit window from s[] (uint64 limbs) and apply Constantine's signedWindowEncoding to produce a (sign | magnitude) packed digit: bit 31 = sign (1 = negative), bits 0..30 = magnitude in [0, 2^(window_bits-1)]. Magnitude 0 means the window contributes nothing.