Expand description
P-256 scalar field helpers.
Wraps p256::Scalar operations needed for Shamir secret sharing
and Lagrange interpolation.
Functionsยง
- random_
scalar - Generate a random scalar.
- scalar_
add - Add two scalars.
- scalar_
from_ bytes - Convert raw big-endian bytes (32 bytes) into a
Scalar. Returns None if bytes are not 32 long or if the value is out of range. - scalar_
invert - Modular inverse of a scalar (1/a mod n). Returns ZERO if
ais zero. - scalar_
mul - Multiply two scalars.
- scalar_
sub - Subtract one scalar from another.
- scalar_
to_ bytes - Convert a
Scalarto 32 big-endian bytes.