Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::stdlib::element_default::detail::fake_glv_decomposition Struct Reference

Native fake-GLV decomposition for a secp256r1 scalar. More...

#include <biggroup_secp256r1.hpp>

Public Attributes

bb::numeric::uint256_t alpha
 
bb::numeric::uint256_t beta_abs
 
bool beta_is_negative
 

Detailed Description

Native fake-GLV decomposition for a secp256r1 scalar.

Given a scalar s mod n, runs the extended Euclidean algorithm on (n, s) and returns the first (α, β) pair with α = u_{m+1} < 2¹²⁸ and β = v_{m+1} (computed modulo n; sign recovered by comparing against n/2 – safe because |v_{m+1}| < √n << n/2). Always satisfies

(β_is_negative ? -β_abs : β_abs) · s ≡ α (mod n)

with α and β_abs strictly less than 2¹²⁸ (in fact ≤ √n < 2¹²⁸ for secp256r1). For the degenerate case s = 0, the loop terminates immediately and we return (0, 1, false); callers must ensure s != 0 (the caller in this file uses Fr::conditional_assign to substitute 0 → 1 prior to decomposition).

Definition at line 56 of file biggroup_secp256r1.hpp.

Member Data Documentation

◆ alpha

bb::numeric::uint256_t bb::stdlib::element_default::detail::fake_glv_decomposition::alpha

Definition at line 57 of file biggroup_secp256r1.hpp.

◆ beta_abs

bb::numeric::uint256_t bb::stdlib::element_default::detail::fake_glv_decomposition::beta_abs

Definition at line 58 of file biggroup_secp256r1.hpp.

◆ beta_is_negative

bool bb::stdlib::element_default::detail::fake_glv_decomposition::beta_is_negative

Definition at line 59 of file biggroup_secp256r1.hpp.


The documentation for this struct was generated from the following file: