From 4bdcd7cd51d4c00b3c3e9accad243e7d1c597ebe Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 27 Jan 2023 13:18:17 +0000 Subject: [PATCH] add a small comment --- lattice-scripts/fast_script.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lattice-scripts/fast_script.py b/lattice-scripts/fast_script.py index 75073187b..c0c5804e5 100644 --- a/lattice-scripts/fast_script.py +++ b/lattice-scripts/fast_script.py @@ -3,6 +3,14 @@ def n(sd): def ternary_search(params_in, sds): + """ + A fast script to find a rough parameter curve for ternary secrets + + USAGE: + + SDs = range(4,62) + ternary_search(schemes.TFHE630, SDs) + """ out = [] @@ -12,7 +20,13 @@ def ternary_search(params_in, sds): n_new = out[i-1][0] except: n_new = ceil(n(-1 * sd)) + + # these are the parameters to edit if we want to try something new. + # Xe remains constant throughout the script (e.g. D(sigma)) but we could try + # new secret distributions or moduli using this script. + # to set the moduli, change the below line params_in = params_in.updated(q = 2**64) + # to set the secret distribution, change the below line params_in = params_in.updated(Xs = ND.UniformMod(3)) params_in = params_in.updated(Xe = ND.DiscreteGaussian(2**sd)) params_in = params_in.updated(n = n_new)