2016-12-01 00:40:48 +00:00
|
|
|
// -*- mode: rust; -*-
|
|
|
|
|
//
|
2017-10-05 06:19:55 +00:00
|
|
|
// This file is part of ed25519-dalek.
|
2019-01-17 23:28:13 +00:00
|
|
|
// Copyright (c) 2017-2019 isis lovecruft
|
2017-10-05 06:19:55 +00:00
|
|
|
// See LICENSE for licensing information.
|
2016-12-01 00:40:48 +00:00
|
|
|
//
|
|
|
|
|
// Authors:
|
2019-01-17 23:28:13 +00:00
|
|
|
// - isis agora lovecruft <isis@patternsinthevoid.net>
|
2016-12-01 00:40:48 +00:00
|
|
|
|
2018-12-30 04:27:33 +00:00
|
|
|
//! A Rust implementation of ed25519 key generation, signing, and verification.
|
2016-12-01 00:40:48 +00:00
|
|
|
//!
|
|
|
|
|
//! # Example
|
|
|
|
|
//!
|
|
|
|
|
//! Creating an ed25519 signature on a message is simple.
|
|
|
|
|
//!
|
2022-12-18 06:24:58 +00:00
|
|
|
//! First, we need to generate a `SigningKey`, which includes both public and
|
2017-03-14 21:50:17 +00:00
|
|
|
//! secret halves of an asymmetric key. To do so, we need a cryptographically
|
2018-12-29 22:56:16 +00:00
|
|
|
//! secure pseudorandom number generator (CSPRNG). For this example, we'll use
|
|
|
|
|
//! the operating system's builtin PRNG:
|
2016-12-01 00:40:48 +00:00
|
|
|
//!
|
2023-01-15 02:26:39 +00:00
|
|
|
#![cfg_attr(feature = "rand_core", doc = "```")]
|
|
|
|
|
#![cfg_attr(not(feature = "rand_core"), doc = "```ignore")]
|
2017-03-14 21:50:17 +00:00
|
|
|
//! # fn main() {
|
2019-10-21 15:03:08 +00:00
|
|
|
//! use rand::rngs::OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! use ed25519_dalek::SigningKey;
|
2017-03-14 21:50:17 +00:00
|
|
|
//! use ed25519_dalek::Signature;
|
2016-12-01 00:40:48 +00:00
|
|
|
//!
|
2023-01-02 05:59:19 +00:00
|
|
|
//! let mut csprng = OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! let signing_key: SigningKey = SigningKey::generate(&mut csprng);
|
2017-03-14 21:50:17 +00:00
|
|
|
//! # }
|
2016-12-01 00:40:48 +00:00
|
|
|
//! ```
|
|
|
|
|
//!
|
2022-12-18 06:24:58 +00:00
|
|
|
//! We can now use this `signing_key` to sign a message:
|
2016-12-01 00:40:48 +00:00
|
|
|
//!
|
2023-01-15 02:26:39 +00:00
|
|
|
#![cfg_attr(feature = "rand_core", doc = "```")]
|
|
|
|
|
#![cfg_attr(not(feature = "rand_core"), doc = "```ignore")]
|
2017-03-14 21:50:17 +00:00
|
|
|
//! # fn main() {
|
2019-10-21 15:03:08 +00:00
|
|
|
//! # use rand::rngs::OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # use ed25519_dalek::SigningKey;
|
2023-01-02 05:59:19 +00:00
|
|
|
//! # let mut csprng = OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signing_key: SigningKey = SigningKey::generate(&mut csprng);
|
2020-03-17 17:25:33 +00:00
|
|
|
//! use ed25519_dalek::{Signature, Signer};
|
2018-12-29 22:56:16 +00:00
|
|
|
//! let message: &[u8] = b"This is a test of the tsunami alert system.";
|
2022-12-18 06:24:58 +00:00
|
|
|
//! let signature: Signature = signing_key.sign(message);
|
2017-03-14 21:50:17 +00:00
|
|
|
//! # }
|
2016-12-01 00:40:48 +00:00
|
|
|
//! ```
|
|
|
|
|
//!
|
|
|
|
|
//! As well as to verify that this is, indeed, a valid signature on
|
|
|
|
|
//! that `message`:
|
|
|
|
|
//!
|
2023-01-15 02:26:39 +00:00
|
|
|
#![cfg_attr(feature = "rand_core", doc = "```")]
|
|
|
|
|
#![cfg_attr(not(feature = "rand_core"), doc = "```ignore")]
|
2017-03-14 21:50:17 +00:00
|
|
|
//! # fn main() {
|
2019-10-21 15:03:08 +00:00
|
|
|
//! # use rand::rngs::OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # use ed25519_dalek::{SigningKey, Signature, Signer};
|
2023-01-02 05:59:19 +00:00
|
|
|
//! # let mut csprng = OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signing_key: SigningKey = SigningKey::generate(&mut csprng);
|
2018-12-29 22:56:16 +00:00
|
|
|
//! # let message: &[u8] = b"This is a test of the tsunami alert system.";
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signature: Signature = signing_key.sign(message);
|
2020-03-17 17:25:33 +00:00
|
|
|
//! use ed25519_dalek::Verifier;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! assert!(signing_key.verify(message, &signature).is_ok());
|
2017-03-14 21:50:17 +00:00
|
|
|
//! # }
|
2016-12-01 00:40:48 +00:00
|
|
|
//! ```
|
|
|
|
|
//!
|
2022-12-18 06:24:58 +00:00
|
|
|
//! Anyone else, given the `public` half of the `signing_key` can also easily
|
2016-12-01 00:40:48 +00:00
|
|
|
//! verify this signature:
|
|
|
|
|
//!
|
2023-01-15 02:26:39 +00:00
|
|
|
#![cfg_attr(feature = "rand_core", doc = "```")]
|
|
|
|
|
#![cfg_attr(not(feature = "rand_core"), doc = "```ignore")]
|
2017-03-14 21:50:17 +00:00
|
|
|
//! # fn main() {
|
2019-10-21 15:03:08 +00:00
|
|
|
//! # use rand::rngs::OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # use ed25519_dalek::SigningKey;
|
2017-03-14 21:50:17 +00:00
|
|
|
//! # use ed25519_dalek::Signature;
|
2020-03-17 17:25:33 +00:00
|
|
|
//! # use ed25519_dalek::Signer;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! use ed25519_dalek::{VerifyingKey, Verifier};
|
2023-01-26 20:41:20 +00:00
|
|
|
//! # let mut csprng = OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signing_key: SigningKey = SigningKey::generate(&mut csprng);
|
2018-12-29 22:56:16 +00:00
|
|
|
//! # let message: &[u8] = b"This is a test of the tsunami alert system.";
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signature: Signature = signing_key.sign(message);
|
2017-11-05 23:20:04 +00:00
|
|
|
//!
|
2022-12-18 06:24:58 +00:00
|
|
|
//! let verifying_key: VerifyingKey = signing_key.verifying_key();
|
|
|
|
|
//! assert!(verifying_key.verify(message, &signature).is_ok());
|
2017-03-14 21:50:17 +00:00
|
|
|
//! # }
|
2016-12-01 00:40:48 +00:00
|
|
|
//! ```
|
2017-11-05 23:20:04 +00:00
|
|
|
//!
|
|
|
|
|
//! ## Serialisation
|
|
|
|
|
//!
|
2022-12-18 06:24:58 +00:00
|
|
|
//! `VerifyingKey`s, `SecretKey`s, `SigningKey`s, and `Signature`s can be serialised
|
2017-11-05 23:20:04 +00:00
|
|
|
//! into byte-arrays by calling `.to_bytes()`. It's perfectly acceptible and
|
|
|
|
|
//! safe to transfer and/or store those bytes. (Of course, never transfer your
|
|
|
|
|
//! secret key to anyone else, since they will only need the public key to
|
|
|
|
|
//! verify your signatures!)
|
|
|
|
|
//!
|
2023-01-15 02:26:39 +00:00
|
|
|
#![cfg_attr(feature = "rand_core", doc = "```")]
|
|
|
|
|
#![cfg_attr(not(feature = "rand_core"), doc = "```ignore")]
|
2017-11-05 23:20:04 +00:00
|
|
|
//! # fn main() {
|
2019-10-21 15:03:08 +00:00
|
|
|
//! # use rand::rngs::OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # use ed25519_dalek::{SigningKey, Signature, Signer, VerifyingKey};
|
2017-11-05 23:20:04 +00:00
|
|
|
//! use ed25519_dalek::{PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, KEYPAIR_LENGTH, SIGNATURE_LENGTH};
|
2023-01-26 20:41:20 +00:00
|
|
|
//! # let mut csprng = OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signing_key: SigningKey = SigningKey::generate(&mut csprng);
|
2018-12-29 22:56:16 +00:00
|
|
|
//! # let message: &[u8] = b"This is a test of the tsunami alert system.";
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signature: Signature = signing_key.sign(message);
|
2017-11-05 23:20:04 +00:00
|
|
|
//!
|
2022-12-18 06:24:58 +00:00
|
|
|
//! let verifying_key_bytes: [u8; PUBLIC_KEY_LENGTH] = signing_key.verifying_key().to_bytes();
|
|
|
|
|
//! let secret_key_bytes: [u8; SECRET_KEY_LENGTH] = signing_key.to_bytes();
|
|
|
|
|
//! let signing_key_bytes: [u8; KEYPAIR_LENGTH] = signing_key.to_keypair_bytes();
|
2017-11-05 23:20:04 +00:00
|
|
|
//! let signature_bytes: [u8; SIGNATURE_LENGTH] = signature.to_bytes();
|
|
|
|
|
//! # }
|
|
|
|
|
//! ```
|
|
|
|
|
//!
|
|
|
|
|
//! And similarly, decoded from bytes with `::from_bytes()`:
|
|
|
|
|
//!
|
2023-01-15 02:26:39 +00:00
|
|
|
#![cfg_attr(feature = "rand_core", doc = "```")]
|
|
|
|
|
#![cfg_attr(not(feature = "rand_core"), doc = "```ignore")]
|
2023-02-02 22:07:56 +00:00
|
|
|
//! # use core::convert::{TryFrom, TryInto};
|
2019-10-21 15:03:08 +00:00
|
|
|
//! # use rand::rngs::OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # use ed25519_dalek::{SigningKey, Signature, Signer, VerifyingKey, SecretKey, SignatureError};
|
2017-11-05 23:20:04 +00:00
|
|
|
//! # use ed25519_dalek::{PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, KEYPAIR_LENGTH, SIGNATURE_LENGTH};
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # fn do_test() -> Result<(SigningKey, VerifyingKey, Signature), SignatureError> {
|
2023-01-02 05:59:19 +00:00
|
|
|
//! # let mut csprng = OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signing_key_orig: SigningKey = SigningKey::generate(&mut csprng);
|
2018-12-29 22:56:16 +00:00
|
|
|
//! # let message: &[u8] = b"This is a test of the tsunami alert system.";
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signature_orig: Signature = signing_key_orig.sign(message);
|
|
|
|
|
//! # let verifying_key_bytes: [u8; PUBLIC_KEY_LENGTH] = signing_key_orig.verifying_key().to_bytes();
|
|
|
|
|
//! # let signing_key_bytes: [u8; SECRET_KEY_LENGTH] = signing_key_orig.to_bytes();
|
2017-11-05 23:20:04 +00:00
|
|
|
//! # let signature_bytes: [u8; SIGNATURE_LENGTH] = signature_orig.to_bytes();
|
|
|
|
|
//! #
|
2022-12-18 06:24:58 +00:00
|
|
|
//! let verifying_key: VerifyingKey = VerifyingKey::from_bytes(&verifying_key_bytes)?;
|
|
|
|
|
//! let signing_key: SigningKey = SigningKey::from_bytes(&signing_key_bytes);
|
|
|
|
|
//! let signature: Signature = Signature::try_from(&signature_bytes[..])?;
|
2017-11-05 23:20:04 +00:00
|
|
|
//! #
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # Ok((signing_key, verifying_key, signature))
|
2017-11-05 23:20:04 +00:00
|
|
|
//! # }
|
|
|
|
|
//! # fn main() {
|
|
|
|
|
//! # do_test();
|
|
|
|
|
//! # }
|
|
|
|
|
//! ```
|
|
|
|
|
//!
|
2022-12-13 23:19:31 +00:00
|
|
|
//! ### PKCS#8 Key Encoding
|
|
|
|
|
//!
|
|
|
|
|
//! PKCS#8 is a private key format with support for multiple algorithms.
|
|
|
|
|
//! It can be encoded as binary (DER) or text (PEM).
|
|
|
|
|
//!
|
|
|
|
|
//! You can recognize PEM-encoded PKCS#8 keys by the following:
|
|
|
|
|
//!
|
|
|
|
|
//! ```text
|
|
|
|
|
//! -----BEGIN PRIVATE KEY-----
|
|
|
|
|
//! ```
|
|
|
|
|
//!
|
|
|
|
|
//! To use PKCS#8, you need to enable the `pkcs8` crate feature.
|
|
|
|
|
//!
|
2022-12-18 06:24:58 +00:00
|
|
|
//! The following traits can be used to decode/encode [`SigningKey`] and
|
|
|
|
|
//! [`VerifyingKey`] as PKCS#8. Note that [`pkcs8`] is re-exported from the
|
2022-12-13 23:19:31 +00:00
|
|
|
//! toplevel of the crate:
|
|
|
|
|
//!
|
|
|
|
|
//! - [`pkcs8::DecodePrivateKey`]: decode private keys from PKCS#8
|
|
|
|
|
//! - [`pkcs8::EncodePrivateKey`]: encode private keys to PKCS#8
|
2023-01-21 05:21:35 +00:00
|
|
|
//! - [`pkcs8::DecodePublicKey`]: decode public keys from PKCS#8
|
|
|
|
|
//! - [`pkcs8::EncodePublicKey`]: encode public keys to PKCS#8
|
2022-12-13 23:19:31 +00:00
|
|
|
//!
|
|
|
|
|
//! #### Example
|
|
|
|
|
//!
|
|
|
|
|
//! NOTE: this requires the `pem` crate feature.
|
|
|
|
|
//!
|
|
|
|
|
#![cfg_attr(feature = "pem", doc = "```")]
|
|
|
|
|
#![cfg_attr(not(feature = "pem"), doc = "```ignore")]
|
2023-01-02 05:59:19 +00:00
|
|
|
//! use ed25519_dalek::{VerifyingKey, pkcs8::DecodePublicKey};
|
2022-12-13 23:19:31 +00:00
|
|
|
//!
|
|
|
|
|
//! let pem = "-----BEGIN PUBLIC KEY-----
|
|
|
|
|
//! MCowBQYDK2VwAyEAGb9ECWmEzf6FQbrBZ9w7lshQhqowtrbLDFw4rXAxZuE=
|
|
|
|
|
//! -----END PUBLIC KEY-----";
|
|
|
|
|
//!
|
2023-01-02 05:59:19 +00:00
|
|
|
//! let verifying_key = VerifyingKey::from_public_key_pem(pem)
|
2022-12-13 23:19:31 +00:00
|
|
|
//! .expect("invalid public key PEM");
|
|
|
|
|
//! ```
|
|
|
|
|
//!
|
2017-11-05 23:20:04 +00:00
|
|
|
//! ### Using Serde
|
|
|
|
|
//!
|
|
|
|
|
//! If you prefer the bytes to be wrapped in another serialisation format, all
|
|
|
|
|
//! types additionally come with built-in [serde](https://serde.rs) support by
|
|
|
|
|
//! building `ed25519-dalek` via:
|
|
|
|
|
//!
|
2018-05-16 22:09:31 +00:00
|
|
|
//! ```bash
|
2017-11-05 23:20:04 +00:00
|
|
|
//! $ cargo build --features="serde"
|
|
|
|
|
//! ```
|
|
|
|
|
//!
|
|
|
|
|
//! They can be then serialised into any of the wire formats which serde supports.
|
|
|
|
|
//! For example, using [bincode](https://github.com/TyOverby/bincode):
|
|
|
|
|
//!
|
2023-01-15 02:26:39 +00:00
|
|
|
#![cfg_attr(all(feature = "rand_core", feature = "serde"), doc = "```")]
|
|
|
|
|
#![cfg_attr(not(all(feature = "rand_core", feature = "serde")), doc = "```ignore")]
|
2017-11-05 23:20:04 +00:00
|
|
|
//! # fn main() {
|
2019-10-21 15:03:08 +00:00
|
|
|
//! # use rand::rngs::OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # use ed25519_dalek::{SigningKey, Signature, Signer, Verifier, VerifyingKey};
|
2020-08-07 20:39:57 +00:00
|
|
|
//! use bincode::serialize;
|
2023-01-02 05:59:19 +00:00
|
|
|
//! # let mut csprng = OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signing_key: SigningKey = SigningKey::generate(&mut csprng);
|
2018-12-29 22:56:16 +00:00
|
|
|
//! # let message: &[u8] = b"This is a test of the tsunami alert system.";
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signature: Signature = signing_key.sign(message);
|
|
|
|
|
//! # let verifying_key: VerifyingKey = signing_key.verifying_key();
|
|
|
|
|
//! # let verified: bool = verifying_key.verify(message, &signature).is_ok();
|
2017-11-05 23:20:04 +00:00
|
|
|
//!
|
2022-12-18 06:24:58 +00:00
|
|
|
//! let encoded_verifying_key: Vec<u8> = serialize(&verifying_key).unwrap();
|
2020-08-07 20:39:57 +00:00
|
|
|
//! let encoded_signature: Vec<u8> = serialize(&signature).unwrap();
|
2017-11-05 23:20:04 +00:00
|
|
|
//! # }
|
|
|
|
|
//! ```
|
|
|
|
|
//!
|
2022-12-18 06:24:58 +00:00
|
|
|
//! After sending the `encoded_verifying_key` and `encoded_signature`, the
|
2017-11-05 23:20:04 +00:00
|
|
|
//! recipient may deserialise them and verify:
|
|
|
|
|
//!
|
2023-01-15 02:26:39 +00:00
|
|
|
#![cfg_attr(all(feature = "rand_core", feature = "serde"), doc = "```")]
|
|
|
|
|
#![cfg_attr(not(all(feature = "rand_core", feature = "serde")), doc = "```ignore")]
|
2017-11-05 23:20:04 +00:00
|
|
|
//! # fn main() {
|
2019-10-21 15:03:08 +00:00
|
|
|
//! # use rand::rngs::OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # use ed25519_dalek::{SigningKey, Signature, Signer, Verifier, VerifyingKey};
|
2020-08-07 20:39:57 +00:00
|
|
|
//! # use bincode::serialize;
|
2020-03-17 17:25:33 +00:00
|
|
|
//! use bincode::deserialize;
|
2017-11-05 23:20:04 +00:00
|
|
|
//!
|
2023-01-02 05:59:19 +00:00
|
|
|
//! # let mut csprng = OsRng;
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signing_key: SigningKey = SigningKey::generate(&mut csprng);
|
2018-12-29 22:56:16 +00:00
|
|
|
//! let message: &[u8] = b"This is a test of the tsunami alert system.";
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # let signature: Signature = signing_key.sign(message);
|
|
|
|
|
//! # let verifying_key: VerifyingKey = signing_key.verifying_key();
|
|
|
|
|
//! # let verified: bool = verifying_key.verify(message, &signature).is_ok();
|
|
|
|
|
//! # let encoded_verifying_key: Vec<u8> = serialize(&verifying_key).unwrap();
|
2020-08-07 20:39:57 +00:00
|
|
|
//! # let encoded_signature: Vec<u8> = serialize(&signature).unwrap();
|
2022-12-18 06:24:58 +00:00
|
|
|
//! let decoded_verifying_key: VerifyingKey = deserialize(&encoded_verifying_key).unwrap();
|
2017-11-05 23:20:04 +00:00
|
|
|
//! let decoded_signature: Signature = deserialize(&encoded_signature).unwrap();
|
|
|
|
|
//!
|
2022-12-18 06:24:58 +00:00
|
|
|
//! # assert_eq!(verifying_key, decoded_verifying_key);
|
2017-11-05 23:20:04 +00:00
|
|
|
//! # assert_eq!(signature, decoded_signature);
|
|
|
|
|
//! #
|
2022-12-18 06:24:58 +00:00
|
|
|
//! let verified: bool = decoded_verifying_key.verify(&message, &decoded_signature).is_ok();
|
2017-11-05 23:20:04 +00:00
|
|
|
//!
|
|
|
|
|
//! assert!(verified);
|
|
|
|
|
//! # }
|
|
|
|
|
//! ```
|
2016-12-01 00:40:48 +00:00
|
|
|
|
2017-02-06 21:45:08 +00:00
|
|
|
#![no_std]
|
2022-12-08 07:39:48 +00:00
|
|
|
#![warn(future_incompatible, rust_2018_idioms)]
|
2017-03-14 21:39:28 +00:00
|
|
|
#![deny(missing_docs)] // refuse to compile if documentation is missing
|
2023-01-21 06:05:54 +00:00
|
|
|
#![deny(clippy::unwrap_used)] // don't allow unwrap
|
2021-08-01 17:28:40 +00:00
|
|
|
#![cfg_attr(not(test), forbid(unsafe_code))]
|
2022-12-13 23:19:31 +00:00
|
|
|
#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg, doc_cfg_hide))]
|
|
|
|
|
#![cfg_attr(docsrs, doc(cfg_hide(docsrs)))]
|
2016-12-01 00:40:48 +00:00
|
|
|
|
2023-01-15 02:26:39 +00:00
|
|
|
#[cfg(feature = "batch")]
|
2022-12-08 07:39:48 +00:00
|
|
|
extern crate alloc;
|
|
|
|
|
|
2017-12-06 02:13:43 +00:00
|
|
|
#[cfg(any(feature = "std", test))]
|
2017-02-06 21:45:08 +00:00
|
|
|
#[macro_use]
|
|
|
|
|
extern crate std;
|
2017-03-14 21:37:46 +00:00
|
|
|
|
2022-12-08 07:39:48 +00:00
|
|
|
pub use ed25519;
|
|
|
|
|
|
2023-01-15 02:26:39 +00:00
|
|
|
#[cfg(feature = "batch")]
|
2019-11-21 00:31:10 +00:00
|
|
|
mod batch;
|
2018-12-30 02:36:49 +00:00
|
|
|
mod constants;
|
2023-02-02 22:07:56 +00:00
|
|
|
#[cfg(feature = "digest")]
|
2023-01-26 20:41:20 +00:00
|
|
|
mod context;
|
2018-12-30 03:41:13 +00:00
|
|
|
mod errors;
|
2018-12-30 02:43:01 +00:00
|
|
|
mod signature;
|
2022-12-18 06:24:58 +00:00
|
|
|
mod signing;
|
|
|
|
|
mod verifying;
|
2016-12-01 00:40:48 +00:00
|
|
|
|
2023-01-19 07:59:43 +00:00
|
|
|
#[cfg(feature = "digest")]
|
2020-03-17 17:25:33 +00:00
|
|
|
pub use curve25519_dalek::digest::Digest;
|
2023-01-26 20:41:20 +00:00
|
|
|
#[cfg(feature = "digest")]
|
|
|
|
|
pub use sha2::Sha512;
|
2020-03-17 17:25:33 +00:00
|
|
|
|
2023-01-15 02:26:39 +00:00
|
|
|
#[cfg(feature = "batch")]
|
2019-11-23 01:34:13 +00:00
|
|
|
pub use crate::batch::*;
|
2020-03-17 17:25:33 +00:00
|
|
|
pub use crate::constants::*;
|
2023-02-02 22:07:56 +00:00
|
|
|
#[cfg(feature = "digest")]
|
2023-01-26 20:41:20 +00:00
|
|
|
pub use crate::context::Context;
|
2020-03-17 17:25:33 +00:00
|
|
|
pub use crate::errors::*;
|
2022-12-18 06:24:58 +00:00
|
|
|
pub use crate::signing::*;
|
|
|
|
|
pub use crate::verifying::*;
|
2020-03-17 17:25:33 +00:00
|
|
|
|
|
|
|
|
// Re-export the `Signer` and `Verifier` traits from the `signature` crate
|
2023-01-26 20:41:20 +00:00
|
|
|
#[cfg(feature = "digest")]
|
|
|
|
|
pub use ed25519::signature::{DigestSigner, DigestVerifier};
|
2020-03-17 17:25:33 +00:00
|
|
|
pub use ed25519::signature::{Signer, Verifier};
|
|
|
|
|
pub use ed25519::Signature;
|
2022-12-13 23:19:31 +00:00
|
|
|
|
|
|
|
|
#[cfg(feature = "pkcs8")]
|
|
|
|
|
pub use ed25519::pkcs8;
|