mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-06 20:41:14 +00:00
Bump digest, ed25519, signature, and sha2 (#676)
Bumps the aforementioned dependencies to their latest (pre)releases.
This commit is contained in:
parent
0736088c94
commit
a9aa94736b
10 changed files with 26 additions and 30 deletions
|
|
@ -30,7 +30,7 @@ rustdoc-args = [
|
||||||
features = ["serde", "rand_core", "digest", "legacy_compatibility", "group-bits"]
|
features = ["serde", "rand_core", "digest", "legacy_compatibility", "group-bits"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
sha2 = { version = "0.10", default-features = false }
|
sha2 = { version = "0.11.0-rc.0", default-features = false }
|
||||||
bincode = "1"
|
bincode = "1"
|
||||||
criterion = { version = "0.5", features = ["html_reports"] }
|
criterion = { version = "0.5", features = ["html_reports"] }
|
||||||
hex = "0.4.2"
|
hex = "0.4.2"
|
||||||
|
|
@ -50,7 +50,7 @@ cfg-if = "1"
|
||||||
ff = { version = "0.13", default-features = false, optional = true }
|
ff = { version = "0.13", default-features = false, optional = true }
|
||||||
group = { version = "0.13", default-features = false, optional = true }
|
group = { version = "0.13", default-features = false, optional = true }
|
||||||
rand_core = { version = "0.6.4", default-features = false, optional = true }
|
rand_core = { version = "0.6.4", default-features = false, optional = true }
|
||||||
digest = { version = "0.10", default-features = false, optional = true }
|
digest = { version = "0.11.0-rc.0", default-features = false, optional = true, features = ["block-api"] }
|
||||||
subtle = { version = "2.6.0", default-features = false, features = ["const-generics"] }
|
subtle = { version = "2.6.0", default-features = false, features = ["const-generics"] }
|
||||||
serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] }
|
serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] }
|
||||||
zeroize = { version = "1", default-features = false, optional = true }
|
zeroize = { version = "1", default-features = false, optional = true }
|
||||||
|
|
@ -68,7 +68,7 @@ precomputed-tables = []
|
||||||
legacy_compatibility = []
|
legacy_compatibility = []
|
||||||
group = ["dep:group", "rand_core"]
|
group = ["dep:group", "rand_core"]
|
||||||
group-bits = ["group", "ff/bits"]
|
group-bits = ["group", "ff/bits"]
|
||||||
digest = ["dep:digest", "digest/core-api"]
|
digest = ["dep:digest"]
|
||||||
|
|
||||||
[target.'cfg(all(not(curve25519_dalek_backend = "fiat"), not(curve25519_dalek_backend = "serial"), target_arch = "x86_64"))'.dependencies]
|
[target.'cfg(all(not(curve25519_dalek_backend = "fiat"), not(curve25519_dalek_backend = "serial"), target_arch = "x86_64"))'.dependencies]
|
||||||
curve25519-dalek-derive = { version = "0.1", path = "../curve25519-dalek-derive" }
|
curve25519-dalek-derive = { version = "0.1", path = "../curve25519-dalek-derive" }
|
||||||
|
|
|
||||||
|
|
@ -106,8 +106,8 @@ use core::ops::{Mul, MulAssign};
|
||||||
|
|
||||||
#[cfg(feature = "digest")]
|
#[cfg(feature = "digest")]
|
||||||
use digest::{
|
use digest::{
|
||||||
Digest, FixedOutput, HashMarker, consts::True, crypto_common::BlockSizeUser,
|
Digest, FixedOutput, HashMarker, array::typenum::U64, consts::True,
|
||||||
generic_array::typenum::U64, typenum::IsGreater,
|
crypto_common::BlockSizeUser, typenum::IsGreater,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(feature = "group")]
|
#[cfg(feature = "group")]
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,8 @@ use crate::constants;
|
||||||
#[cfg(feature = "digest")]
|
#[cfg(feature = "digest")]
|
||||||
use digest::{
|
use digest::{
|
||||||
Digest, FixedOutput, HashMarker,
|
Digest, FixedOutput, HashMarker,
|
||||||
core_api::BlockSizeUser,
|
array::{Array, typenum::U64},
|
||||||
generic_array::{GenericArray, typenum::U64},
|
block_api::BlockSizeUser,
|
||||||
typenum::{IsGreater, True},
|
typenum::{IsGreater, True},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -368,7 +368,7 @@ impl FieldElement {
|
||||||
D::BlockSize: IsGreater<D::OutputSize, Output = True>,
|
D::BlockSize: IsGreater<D::OutputSize, Output = True>,
|
||||||
{
|
{
|
||||||
let l_i_b_str = 48u16.to_be_bytes();
|
let l_i_b_str = 48u16.to_be_bytes();
|
||||||
let z_pad = GenericArray::<u8, D::BlockSize>::default();
|
let z_pad = Array::<u8, D::BlockSize>::default();
|
||||||
|
|
||||||
let mut hasher = D::new().chain_update(z_pad);
|
let mut hasher = D::new().chain_update(z_pad);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ use rand_core::CryptoRngCore;
|
||||||
#[cfg(feature = "digest")]
|
#[cfg(feature = "digest")]
|
||||||
use digest::Digest;
|
use digest::Digest;
|
||||||
#[cfg(feature = "digest")]
|
#[cfg(feature = "digest")]
|
||||||
use digest::generic_array::typenum::U64;
|
use digest::array::typenum::U64;
|
||||||
|
|
||||||
use crate::constants;
|
use crate::constants;
|
||||||
use crate::field::FieldElement;
|
use crate::field::FieldElement;
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ use rand_core::CryptoRngCore;
|
||||||
#[cfg(feature = "digest")]
|
#[cfg(feature = "digest")]
|
||||||
use digest::Digest;
|
use digest::Digest;
|
||||||
#[cfg(feature = "digest")]
|
#[cfg(feature = "digest")]
|
||||||
use digest::generic_array::typenum::U64;
|
use digest::array::typenum::U64;
|
||||||
|
|
||||||
use subtle::Choice;
|
use subtle::Choice;
|
||||||
use subtle::ConditionallySelectable;
|
use subtle::ConditionallySelectable;
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@ features = ["batch", "digest", "hazmat", "pem", "serde"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
curve25519-dalek = { version = "=5.0.0-pre", path = "../curve25519-dalek", default-features = false, features = ["digest"] }
|
curve25519-dalek = { version = "=5.0.0-pre", path = "../curve25519-dalek", default-features = false, features = ["digest"] }
|
||||||
ed25519 = { version = ">=2.2, <2.3", default-features = false }
|
ed25519 = { version = "=3.0.0-pre.0", default-features = false }
|
||||||
signature = { version = ">=2.0, <2.3", optional = true, default-features = false }
|
signature = { version = "=3.0.0-rc.1", optional = true, default-features = false }
|
||||||
sha2 = { version = "0.10", default-features = false }
|
sha2 = { version = "0.11.0-rc.0", default-features = false }
|
||||||
subtle = { version = "2.3.0", default-features = false }
|
subtle = { version = "2.3.0", default-features = false }
|
||||||
|
|
||||||
# optional features
|
# optional features
|
||||||
|
|
@ -41,8 +41,8 @@ zeroize = { version = "1.5", default-features = false, optional = true }
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
curve25519-dalek = { version = "=5.0.0-pre", path = "../curve25519-dalek", default-features = false, features = ["digest", "rand_core"] }
|
curve25519-dalek = { version = "=5.0.0-pre", path = "../curve25519-dalek", default-features = false, features = ["digest", "rand_core"] }
|
||||||
x25519-dalek = { version = "=3.0.0-pre", path = "../x25519-dalek", default-features = false, features = ["static_secrets"] }
|
x25519-dalek = { version = "=3.0.0-pre", path = "../x25519-dalek", default-features = false, features = ["static_secrets"] }
|
||||||
blake2 = "0.10"
|
blake2 = "0.11.0-rc.0"
|
||||||
sha3 = "0.10"
|
sha3 = "0.11.0-rc.0"
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
bincode = "1.0"
|
bincode = "1.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|
@ -62,10 +62,9 @@ required-features = ["rand_core"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["fast", "std", "zeroize"]
|
default = ["fast", "std", "zeroize"]
|
||||||
alloc = ["curve25519-dalek/alloc", "ed25519/alloc", "serde?/alloc", "zeroize?/alloc"]
|
alloc = ["curve25519-dalek/alloc", "ed25519/alloc", "signature/alloc", "serde?/alloc", "zeroize?/alloc"]
|
||||||
std = ["alloc", "ed25519/std", "serde?/std", "sha2/std"]
|
std = ["alloc", "ed25519/std", "serde?/std"]
|
||||||
|
|
||||||
asm = ["sha2/asm"]
|
|
||||||
batch = ["alloc", "dep:keccak", "rand_core"]
|
batch = ["alloc", "dep:keccak", "rand_core"]
|
||||||
fast = ["curve25519-dalek/precomputed-tables"]
|
fast = ["curve25519-dalek/precomputed-tables"]
|
||||||
digest = ["signature/digest"]
|
digest = ["signature/digest"]
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,10 @@
|
||||||
// Display) should be snake cased, for some reason.
|
// Display) should be snake cased, for some reason.
|
||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
|
use core::error::Error;
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
use core::fmt::Display;
|
use core::fmt::Display;
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
use std::error::Error;
|
|
||||||
|
|
||||||
/// Internal errors. Most application-level developers will likely not
|
/// Internal errors. Most application-level developers will likely not
|
||||||
/// need to pay any attention to these.
|
/// need to pay any attention to these.
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
||||||
|
|
@ -87,7 +85,6 @@ impl Display for InternalError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
|
||||||
impl Error for InternalError {}
|
impl Error for InternalError {}
|
||||||
|
|
||||||
/// Errors which may occur while processing signatures and keypairs.
|
/// Errors which may occur while processing signatures and keypairs.
|
||||||
|
|
@ -107,12 +104,12 @@ impl Error for InternalError {}
|
||||||
pub type SignatureError = ed25519::signature::Error;
|
pub type SignatureError = ed25519::signature::Error;
|
||||||
|
|
||||||
impl From<InternalError> for SignatureError {
|
impl From<InternalError> for SignatureError {
|
||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(feature = "alloc"))]
|
||||||
fn from(_err: InternalError) -> SignatureError {
|
fn from(_err: InternalError) -> SignatureError {
|
||||||
SignatureError::new()
|
SignatureError::new()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "alloc")]
|
||||||
fn from(err: InternalError) -> SignatureError {
|
fn from(err: InternalError) -> SignatureError {
|
||||||
SignatureError::from_source(err)
|
SignatureError::from_source(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ use zeroize::{Zeroize, ZeroizeOnDrop};
|
||||||
|
|
||||||
// These are used in the functions that are made public when the hazmat feature is set
|
// These are used in the functions that are made public when the hazmat feature is set
|
||||||
use crate::{Signature, VerifyingKey};
|
use crate::{Signature, VerifyingKey};
|
||||||
use curve25519_dalek::digest::{Digest, generic_array::typenum::U64};
|
use curve25519_dalek::digest::{Digest, array::typenum::U64};
|
||||||
|
|
||||||
/// Contains the secret scalar and domain separator used for generating signatures.
|
/// Contains the secret scalar and domain separator used for generating signatures.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ use sha2::Sha512;
|
||||||
use subtle::{Choice, ConstantTimeEq};
|
use subtle::{Choice, ConstantTimeEq};
|
||||||
|
|
||||||
use curve25519_dalek::{
|
use curve25519_dalek::{
|
||||||
digest::{Digest, generic_array::typenum::U64},
|
digest::{Digest, array::typenum::U64},
|
||||||
edwards::{CompressedEdwardsY, EdwardsPoint},
|
edwards::{CompressedEdwardsY, EdwardsPoint},
|
||||||
scalar::Scalar,
|
scalar::Scalar,
|
||||||
};
|
};
|
||||||
|
|
@ -734,10 +734,10 @@ impl From<&SigningKey> for pkcs8::KeypairBytes {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "pkcs8")]
|
#[cfg(feature = "pkcs8")]
|
||||||
impl TryFrom<pkcs8::PrivateKeyInfo<'_>> for SigningKey {
|
impl TryFrom<pkcs8::PrivateKeyInfoRef<'_>> for SigningKey {
|
||||||
type Error = pkcs8::Error;
|
type Error = pkcs8::Error;
|
||||||
|
|
||||||
fn try_from(private_key: pkcs8::PrivateKeyInfo<'_>) -> pkcs8::Result<Self> {
|
fn try_from(private_key: pkcs8::PrivateKeyInfoRef<'_>) -> pkcs8::Result<Self> {
|
||||||
pkcs8::KeypairBytes::try_from(private_key)?.try_into()
|
pkcs8::KeypairBytes::try_from(private_key)?.try_into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ use core::fmt::Debug;
|
||||||
use core::hash::{Hash, Hasher};
|
use core::hash::{Hash, Hasher};
|
||||||
|
|
||||||
use curve25519_dalek::{
|
use curve25519_dalek::{
|
||||||
digest::{Digest, generic_array::typenum::U64},
|
digest::{Digest, array::typenum::U64},
|
||||||
edwards::{CompressedEdwardsY, EdwardsPoint},
|
edwards::{CompressedEdwardsY, EdwardsPoint},
|
||||||
montgomery::MontgomeryPoint,
|
montgomery::MontgomeryPoint,
|
||||||
scalar::Scalar,
|
scalar::Scalar,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue