mirror of
https://github.com/logos-co/nomos-specs.git
synced 2025-02-09 22:14:46 +00:00
* 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
15 lines
413 B
Python
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
|