松岡 航太郎
# To reproduce the estimate run this snippet on http://aleph.sagemath.org/ from sage.all import load, sqrt, RR, ZZ, pi, oo load('https://bitbucket.org/malb/lwe-estimator/raw/HEAD/estimator.py') n = 1024 # ciphertext dimension (also, key entropy) sd = 2**(-25) # noise standard deviation alpha = sqrt(2*pi)*sd # estimator defines noise rate = sqrt(2pi).stdev q = 2**32 # for compatibility only (通常のLWEはTorusじゃなくて整数係数) m = oo # the attacker can use as many samples he wishes secret_distribution = (0,1) success_probability = 0.99 # Chosen cost model(主に2種類の攻撃パターンがある) print("CLASSICAL PRIMAL") #LWEの秘密鍵を直接得る攻撃 print(primal_usvp(n, alpha, q, secret_distribution=secret_distribution, m=m, success_probability=success_probability, reduction_cost_model=BKZ.sieve)) print("CLASSICAL DUAL") #乱数と暗号文を識別する攻撃 print(dual_scale(n, alpha, q, secret_distribution=secret_distribution, m=m, success_probability=success_probability, reduction_cost_model=BKZ.sieve))
page_number: true