2018-12-30 02:36:49 +00:00
|
|
|
// -*- mode: rust; -*-
|
|
|
|
|
//
|
|
|
|
|
// This file is part of ed25519-dalek.
|
2019-01-17 23:28:13 +00:00
|
|
|
// Copyright (c) 2017-2019 isis lovecruft
|
2018-12-30 02:36:49 +00:00
|
|
|
// See LICENSE for licensing information.
|
|
|
|
|
//
|
|
|
|
|
// Authors:
|
|
|
|
|
// - isis agora lovecruft <isis@patternsinthevoid.net>
|
|
|
|
|
|
|
|
|
|
//! Common constants such as buffer sizes for keypairs and signatures.
|
|
|
|
|
|
|
|
|
|
/// The length of a ed25519 `Signature`, in bytes.
|
|
|
|
|
pub const SIGNATURE_LENGTH: usize = 64;
|
|
|
|
|
|
|
|
|
|
/// The length of a ed25519 `SecretKey`, in bytes.
|
|
|
|
|
pub const SECRET_KEY_LENGTH: usize = 32;
|
|
|
|
|
|
|
|
|
|
/// The length of an ed25519 `PublicKey`, in bytes.
|
|
|
|
|
pub const PUBLIC_KEY_LENGTH: usize = 32;
|
|
|
|
|
|
|
|
|
|
/// The length of an ed25519 `Keypair`, in bytes.
|
|
|
|
|
pub const KEYPAIR_LENGTH: usize = SECRET_KEY_LENGTH + PUBLIC_KEY_LENGTH;
|
|
|
|
|
|
|
|
|
|
/// The length of the "key" portion of an "expanded" ed25519 secret key, in bytes.
|
|
|
|
|
const EXPANDED_SECRET_KEY_KEY_LENGTH: usize = 32;
|
|
|
|
|
|
|
|
|
|
/// The length of the "nonce" portion of an "expanded" ed25519 secret key, in bytes.
|
|
|
|
|
const EXPANDED_SECRET_KEY_NONCE_LENGTH: usize = 32;
|
|
|
|
|
|
|
|
|
|
/// The length of an "expanded" ed25519 key, `ExpandedSecretKey`, in bytes.
|
2022-12-08 07:39:48 +00:00
|
|
|
pub const EXPANDED_SECRET_KEY_LENGTH: usize =
|
|
|
|
|
EXPANDED_SECRET_KEY_KEY_LENGTH + EXPANDED_SECRET_KEY_NONCE_LENGTH;
|