diff --git a/kerngen/README.md b/kerngen/README.md index f112d9f..1f76ca5 100644 --- a/kerngen/README.md +++ b/kerngen/README.md @@ -104,7 +104,7 @@ All other commands are assumed to be operations. All operations are case insensitive, but the convention we use is the operations are capitalized. These are defined in the [manifest.json](./pisa_generators/manifest.json) file. ``` -CONTEXT BGV 8192 4 +CONTEXT BGV 8192 4 3 DATA a 2 DATA b 2 DATA c 2 @@ -112,8 +112,8 @@ ADD c a b ``` ## CONTEXT -Context defines the global properties `(scheme, poly_order, max_rns, -key_rns(optional))` of the input script. +Context defines the global properties `(scheme, poly_ring_dimension, max_rns, +current_rns)` of the input script. `CONTEXT` sets a global context for properties required by the kernels. - first field defines what we call scheme. In reality, it specifies the set of kernel instructions given in the manifest file, see @@ -121,12 +121,8 @@ kernel instructions given in the manifest file, see - second field defines the polynomial size for the `DATA`. This is required by the generating kernels to define how many units (multiples of the native polynomial size, 8192 in HERACLES silicon case) are required and handled. -- third field defines the max RNS, the global max number of how many 32 bit prime number moduli -(HERACLES silicon case) are in the modulus chain that the kernels can have or need to handle. -- (optional) fourth field defines the key RNS, the number of additional moduli -that the relinearization key has relative to the third field. i.e. If `max_rns` -is 3 and `key_rns` is 1 the total max RNS of the relinearization key will be 4. -Note this field is only required for calling the `relin` kernel. +- third field defines the key RNS, i.e. the total max RNS of the relinearization key, typically the global max number of how many 32 bit prime number moduli (HERACLES silicon case) are in the modulus chain that the kernels can have or need to handle + 1. +- fourth field defines the number of RNS terms in the current polynomial. ## DATA `DATA` defines polynomial symbols to be used and their attribute(s) (`num_parts`) where diff --git a/kerngen/tutorials/SimpleExamples/ADD_8K1rns.ker b/kerngen/tutorials/SimpleExamples/ADD_8K1rns.ker deleted file mode 100644 index 14b5673..0000000 --- a/kerngen/tutorials/SimpleExamples/ADD_8K1rns.ker +++ /dev/null @@ -1,5 +0,0 @@ -CONTEXT BGV 8192 1 -DATA a 1 -DATA b 1 -DATA c 1 -ADD c a b diff --git a/kerngen/tutorials/SimpleExamples/ADD_8K4rns.ker b/kerngen/tutorials/SimpleExamples/ADD_8K4rns.ker deleted file mode 100644 index e42b881..0000000 --- a/kerngen/tutorials/SimpleExamples/ADD_8K4rns.ker +++ /dev/null @@ -1,5 +0,0 @@ -CONTEXT BGV 8192 4 -DATA a 1 -DATA b 1 -DATA c 1 -ADD c a b diff --git a/kerngen/tutorials/SimpleExamples/ADD_C8K1rns.ker b/kerngen/tutorials/SimpleExamples/ADD_C8K1rns.ker deleted file mode 100644 index 547f265..0000000 --- a/kerngen/tutorials/SimpleExamples/ADD_C8K1rns.ker +++ /dev/null @@ -1,5 +0,0 @@ -CONTEXT BGV 8192 1 -DATA a 2 -DATA b 2 -DATA c 2 -ADD c a b diff --git a/kerngen/tutorials/SimpleExamples/ADD_C8K4rns.ker b/kerngen/tutorials/SimpleExamples/ADD_C8K4rns.ker deleted file mode 100644 index 9123a94..0000000 --- a/kerngen/tutorials/SimpleExamples/ADD_C8K4rns.ker +++ /dev/null @@ -1,5 +0,0 @@ -CONTEXT BGV 8192 4 -DATA a 2 -DATA b 2 -DATA c 2 -ADD c a b diff --git a/kerngen/tutorials/SimpleExamples/ADD_16K1rns.ker b/tutorials/kerngen/SimpleExamples/ADD_16K1rns.ker similarity index 62% rename from kerngen/tutorials/SimpleExamples/ADD_16K1rns.ker rename to tutorials/kerngen/SimpleExamples/ADD_16K1rns.ker index b086a98..39f92a4 100644 --- a/kerngen/tutorials/SimpleExamples/ADD_16K1rns.ker +++ b/tutorials/kerngen/SimpleExamples/ADD_16K1rns.ker @@ -1,4 +1,4 @@ -CONTEXT BGV 16384 1 +CONTEXT BGV 16384 2 1 DATA a 1 DATA b 1 DATA c 1 diff --git a/kerngen/tutorials/SimpleExamples/ADD_16K4rns.ker b/tutorials/kerngen/SimpleExamples/ADD_16K4rns.ker similarity index 62% rename from kerngen/tutorials/SimpleExamples/ADD_16K4rns.ker rename to tutorials/kerngen/SimpleExamples/ADD_16K4rns.ker index 4901547..da1383c 100644 --- a/kerngen/tutorials/SimpleExamples/ADD_16K4rns.ker +++ b/tutorials/kerngen/SimpleExamples/ADD_16K4rns.ker @@ -1,4 +1,4 @@ -CONTEXT BGV 16384 4 +CONTEXT BGV 16384 5 4 DATA a 1 DATA b 1 DATA c 1 diff --git a/kerngen/tutorials/SimpleExamples/ADD_C16K1rns_pyramid.ker b/tutorials/kerngen/SimpleExamples/ADD_C16K1rns_pyramid.ker similarity index 91% rename from kerngen/tutorials/SimpleExamples/ADD_C16K1rns_pyramid.ker rename to tutorials/kerngen/SimpleExamples/ADD_C16K1rns_pyramid.ker index 6aa53fe..1989917 100644 --- a/kerngen/tutorials/SimpleExamples/ADD_C16K1rns_pyramid.ker +++ b/tutorials/kerngen/SimpleExamples/ADD_C16K1rns_pyramid.ker @@ -1,4 +1,4 @@ -CONTEXT BGV 16384 1 +CONTEXT BGV 16384 2 1 # inputs DATA a 2 DATA b 2 diff --git a/kerngen/tutorials/SimpleExamples/ADD_C16K4rns.ker b/tutorials/kerngen/SimpleExamples/ADD_C16K4rns.ker similarity index 62% rename from kerngen/tutorials/SimpleExamples/ADD_C16K4rns.ker rename to tutorials/kerngen/SimpleExamples/ADD_C16K4rns.ker index 78429c2..5f7a9fe 100644 --- a/kerngen/tutorials/SimpleExamples/ADD_C16K4rns.ker +++ b/tutorials/kerngen/SimpleExamples/ADD_C16K4rns.ker @@ -1,4 +1,4 @@ -CONTEXT BGV 16384 4 +CONTEXT BGV 16384 5 4 DATA a 2 DATA b 2 DATA c 2 diff --git a/kerngen/tutorials/SimpleExamples/MUL_C16K1rns.ker b/tutorials/kerngen/SimpleExamples/MUL_C16K1rns.ker similarity index 62% rename from kerngen/tutorials/SimpleExamples/MUL_C16K1rns.ker rename to tutorials/kerngen/SimpleExamples/MUL_C16K1rns.ker index 7f0486c..c875a4f 100644 --- a/kerngen/tutorials/SimpleExamples/MUL_C16K1rns.ker +++ b/tutorials/kerngen/SimpleExamples/MUL_C16K1rns.ker @@ -1,4 +1,4 @@ -CONTEXT BGV 16384 1 1 +CONTEXT BGV 16384 2 1 DATA a 2 DATA b 2 DATA c 3 diff --git a/kerngen/tutorials/SimpleExamples/RELIN_C16K1rns.ker b/tutorials/kerngen/SimpleExamples/RELIN_C16K1rns.ker similarity index 56% rename from kerngen/tutorials/SimpleExamples/RELIN_C16K1rns.ker rename to tutorials/kerngen/SimpleExamples/RELIN_C16K1rns.ker index bba9ae5..4f7f924 100644 --- a/kerngen/tutorials/SimpleExamples/RELIN_C16K1rns.ker +++ b/tutorials/kerngen/SimpleExamples/RELIN_C16K1rns.ker @@ -1,4 +1,4 @@ -CONTEXT BGV 16384 1 1 +CONTEXT BGV 16384 2 1 DATA a 3 DATA b 2 RELIN b a