aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / ed25519-dalek / src / constants.rs
| 1 | // -*- mode: rust; -*- |
| 2 | // |
| 3 | // This file is part of ed25519-dalek. |
| 4 | // Copyright (c) 2017-2019 isis lovecruft |
| 5 | // See LICENSE for licensing information. |
| 6 | // |
| 7 | // Authors: |
| 8 | // - isis agora lovecruft <isis@patternsinthevoid.net> |
| 9 | |
| 10 | //! Common constants such as buffer sizes for keypairs and signatures. |
| 11 | |
| 12 | /// The length of a ed25519 `Signature`, in bytes. |
| 13 | pub const SIGNATURE_LENGTH: usize = 64; |
| 14 | |
| 15 | /// The length of a ed25519 `SecretKey`, in bytes. |
| 16 | pub const SECRET_KEY_LENGTH: usize = 32; |
| 17 | |
| 18 | /// The length of an ed25519 `PublicKey`, in bytes. |
| 19 | pub const PUBLIC_KEY_LENGTH: usize = 32; |
| 20 | |
| 21 | /// The length of an ed25519 `Keypair`, in bytes. |
| 22 | pub const KEYPAIR_LENGTH: usize = SECRET_KEY_LENGTH + PUBLIC_KEY_LENGTH; |
| 23 | |
| 24 | /// The length of the "key" portion of an "expanded" ed25519 secret key, in bytes. |
| 25 | const EXPANDED_SECRET_KEY_KEY_LENGTH: usize = 32; |
| 26 | |
| 27 | /// The length of the "nonce" portion of an "expanded" ed25519 secret key, in bytes. |
| 28 | const EXPANDED_SECRET_KEY_NONCE_LENGTH: usize = 32; |
| 29 | |
| 30 | /// The length of an "expanded" ed25519 key, `ExpandedSecretKey`, in bytes. |
| 31 | pub const EXPANDED_SECRET_KEY_LENGTH: usize = |
| 32 | EXPANDED_SECRET_KEY_KEY_LENGTH + EXPANDED_SECRET_KEY_NONCE_LENGTH; |