Skip to content

Commit

Permalink
Merge pull request #113 from malb/hes-test
Browse files Browse the repository at this point in the history
Another fix + add params to doctest
  • Loading branch information
malb committed Jun 11, 2024
2 parents f18533a + b7c27da commit e9f6a48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion docs/schemes/hes.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Homomorphic Encryption Standard
Homomorphic Encryption Parameters
===============================

::
Expand All @@ -19,3 +19,11 @@ Homomorphic Encryption Standard
>>> LWE.primal_hybrid(HESv111024128ternary)
rop: ≈2^182.5, red: ≈2^181.7, svp: ≈2^181.4, β: 345, η: 2, ζ: 134, |S|: ≈2^212.4, d: 1915, prob: ≈2^-51.2, ↻: ≈2^53.4, tag: hybrid
::

>>> from estimator import *
>>> from estimator.schemes import SEAL22_8192
>>> SEAL22_8192
LWEParameters(n=8192, q=107839786668602559178668060348078522694548577690162289924414373888001, Xs=D(σ=0.82), Xe=D(σ=3.19), m=+Infinity, tag='SEAL22_8192')
>>> LWE.dual_hybrid(SEAL22_8192)
rop: ≈2^121.8, red: ≈2^121.8, guess: ≈2^107.6, β: 306, p: 3, ζ: 5, t: 50, β': 331, N: ≈2^67.3, m: ≈2^13.0
4 changes: 2 additions & 2 deletions estimator/reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ def short_vectors(self, beta, d, N=None, preprocess=True, B=None, C=5.46, sieve_
N = floor(2 ** (0.2075 * sieve_dim)) # pick something

c0 = RR(N)
c1 = RR(2 ** (0.2075 * sieve_dim))
c1 = RR(2 ** RR(0.2075 * sieve_dim))
c = c0 / floor(c1)
sieve_cost = C * 2 ** RR((self.NN_AGPS[self.nn]["a"] * sieve_dim + self.NN_AGPS[self.nn]["b"]))

Expand All @@ -920,7 +920,7 @@ def short_vectors(self, beta, d, N=None, preprocess=True, B=None, C=5.46, sieve_
return (
rho,
ceil(c) * (self(beta, d) + sieve_cost),
ceil(c) * floor(2 ** (0.2075 * sieve_dim)),
ceil(c) * floor(c1),
sieve_dim,
)

Expand Down

0 comments on commit e9f6a48

Please sign in to comment.