Group operations over P384.

Fields

x: Fe,
y: Fe,
z: Fe = Fe.one,
is_base: bool = false,

Namespaces

Functions

fn add(p: P384, q: P384) P384

Add P384 points.

fn addMixed(p: P384, q: AffineCoordinates) P384

Add P384 points, the second being specified using affine coordinates.

fn affineCoordinates(p: P384) AffineCoordinates

Return affine coordinates.

fn dbl(p: P384) P384

Double a P384 point.

fn equivalent(a: P384, b: P384) bool

Return true if both coordinate sets represent the same point.

fn fromAffineCoordinates(p: AffineCoordinates) EncodingError!P384

Create a point from affine coordinates after checking that they match the curve …

Create a point from affine coordinates after checking that they match the curve equation.

fn fromSec1(s: []const u8) EncodingError || NotSquareError || NonCanonicalError!P384

Deserialize a SEC1-encoded point.

fn fromSerializedAffineCoordinates(xs: [48]u8, ys: [48]u8, endian: std.builtin.Endian) NonCanonicalError || EncodingError!P384

Create a point from serialized affine coordinates.

fn mul(p: P384, s_: [48]u8, endian: std.builtin.Endian) IdentityElementError!P384

Multiply an elliptic curve point by a scalar. Return error.IdentityElement if t…

Multiply an elliptic curve point by a scalar. Return error.IdentityElement if the result is the identity element.

fn mulDoubleBasePublic(p1: P384, s1_: [48]u8, p2: P384, s2_: [48]u8, endian: std.builtin.Endian) IdentityElementError!P384

Double-base multiplication of public parameters - Compute (p1s1)+(p2s2) *IN VA…

Double-base multiplication of public parameters - Compute (p1s1)+(p2s2) IN VARIABLE TIME This can be used for signature verification.

fn mulPublic(p: P384, s_: [48]u8, endian: std.builtin.Endian) IdentityElementError!P384

Multiply an elliptic curve point by a PUBLIC scalar IN VARIABLE TIME This c…

Multiply an elliptic curve point by a PUBLIC scalar IN VARIABLE TIME This can be used for signature verification.

fn neg(p: P384) P384

Flip the sign of the X coordinate.

fn random() P384

Return a random point.

fn recoverY(x: Fe, is_odd: bool) NotSquareError!Fe

Recover the Y coordinate from the X coordinate.

fn rejectIdentity(p: P384) IdentityElementError!void

Reject the neutral element.

fn sub(p: P384, q: P384) P384

Subtract P384 points.

fn subMixed(p: P384, q: AffineCoordinates) P384

Subtract P384 points, the second being specified using affine coordinates.

fn toCompressedSec1(p: P384) [49]u8

Serialize a point using the compressed SEC-1 format.

fn toUncompressedSec1(p: P384) [97]u8

Serialize a point using the uncompressed SEC-1 format.

Values

B
type
Fe
undefined

The underlying prime field.

basePoint
P384

The P384 base point.

identityElement
P384

The P384 neutral element.