nomos-specs/da/kzg_rs/roots.py
Daniel Sanchez 09c9b7e4ec
Da rs core (#75)
* Implement generator polynomial and rs encoding

* Implement encode/decode+test using fft. Non-working

* Use lagrange for interpolation

* Remove fft, use evaluations instead

* Move and rename kzg and rs test modules

* Update docs
2024-03-05 16:53:14 +01:00

15 lines
413 B
Python

def compute_roots_of_unity(primitive_root, p, n):
"""
Compute the roots of unity modulo p.
Parameters:
primitive_root (int): Primitive root modulo p.
p (int): Modulus.
n (int): Number of roots of unity to compute.
Returns:
list: List of roots of unity modulo p.
"""
roots_of_unity = [pow(primitive_root, i, p) for i in range(n)]
return roots_of_unity