diff --git a/kerngen/README.md b/kerngen/README.md index f112d9f6..1f76ca50 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 14b56730..00000000 --- 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 e42b8810..00000000 --- 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 547f265c..00000000 --- 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 9123a941..00000000 --- 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 b086a982..39f92a4c 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 49015475..da1383c4 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 6aa53fe0..19899172 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 78429c2f..5f7a9fe3 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 7f0486c5..c875a4f4 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 bba9ae52..4f7f9244 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