infidel_poly/README.md

48 lines
1.2 KiB
Markdown
Raw Normal View History

2022-04-15 02:57:41 -04:00
# infidel_poly
2022-04-15 03:20:51 -04:00
C polynomial library for ECC based cryptography.
## References
- **Libntru** : Polynomial multiplication and inversion [commit](https://github.com/tbuktu/libntru/commit/15423e7f5f44d5ef69cb4aa50eaa03c07a7ecad0)
- **Sanfoundry** : [C Program to Evaluate given polynomial equation](https://www.sanfoundry.com/c-program-polynomial-equation/)
2022-04-15 03:48:08 -04:00
## Libntru Notes
Libntru use some custom data types declared in `types.h`.
2022-04-16 04:38:03 -04:00
> `uint8_t` : Unsigned 8-bit integer
> `uint16_t` : Unsigned 16-bit integer
2022-04-15 03:48:08 -04:00
`NtruIntPoly` : Polynomial with 16-bit integer coefficients
```c
typedef struct NtruIntPoly {
uint16_t N;
int16_t coeffs[NTRU_INT_POLY_SIZE];
} NtruIntPoly;
```
`NtruTernPoly` : Ternary polynomial, all coefficients are equal to -1, 0, or 1.
```c
typedef struct NtruTernPoly {
uint16_t N;
uint16_t num_ones;
uint16_t num_neg_ones;
uint16_t ones[NTRU_MAX_ONES];
uint16_t neg_ones[NTRU_MAX_ONES];
} NtruTernPoly;
```
2022-04-15 03:20:51 -04:00
## Key Components
2022-04-15 03:48:08 -04:00
- [ ] Basic Evaluation on generated equation
2022-04-15 03:20:51 -04:00
- [ ] Basic Operation (Addition, Reduction, Multiplication, Division)
- [ ] Advance Operation (Inversion)
- [ ] Bitwise for array
- [ ] Pointer management for polynomial indexes
2022-04-16 04:38:03 -04:00
- [ ] ~~Random Generators~~
2022-04-15 03:20:51 -04:00