mirror of
https://github.com/logos-co/nomos-specs.git
synced 2025-01-23 22:08:57 +00:00
422359acd7
* Kickstart fk20 * Implement i/fft from ethspecs * Expand test to different sizes * Implement toeplizt * Finish implementing fk20 * Fix roots of unity generation * Implement fft for g1 values * Fix fk20 and tests * Add len assertion in test * Fix roots computations * Fix test * Fix imports * Fmt * Docs and format
15 lines
519 B
Python
15 lines
519 B
Python
from unittest import TestCase
|
|
|
|
from .roots import compute_roots_of_unity
|
|
from .common import BLS_MODULUS
|
|
from .fft import fft, ifft
|
|
|
|
|
|
class TestFFT(TestCase):
|
|
def test_fft_ifft(self):
|
|
for size in [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]:
|
|
roots_of_unity = compute_roots_of_unity(2, size, BLS_MODULUS)
|
|
vals = list(x for x in range(size))
|
|
vals_fft = fft(vals, roots_of_unity, BLS_MODULUS)
|
|
self.assertEqual(vals, ifft(vals_fft, roots_of_unity, BLS_MODULUS))
|