pub struct CompressedForm {
pub a: BigInt,
pub t: BigInt,
pub g: BigInt,
pub b0: BigInt,
pub b_sign: bool,
}Expand description
Compressed representation of a binary quadratic form $(a, b)$ in Chia’s BQFC format.
BQFC (Binary Quadratic Form Compression) reduces the storage of a 1024-bit form from 128+ bytes to exactly 100 bytes by encoding the partial XGCD decomposition of $(a, b)$ rather than storing the coefficients directly.
Fields§
§a: BigIntCompressed form of the a coefficient (divided by g if g > 1).
t: BigIntPartial XGCD quotient $t$ such that $t \cdot b \equiv \pm\sqrt{D} \pmod{a}$.
g: BigIntCommon divisor $g = \gcd(a, t)$; equal to 1 when no further factoring is needed.
b0: BigIntHigh-order correction term $b_0 = b / a’$ (non-zero only when g > 1).
b_sign: boolSign of the original b coefficient (true = negative).
Trait Implementations§
Source§impl Clone for CompressedForm
impl Clone for CompressedForm
Source§fn clone(&self) -> CompressedForm
fn clone(&self) -> CompressedForm
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompressedForm
impl RefUnwindSafe for CompressedForm
impl Send for CompressedForm
impl Sync for CompressedForm
impl Unpin for CompressedForm
impl UnsafeUnpin for CompressedForm
impl UnwindSafe for CompressedForm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more