pyecsca.ec.mod.symbolic module¶
- class SymbolicMod(x, n)[source]¶
Bases:
Mod
A symbolic element x of ℤₙ (implemented using sympy).
- bit_length()[source]¶
Compute the bit length of this element (in its positive integer representation).
- Returns:
The bit-length.
- inverse()[source]¶
Invert the element.
- Return type:
- Returns:
The inverse.
- Raises:
NonInvertibleError
if the element is not invertible.
- sqrt()[source]¶
Compute the modular square root of this element (only implemented for prime modulus).
Uses the Tonelli-Shanks algorithm.
- Return type: