From 72de6a8835637aba3d49234cd1e2dbdb4c7dbee8 Mon Sep 17 00:00:00 2001 From: Ben <16917183+bencrts@users.noreply.github.com> Date: Thu, 1 Aug 2024 08:36:30 +0100 Subject: [PATCH] chore(CI): update LE commit --- .github/workflows/parameters_check.yml | 11 ++++++++-- ci/lattice_estimator.sage | 28 +++++++++++++++++--------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.github/workflows/parameters_check.yml b/.github/workflows/parameters_check.yml index 633de43287..f461cad7ab 100644 --- a/.github/workflows/parameters_check.yml +++ b/.github/workflows/parameters_check.yml @@ -24,7 +24,6 @@ jobs: with: repository: malb/lattice-estimator path: lattice_estimator - ref: '53508253629d3b5d31a2ad110e85dc69391ccb95' - name: Install Sage run: | @@ -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() }} diff --git a/ci/lattice_estimator.sage b/ci/lattice_estimator.sage index 46aaf9acb3..163eeb3975 100755 --- a/ci/lattice_estimator.sage +++ b/ci/lattice_estimator.sage @@ -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 @@ -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 @@ -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")