std.crypto.ecc.Secp256k1.scalar
The entries of std.crypto.ecc.Secp256k1.scalar in the Zig reference. This page has 33 cards.
pub fn add(a: CompressedScalar, b: CompressedScalar, endian: std.builtin.Endian) NonCanonicalError!CompressedScalar
Return a+b (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
A compressed scalar, in canonical form.
- Kind
- type
- Module
std.crypto.ecc.Secp256k1.scalar
Number of bytes required to encode a scalar.
- Kind
- constant
- Module
std.crypto.ecc.Secp256k1.scalar
The scalar field order.
- Kind
- constant
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn mul(a: CompressedScalar, b: CompressedScalar, endian: std.builtin.Endian) NonCanonicalError!CompressedScalar
Return a*b (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn mulAdd(a: CompressedScalar, b: CompressedScalar, c: CompressedScalar, endian: std.builtin.Endian) NonCanonicalError!CompressedScalar
Return a*b+c (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn neg(s: CompressedScalar, endian: std.builtin.Endian) NonCanonicalError!CompressedScalar
Return -s (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn random(io: std.Io, endian: std.builtin.Endian) CompressedScalar
Return a random scalar.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn reduce48(s: [48]u8, endian: std.builtin.Endian) CompressedScalar
Reduce a 48-bytes scalar to the field size.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn reduce64(s: [64]u8, endian: std.builtin.Endian) CompressedScalar
Reduce a 64-bytes scalar to the field size.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn rejectNonCanonical(s: CompressedScalar, endian: std.builtin.Endian) NonCanonicalError!void
Reject a scalar whose encoding is not canonical.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
A scalar in unpacked representation.
- Kind
- struct
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn add(x: Scalar, y: Scalar) Scalar
Compute x+y (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn dbl(n: Scalar) Scalar
Compute 2n (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn equivalent(a: Scalar, b: Scalar) bool
Return true if a and b are equivalent.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn fromBytes(s: CompressedScalar, endian: std.builtin.Endian) NonCanonicalError!Scalar
Unpack a serialized representation of a scalar.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn fromBytes48(s: [48]u8, endian: std.builtin.Endian) Scalar
Reduce a 384 bit input to the field size.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn fromBytes64(s: [64]u8, endian: std.builtin.Endian) Scalar
Reduce a 512 bit input to the field size.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn invert(n: Scalar) Scalar
Compute x^-1 (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn isOdd(n: Scalar) bool
Return true if the scalar is odd.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn isSquare(n: Scalar) bool
Return true if n is a quadratic residue mod L.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn isZero(n: Scalar) bool
Return true if the scalar is zero.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn mul(x: Scalar, y: Scalar) Scalar
Compute x*y (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn neg(n: Scalar) Scalar
Compute -x (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
- Kind
- constant
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn pow(a: Scalar, comptime T: type, comptime n: T) Scalar
Compute x^n (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn random(io: std.Io) Scalar
Return a random scalar < L.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn sq(n: Scalar) Scalar
Compute x^2 (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn sqrt(n: Scalar) NotSquareError!Scalar
Return the square root of L, or NotSquare if there isn't any solutions.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn sub(x: Scalar, y: Scalar) Scalar
Compute x-y (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn toBytes(n: Scalar, endian: std.builtin.Endian) CompressedScalar
Pack a scalar into bytes.
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar
- Kind
- constant
- Module
std.crypto.ecc.Secp256k1.scalar
pub fn sub(a: CompressedScalar, b: CompressedScalar, endian: std.builtin.Endian) NonCanonicalError!CompressedScalar
Return (a-b) (mod L).
- Kind
- function
- Module
std.crypto.ecc.Secp256k1.scalar