mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-08 08:03:13 +00:00
Expand test to different sizes
This commit is contained in:
parent
0488748d5d
commit
9ffbad1b2f
@ -6,8 +6,9 @@ from fft import fft, ifft
|
||||
|
||||
class TestFFT(TestCase):
|
||||
def test_fft_ifft(self):
|
||||
roots_of_unity = [pow(23674694431658770659612952115660802947967373701506253797663184111817857449850, i, BLS_MODULUS) for i in range(1024)]
|
||||
vals = list(x for x in range(1024))
|
||||
vals_fft = fft(vals, roots_of_unity, BLS_MODULUS)
|
||||
self.assertEqual(vals, ifft(vals_fft, roots_of_unity, BLS_MODULUS))
|
||||
for size in [256, 512, 1024, 2048, 4096]:
|
||||
roots_of_unity = [pow(23674694431658770659612952115660802947967373701506253797663184111817857449850, i, BLS_MODULUS) for i in range(size)]
|
||||
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))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user