1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/// the length of a SHA256 digest
pub const SHA256_LENGTH: usize = 64;
/// the length of a SHA512 digest
pub const SHA512_LENGTH: usize = 64;

/// the length of a scalar (module structure on Curve25519)
pub const SCALAR_LENGTH: usize = 32;

/// the length of a field element (base field of Curve25519)
pub const FIELD_ELEMENT_LENGTH: usize = 32;

/// the length of the seed part of a secret key (internal)
pub const SECRETKEY_SEED_LENGTH: usize = 32;
/// the length of the scalar part of a secret key (internal)
pub const SECRETKEY_SCALAR_LENGTH: usize = 32;
/// the length of the nonce part of a secret key (internal)
pub const SECRETKEY_NONCE_LENGTH: usize = 32;
/// the length of a compressed point
pub const COMPRESSED_Y_LENGTH: usize = 32;

/// the length of a public key when serialized
pub const PUBLICKEY_SERIALIZED_LENGTH: usize = 32;

/// the length of a secret key when serialized
pub const SECRETKEY_SERIALIZED_LENGTH: usize = 32;

/// the length of a signature when serialized
pub const SIGNATURE_SERIALIZED_LENGTH: usize = 64;