You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question about the generator and primitive _nth_root, it says the code also needs to supply the user with a generator for the entire multiplicative group, What is the entire multiplicative group, is it Fp*?
If the root is the generator of Fp*, how to derive the primitive_nth_root? why is the 407 omitted in the primitive_nth_root function? Can you tell me, thanks
def generator( self ):
assert(self.p == 1 + 407 * ( 1 << 119 )), "Do not know generator for other fields beyond 1+407*2^119"
return FieldElement(85408008396924667383611388730472331217, self)
def primitive_nth_root( self, n ):
if self.p == 1 + 407 * ( 1 << 119 ):
assert(n <= 1 << 119 and (n & (n-1)) == 0), "Field does not have nth root of unity where n > 2^119 or not power of two."
root = FieldElement(85408008396924667383611388730472331217, self)
order = 1 << 119
while order != n:
root = root^2
order = order/2
return root
else:
assert(False), "Unknown field, can't return root of unity."
The text was updated successfully, but these errors were encountered:
The entire multiplicative group is $\mathbb{F}_p^* = \mathbb{F}_p \backslash \lbrace 0 \rbrace$. A generator for it is a single element $g$ such that $\langle g \rangle = \lbrace g^i | i \in \mathbb{Z} \rbrace = \mathbb{F}_p^*$. The order of $g$ is always $p-1$ so in fact it is also correct to say $\langle g \rangle = \lbrace g^i | 0 \leq i < p-1 \rbrace$ because the powers of $g$ outside this range fold onto powers of $g$ inside this range.
The function generator returns not a generator for the entire multiplicative group but only for the subgroup of order $2^{119}$.
I have a question about the generator and primitive _nth_root, it says the code also needs to supply the user with a generator for the entire multiplicative group, What is the entire multiplicative group, is it Fp*?
If the
root
is the generator of Fp*, how to derive theprimitive_nth_root
? why is the 407 omitted in the primitive_nth_root function? Can you tell me, thanksThe text was updated successfully, but these errors were encountered: