Skip to content

Commit

Permalink
chore(CI): update LE commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bencrts committed Aug 12, 2024
1 parent 07d143e commit d9cc0ca
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/parameters_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
with:
repository: malb/lattice-estimator
path: lattice_estimator
ref: '53508253629d3b5d31a2ad110e85dc69391ccb95'

- name: Install Sage
run: |
Expand All @@ -37,7 +36,15 @@ jobs:
- name: Perform security check
run: |
PYTHONPATH=lattice_estimator sage ci/lattice_estimator.sage
PYTHONPATH=lattice_estimator sage ci/lattice_estimator.sage 0 "boolean_parameters_lattice_estimator"
PYTHONPATH=lattice_estimator sage ci/lattice_estimator.sage 1 "boolean_parameters_lattice_estimator"
PYTHONPATH=lattice_estimator sage ci/lattice_estimator.sage 2 "boolean_parameters_lattice_estimator"
PYTHONPATH=lattice_estimator sage ci/lattice_estimator.sage 0 "shortint_classic_parameters_lattice_estimator"
PYTHONPATH=lattice_estimator sage ci/lattice_estimator.sage 1 "shortint_classic_parameters_lattice_estimator"
PYTHONPATH=lattice_estimator sage ci/lattice_estimator.sage 2 "shortint_classic_parameters_lattice_estimator"
PYTHONPATH=lattice_estimator sage ci/lattice_estimator.sage 0 "shortint_multi_bit_parameters_lattice_estimator"
PYTHONPATH=lattice_estimator sage ci/lattice_estimator.sage 1 "shortint_multi_bit_parameters_lattice_estimator"
PYTHONPATH=lattice_estimator sage ci/lattice_estimator.sage 2 "shortint_multi_bit_parameters_lattice_estimator"
- name: Slack Notification
if: ${{ always() }}
Expand Down
28 changes: 19 additions & 9 deletions ci/lattice_estimator.sage
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import sys
sys.path.insert(1, "lattice-estimator")
from estimator import *

# sys args to split lists to manage memory for the CI
split = 3
part = int(sys.argv[1])
name = sys.argv[2]

model = RC.MATZOV

Expand All @@ -34,7 +38,10 @@ def check_security(filename):
to_update = []
to_watch = []

for param in all_params:
import numpy as np

# split the list to help with memory consumption
for param in list(np.array_split(all_params,split)[part]):
if param.tag.startswith("TFHE_LIB_PARAMETERS"):
# This third-party parameters set is known to be less secure, just skip the analysis.
continue
Expand Down Expand Up @@ -87,14 +94,17 @@ if __name__ == "__main__":
params_to_update = []
params_to_watch = []

for params_filename in (
"boolean_parameters_lattice_estimator.sage",
"shortint_classic_parameters_lattice_estimator.sage",
"shortint_multi_bit_parameters_lattice_estimator.sage",
):
to_update, to_watch = check_security(params_filename)
params_to_update.extend(to_update)
params_to_watch.extend(to_watch)
params_filename = "{}.sage".format(name)

#in (
# "boolean_parameters_lattice_estimator.sage",
# "shortint_classic_parameters_lattice_estimator.sage",
# "shortint_multi_bit_parameters_lattice_estimator.sage",
#):

to_update, to_watch = check_security(params_filename)
params_to_update.extend(to_update)
params_to_watch.extend(to_watch)

if params_to_watch:
print("Some parameters need attention")
Expand Down

0 comments on commit d9cc0ca

Please sign in to comment.