MCPcopy
hub / github.com/ethereum/research / p_mod_shift

Function p_mod_shift

binary_fft/ethereum_data_root.py:28–38  ·  view source on GitHub ↗
(field, poly)

Source from the content-addressed store, hash-verified

26
27# Alternative simplified but less efficient FFT implementation
28def p_mod_shift(field, poly):
29 shift_poly = shift_polys[log2(len(poly))]
30 half_height = len(poly)//2
31 low = poly[::]
32 high = []
33 while len(high) < half_height:
34 high.insert(0, field.div(low[-1], shift_poly[-1]))
35 for i, coeff in enumerate(shift_poly[:-1]):
36 low[-half_height-1+2**i] ^= field.mul(high[0], coeff)
37 low.pop()
38 return high, low
39
40def fft2(field, poly):
41 # if len(poly) == 1:

Callers 1

fft2Function · 0.85

Calls 4

popMethod · 0.80
log2Function · 0.70
divMethod · 0.45
mulMethod · 0.45

Tested by

no test coverage detected