Supported Fields
Here are the kinds of fields supported in Keelung:
Any prime field larger than or equal to (fields with 17 elements)
Choice of fields
Commands like compile would ask you to specify which kind of field to use, when compiling the program into the constraint system over that field:
compile gf181 echo [] [2]The example above uses gf181 , which is actually a prime field defined as:
gf181 :: FieldType
gf181 = Prime 1552511030102430251236801561344621993261920897571225601The FieldType datatype
FieldType datatypeYou can choose another kind of finite field by giving a different FieldType. Here’s how FieldType is declared under the hood:
data FieldType = Prime Integer
| Binary IntegerBoth Prime and Binary takes an Integer as the parameter, but we’ll see that they have different meanings.
Prime fields
Different prime fields have different prime characteristics. The Integer in Prime stands for that prime characteristics.
Bad things would happen if you attempt to provide composite (non-prime) numbers as parameters for Prime.
Binary fields
Binary extension fields, on the other hand, are characterized by irreducible polynomials.
These irreducible polynomials can be expressed as numbers, and that’s what the Integer in Binary is for.
Take Rijndael's (AES) finite field GF(2)[x]/(x⁸ + x⁴ + x³ + x + 1) as example, if we represent each term of the polynomial as a bit in a binary number, the irreducible polynomial x⁸ + x⁴ + x³ + x + 1 can be encoded in the binary form as 0b100011011 (or 283 in decimal). Put this number in Binary and you’ll get a FieldType:
Examples
You can use any Prime or Binary field you like. Here are some other popular choices:
Last updated