Bitcoin Core  22.99.0
P2P Digital Currency
Classes | Functions | Variables
pyminisketch Namespace Reference

Classes

class  GF2Ops
 
class  Minisketch
 
class  TestGF2Ops
 
class  TestMinisketch
 
class  TestPolyFindRoots
 

Functions

def poly_monic (poly, gf)
 
def poly_divmod (poly, mod, gf)
 
def poly_gcd (a, b, gf)
 
def poly_sqr (poly, gf)
 
def poly_tracemod (poly, param, gf)
 
def poly_frobeniusmod (poly, gf)
 
def poly_find_roots (poly, gf)
 
def berlekamp_massey (syndromes, gf)
 

Variables

list GF2_MODULI
 

Function Documentation

◆ berlekamp_massey()

def pyminisketch.berlekamp_massey (   syndromes,
  gf 
)
Implement the Berlekamp-Massey algorithm.

Takes as input a sequence of GF(2^field_size) elements, and returns the shortest LSFR
that generates it, represented as a polynomial.

Definition at line 341 of file pyminisketch.py.

Here is the caller graph for this function:

◆ poly_divmod()

def pyminisketch.poly_divmod (   poly,
  mod,
  gf 
)
Return the polynomial (quotient, remainder) of poly divided by mod.

Definition at line 197 of file pyminisketch.py.

Here is the caller graph for this function:

◆ poly_find_roots()

def pyminisketch.poly_find_roots (   poly,
  gf 
)
Find the roots of poly if fully factorizable with unique roots, [] otherwise.

Definition at line 260 of file pyminisketch.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poly_frobeniusmod()

def pyminisketch.poly_frobeniusmod (   poly,
  gf 
)
Compute x^(2^field_size) mod poly.

Definition at line 253 of file pyminisketch.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poly_gcd()

def pyminisketch.poly_gcd (   a,
  b,
  gf 
)
Return the polynomial GCD of a and b.

Definition at line 217 of file pyminisketch.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ poly_monic()

def pyminisketch.poly_monic (   poly,
  gf 
)
Return a monic version of the polynomial poly.

Definition at line 191 of file pyminisketch.py.

Here is the caller graph for this function:

◆ poly_sqr()

def pyminisketch.poly_sqr (   poly,
  gf 
)
Return the square of polynomial poly.

Definition at line 228 of file pyminisketch.py.

Here is the caller graph for this function:

◆ poly_tracemod()

def pyminisketch.poly_tracemod (   poly,
  param,
  gf 
)
Compute y + y^2 + y^4 + ... + y^(2^(field_size-1)) mod poly, where y = param*x.

Definition at line 238 of file pyminisketch.py.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ GF2_MODULI

list pyminisketch.GF2_MODULI

Definition at line 18 of file pyminisketch.py.