build(deps): update cryptoxide requirement from 0.3.6 to 0.4.1 (#36)

This commit is contained in:
Rinor Hoxha 2022-01-31 14:51:34 +00:00 committed by GitHub
parent c251d2fd27
commit cacd74d8b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -21,7 +21,7 @@ hex = "0.4.3"
[dev-dependencies]
net2 = "0.2.37"
cryptoxide = "0.3.6"
cryptoxide = "0.4.1"
env_logger = "0.9.0"
pallas-handshake = { version = "0.3.0", path = "../pallas-handshake/" }
pallas-txsubmission = { version = "0.3.0", path = "../pallas-txsubmission/" }

View file

@ -15,7 +15,7 @@ authors = [
[dependencies]
minicbor = { version = "0.12" }
hex = "0.4"
cryptoxide = { version = "0.3.6" }
cryptoxide = { version = "0.4.1" }
thiserror = "1.0"
rand_core = "0.6"

View file

@ -11,7 +11,7 @@
use crate::memsec::Scrubbed as _;
use cryptoxide::ed25519::{
self, PRIVATE_KEY_LENGTH, PUBLIC_KEY_LENGTH, SEED_LENGTH, SIGNATURE_LENGTH,
self, EXTENDED_KEY_LENGTH, PRIVATE_KEY_LENGTH, PUBLIC_KEY_LENGTH, SIGNATURE_LENGTH,
};
use rand_core::{CryptoRng, RngCore};
use std::{any::type_name, convert::TryFrom, fmt, str::FromStr};
@ -70,8 +70,8 @@ macro_rules! impl_size_zero {
};
}
impl_size_zero!(SecretKey, SEED_LENGTH);
impl_size_zero!(SecretKeyExtended, PRIVATE_KEY_LENGTH);
impl_size_zero!(SecretKey, PRIVATE_KEY_LENGTH);
impl_size_zero!(SecretKeyExtended, EXTENDED_KEY_LENGTH);
impl_size_zero!(PublicKey, PUBLIC_KEY_LENGTH);
impl_size_zero!(Signature, SIGNATURE_LENGTH);
@ -161,7 +161,7 @@ impl SecretKeyExtended {
/// [`Signature`] generated with this [`SecretKeyExtended`] and the original
/// message.
pub fn public_key(&self) -> PublicKey {
let pk = ed25519::to_public(&self.0);
let pk = ed25519::extended_to_public(&self.0);
PublicKey::from(pk)
}
@ -186,7 +186,7 @@ impl PublicKey {
where
T: AsRef<[u8]>,
{
ed25519::verify(message.as_ref(), &self.0, signature.as_ref())
ed25519::verify(message.as_ref(), &self.0, &signature.0)
}
}