PQ-WB-KEM: White-Box ML-KEM-768 1.0
PQ-WB-KEM: Toward a White-Box Construction of ML-KEM-768 with Arithmetic Masking for M2M Communications - Mathematics (MDPI)
Loading...
Searching...
No Matches
ntt_verification Namespace Reference

Variables

 _sage_const_2
 
 _sage_const_60 = Integer(2)
 
 all_degree_2 = all(f[0].degree() == 2 for f in factors)
 
 all_passed = all(results["verifications"].values())
 
tuple correct_factorization = (num_factors == 128 and all_degree_2)
 
 default
 
tuple divides = (group_order % n == 0)
 
tuple divides_512 = (group_order % 512 == 0)
 
 exist_ok
 
 f
 
int factors = poly.factor()
 
 gamma = zeta_Zq^(2*i + 1)
 
int group_order = q - 1
 
 indent
 
int irreducible_count = 0
 
tuple is_256th_root = (zeta_256 == 1)
 
int is_irred = quad_poly.is_irreducible()
 
tuple is_primitive = (zeta_128 == Zq(-1))
 
tuple is_qnr = (legendre == -1)
 
 legendre = kronecker(Integer(gamma), q)
 
int n = 256
 
tuple not_64th_root = (zeta_64 != 1 and zeta_64 != Zq(-1))
 
 num_factors = len(factors)
 
 output_file = os.path.join(results_dir, "ntt_verification.json")
 
int poly = X^256 + 1
 
int q = 3329
 
int qnr_count = 0
 
list qnr_failures = []
 
int quad_poly = X^2 - gamma
 
 R = R._first_ngens(1)
 
dict results
 
 results_dir = os.path.join(os.path.dirname(os.path.dirname(script_dir)), "results")
 
 script_dir = os.path.dirname(os.path.abspath(__file__))
 
str status = "PASS" if value else "FAIL"
 
int zeta = 17
 
int zeta_128 = zeta_Zq^128
 
int zeta_256 = zeta_Zq^256
 
int zeta_64 = zeta_Zq^64
 
 zeta_Zq = Zq(zeta)
 
 Zq = GF(q)
 

Variable Documentation

◆ _sage_const_2

ntt_verification._sage_const_2
protected

Definition at line 175 of file ntt_verification.sage.py.

◆ _sage_const_60

ntt_verification._sage_const_60 = Integer(2)
protected

Definition at line 6 of file ntt_verification.sage.py.

◆ all_degree_2

ntt_verification.all_degree_2 = all(f[0].degree() == 2 for f in factors)

Definition at line 84 of file ntt_verification.sage.

◆ all_passed

ntt_verification.all_passed = all(results["verifications"].values())

Definition at line 135 of file ntt_verification.sage.

◆ correct_factorization

tuple ntt_verification.correct_factorization = (num_factors == 128 and all_degree_2)

Definition at line 86 of file ntt_verification.sage.

◆ default

ntt_verification.default

Definition at line 157 of file ntt_verification.sage.

◆ divides

tuple ntt_verification.divides = (group_order % n == 0)

Definition at line 35 of file ntt_verification.sage.

◆ divides_512

tuple ntt_verification.divides_512 = (group_order % 512 == 0)

Definition at line 68 of file ntt_verification.sage.

◆ exist_ok

ntt_verification.exist_ok

Definition at line 153 of file ntt_verification.sage.

◆ f

ntt_verification.f

Definition at line 157 of file ntt_verification.sage.

◆ factors

ntt_verification.factors = poly.factor()

Definition at line 78 of file ntt_verification.sage.

◆ gamma

ntt_verification.gamma = zeta_Zq^(2*i + 1)

Definition at line 99 of file ntt_verification.sage.

◆ group_order

ntt_verification.group_order = q - 1

Definition at line 29 of file ntt_verification.sage.

◆ indent

ntt_verification.indent

Definition at line 157 of file ntt_verification.sage.

◆ irreducible_count

ntt_verification.irreducible_count = 0

Definition at line 118 of file ntt_verification.sage.

◆ is_256th_root

tuple ntt_verification.is_256th_root = (zeta_256 == 1)

Definition at line 46 of file ntt_verification.sage.

◆ is_irred

ntt_verification.is_irred = quad_poly.is_irreducible()

Definition at line 122 of file ntt_verification.sage.

◆ is_primitive

tuple ntt_verification.is_primitive = (zeta_128 == Zq(-1))

Definition at line 53 of file ntt_verification.sage.

◆ is_qnr

tuple ntt_verification.is_qnr = (legendre == -1)

Definition at line 102 of file ntt_verification.sage.

◆ legendre

ntt_verification.legendre = kronecker(Integer(gamma), q)

Definition at line 101 of file ntt_verification.sage.

◆ n

ntt_verification.n = 256

Definition at line 17 of file ntt_verification.sage.

◆ not_64th_root

tuple ntt_verification.not_64th_root = (zeta_64 != 1 and zeta_64 != Zq(-1))

Definition at line 60 of file ntt_verification.sage.

◆ num_factors

ntt_verification.num_factors = len(factors)

Definition at line 85 of file ntt_verification.sage.

◆ output_file

ntt_verification.output_file = os.path.join(results_dir, "ntt_verification.json")

Definition at line 154 of file ntt_verification.sage.

◆ poly

ntt_verification.poly = X^256 + 1

Definition at line 77 of file ntt_verification.sage.

◆ q

ntt_verification.q = 3329

Definition at line 16 of file ntt_verification.sage.

◆ qnr_count

ntt_verification.qnr_count = 0

Definition at line 95 of file ntt_verification.sage.

◆ qnr_failures

list ntt_verification.qnr_failures = []

Definition at line 96 of file ntt_verification.sage.

◆ quad_poly

ntt_verification.quad_poly = X^2 - gamma

Definition at line 121 of file ntt_verification.sage.

◆ R

ntt_verification.R = R._first_ngens(1)

Definition at line 88 of file ntt_verification.sage.py.

◆ results

dict ntt_verification.results
Initial value:
1= {
2 "parameters": {"q": q, "n": n, "zeta": zeta},
3 "verifications": {}
4}

Definition at line 20 of file ntt_verification.sage.

◆ results_dir

ntt_verification.results_dir = os.path.join(os.path.dirname(os.path.dirname(script_dir)), "results")

Definition at line 152 of file ntt_verification.sage.

◆ script_dir

ntt_verification.script_dir = os.path.dirname(os.path.abspath(__file__))

Definition at line 151 of file ntt_verification.sage.

◆ status

str ntt_verification.status = "PASS" if value else "FAIL"

Definition at line 139 of file ntt_verification.sage.

◆ zeta

ntt_verification.zeta = 17

Definition at line 18 of file ntt_verification.sage.

◆ zeta_128

ntt_verification.zeta_128 = zeta_Zq^128

Definition at line 52 of file ntt_verification.sage.

◆ zeta_256

ntt_verification.zeta_256 = zeta_Zq^256

Definition at line 45 of file ntt_verification.sage.

◆ zeta_64

ntt_verification.zeta_64 = zeta_Zq^64

Definition at line 59 of file ntt_verification.sage.

◆ zeta_Zq

ntt_verification.zeta_Zq = Zq(zeta)

Definition at line 42 of file ntt_verification.sage.

◆ Zq

ntt_verification.Zq = GF(q)

Definition at line 28 of file ntt_verification.sage.