structstd.crypto.ecdsa.Ecdsa.SecretKey[src]

An ECDSA secret key.

Fields

bytes: Curve.scalar.CompressedScalar

Values

Constantencoded_length[src]

Length (in bytes) of a raw secret key.

Source Code

Source code
pub const encoded_length = Curve.scalar.encoded_length

Functions

FunctionfromBytes[src]

pub fn fromBytes(bytes: [encoded_length]u8) !SecretKey

Parameters

bytes: [encoded_length]u8

Source Code

Source code
pub fn fromBytes(bytes: [encoded_length]u8) !SecretKey {
    return SecretKey{ .bytes = bytes };
}

FunctiontoBytes[src]

pub fn toBytes(sk: SecretKey) [encoded_length]u8

Parameters

Source Code

Source code
pub fn toBytes(sk: SecretKey) [encoded_length]u8 {
    return sk.bytes;
}

Source Code

Source code
pub const SecretKey = struct {
    /// Length (in bytes) of a raw secret key.
    pub const encoded_length = Curve.scalar.encoded_length;

    bytes: Curve.scalar.CompressedScalar,

    pub fn fromBytes(bytes: [encoded_length]u8) !SecretKey {
        return SecretKey{ .bytes = bytes };
    }

    pub fn toBytes(sk: SecretKey) [encoded_length]u8 {
        return sk.bytes;
    }
}