Understanding LLL_nonce_leakage.py with Simple Math

3 replies 484 views
wolf_2020Member
Posts: 9 · Reputation: 229
#1Sep 12, 2021, 12:02 AM
import olll import random import math import secp256k1 as ice G = ice.scalar_multiplication(1) N = ice.N # Secret key = x = (rns1 r1sn)-1 (snm1 s1mn s1sn(k1 kn)) # For most significant fix 128 bit leak at least 3 sig is required. fix_bits = 128 out_file_name = 'pseudo_sig_rsz.txt' kbits = 256 fix_bits #============================================================================== def write_rsz_file(rr, ss, zz, pb): with open(out_file_name, 'w') as f: sz = len(rr) for i in range(sz): f.write('r = ' + hex(rr)[2:].zfill(64) + '\n')...
2 Reply Quote Share
dan2015Hero Member
Posts: 41 · Reputation: 3344
#2Sep 12, 2021, 03:03 AM
you gotta download or clone the file from here and put it in the same folder as the LLL program. also, remember to use ice_secp256k1.dll or.so if you're on linux. check it out: https://github.com/iceland2k14/secp256k1
6 Reply Quote Share
wolf_2020Member
Posts: 9 · Reputation: 229
#3Sep 12, 2021, 11:18 AM
I get that, but I really want some simple math to understand this better. can anyone break down how LLL_nonce_leakage works? like, real easy math or something?
0 Reply Quote Share
jakechadSenior Member
Posts: 2 · Reputation: 1992
#4Sep 12, 2021, 11:31 AM
Lenstra–Lenstra–Lovász lattice basis reduction algorithm is not something you can just simplify with basic math. it's way more complex. maybe read up on it a bit more before diving in.
4 Reply Quote Share

Related topics