https://github.com/georgiifirsov/galois-lib
Finite field arithmetic library written for my research in cryptography
https://github.com/georgiifirsov/galois-lib
arithmetic cryptography finite-field-arithmetic finite-field-arithmetics finite-fields galois-field mathematics symmetric-cryptography
Last synced: about 1 year ago
JSON representation
Finite field arithmetic library written for my research in cryptography
- Host: GitHub
- URL: https://github.com/georgiifirsov/galois-lib
- Owner: GeorgiiFirsov
- License: gpl-3.0
- Created: 2023-07-02T17:44:34.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-12T21:07:40.000Z (over 2 years ago)
- Last Synced: 2025-02-16T04:29:07.173Z (over 1 year ago)
- Topics: arithmetic, cryptography, finite-field-arithmetic, finite-field-arithmetics, finite-fields, galois-field, mathematics, symmetric-cryptography
- Language: C
- Homepage: https://georgyfirsov.github.io/galois-lib/
- Size: 281 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# galois-lib
This library implements some arithmetic operations in finite fields.
## Implemented operations
`galois-lib` implements not so many algorithms, because it is designed to be a helper library
for cryptographic libraries. Hence it contains only few necessary operations.
### Multiplication in $GF(2 ^ {8})$
Multiplication in finite field of size $2 ^ {8}$ is implemented using precomputed
logarithm and exponents tables. It works according to the following obvious formula:
$$
a \cdot b = \exp \left( \log a + \log b \right),
$$
where all operations are assumed to be in the finite field.
### multiplication in $GF(2 ^ {128})$
Multiplication in $GF(2 ^ {128})$ is implemented using some kind of Karatsuba algorithm
with help of `pclmulqdq` instruction. More information here: [Intel® Carry-Less Multiplication
Instruction and its Usage for Computing the GCM Mode][1].
[1]: https://www.intel.com/content/dam/develop/external/us/en/documents/clmul-wp-rev-2-02-2014-04-20.pdf