Update to latest packages; ed25519 now needs signature crate traits.
This commit is contained in:
parent
7bd7e7ec7d
commit
173bec26a5
|
@ -10,10 +10,11 @@ publish = false
|
|||
tor-llcrypto = { path="../tor-llcrypto" }
|
||||
|
||||
arrayref = "0.3.6"
|
||||
generic-array = "0.14.2"
|
||||
generic-array = "0.14.3"
|
||||
crypto-mac = "0.8.0"
|
||||
thiserror = "1.0.20"
|
||||
signature = "1.1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
hex-literal = "0.2.1"
|
||||
hex-literal = "0.3.0"
|
||||
|
||||
|
|
|
@ -149,26 +149,27 @@ mod net_impls {
|
|||
/// Implement Readable and Writeable for Ed25519 types.
|
||||
mod ed25519_impls {
|
||||
use super::*;
|
||||
use tor_llcrypto::pk::ed25519::{PublicKey, Signature};
|
||||
use signature::Signature;
|
||||
use tor_llcrypto::pk::ed25519;
|
||||
|
||||
impl Writeable for PublicKey {
|
||||
impl Writeable for ed25519::PublicKey {
|
||||
fn write_onto<B: Writer + ?Sized>(&self, b: &mut B) {
|
||||
b.write_all(self.as_bytes())
|
||||
}
|
||||
}
|
||||
impl Readable for PublicKey {
|
||||
impl Readable for ed25519::PublicKey {
|
||||
fn take_from(b: &mut Reader<'_>) -> Result<Self> {
|
||||
let bytes = b.take(32)?;
|
||||
Self::from_bytes(array_ref![bytes, 0, 32])
|
||||
.map_err(|_| Error::BadMessage("Couldn't decode Ed25519 public key"))
|
||||
}
|
||||
}
|
||||
impl Writeable for Signature {
|
||||
impl Writeable for ed25519::Signature {
|
||||
fn write_onto<B: Writer + ?Sized>(&self, b: &mut B) {
|
||||
b.write_all(&self.to_bytes()[..])
|
||||
}
|
||||
}
|
||||
impl Readable for Signature {
|
||||
impl Readable for ed25519::Signature {
|
||||
fn take_from(b: &mut Reader<'_>) -> Result<Self> {
|
||||
let bytes = b.take(64)?;
|
||||
Self::from_bytes(array_ref![bytes, 0, 64])
|
||||
|
|
|
@ -10,6 +10,7 @@ publish = false
|
|||
caret = { path="../caret" }
|
||||
tor-llcrypto = { path="../tor-llcrypto" }
|
||||
tor-bytes = { path="../tor-bytes" }
|
||||
signature = "1.1.0"
|
||||
|
||||
[dev-dependencies]
|
||||
base64 = "0.12.2"
|
||||
base64 = "0.12.3"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#![deny(missing_docs)]
|
||||
|
||||
use caret::caret_int;
|
||||
use signature::{Signer, Verifier};
|
||||
use tor_bytes::{Error, Result};
|
||||
use tor_bytes::{Readable, Reader, Writeable, Writer};
|
||||
use tor_llcrypto::pk::*;
|
||||
|
|
|
@ -12,24 +12,25 @@ digest = "0.9.0"
|
|||
typenum = "1.12.0"
|
||||
# XXXX why did I have to downgrade?
|
||||
#generic-array = "0.12"
|
||||
generic-array = "0.14.2"
|
||||
generic-array = "0.14.3"
|
||||
aes-ctr = "0.4.0"
|
||||
zeroize = "1.1.0"
|
||||
rsa = "0.3.0"
|
||||
simple_asn1= "0.4.0"
|
||||
simple_asn1= "0.4.1"
|
||||
subtle = "2.2.3"
|
||||
stream-cipher = "0.4.1"
|
||||
stream-cipher = "0.4.0"
|
||||
num-traits = "0.2.12"
|
||||
num-bigint = "0.3.0"
|
||||
curve25519-dalek = "2.1.0"
|
||||
x25519-dalek = "0.6.0"
|
||||
ed25519-dalek = "1.0.0-pre.3"
|
||||
sha-1 = "0.9.0"
|
||||
sha2 = "0.9.0"
|
||||
sha3 = "0.9.0"
|
||||
ed25519-dalek = "1.0.0-pre.4"
|
||||
sha-1 = "0.9.1"
|
||||
sha2 = "0.9.1"
|
||||
sha3 = "0.9.1"
|
||||
|
||||
[dev-dependencies]
|
||||
hex-literal = "0.2.1"
|
||||
hex-literal = "0.3.0"
|
||||
signature = "*"
|
||||
|
||||
# This is a magic crate that runs the tests and checks the format
|
||||
# before it lets you commit or push. It installs git hooks for this whenever
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use digest::Digest;
|
||||
use hex_literal::hex;
|
||||
use stream_cipher::{NewStreamCipher, StreamCipher};
|
||||
use stream_cipher::*;
|
||||
use tor_llcrypto as ll;
|
||||
|
||||
#[test]
|
||||
|
@ -48,6 +48,7 @@ fn tv_curve25519() {
|
|||
#[test]
|
||||
fn tv_ed25519() {
|
||||
use ll::pk::ed25519::*;
|
||||
use signature::{Signer, Verifier};
|
||||
// Test vectors from RFC 8032.
|
||||
|
||||
// TEST 1
|
||||
|
|
|
@ -15,6 +15,7 @@ digest = "0.9.0"
|
|||
phf = { version = "0.8.0", features = ["macros"] }
|
||||
hex = "0.4.2"
|
||||
lazy_static = "1.4.0"
|
||||
base64 = "0.12.2"
|
||||
base64 = "0.12.3"
|
||||
thiserror = "1.0.20"
|
||||
chrono = "0.4.11"
|
||||
chrono = "0.4.13"
|
||||
signature = "1.1.0"
|
||||
|
|
|
@ -43,6 +43,7 @@ use tor_llcrypto as ll;
|
|||
use tor_llcrypto::pk::rsa::RSAIdentity;
|
||||
|
||||
use digest::Digest;
|
||||
use signature::{Signature, Verifier};
|
||||
|
||||
/// A router descriptor, with possible annotations.
|
||||
#[allow(dead_code)]
|
||||
|
|
|
@ -16,16 +16,16 @@ digest = "0.9.0"
|
|||
rand = "0.7.3"
|
||||
typenum = "1.12.0"
|
||||
# XXXX why did I have to downgrade?
|
||||
generic-array = "0.14.2"
|
||||
generic-array = "0.14.3"
|
||||
rand_core = "0.5.1"
|
||||
crypto-mac = "0.8.0"
|
||||
hmac = "0.8.0"
|
||||
hkdf = "0.9.0-alpha.0"
|
||||
hmac = "0.8.1"
|
||||
hkdf = "0.9.0"
|
||||
zeroize = "1.1.0"
|
||||
subtle = "2.2.3"
|
||||
stream-cipher = "0.4.1"
|
||||
sha2 = "0.9.0"
|
||||
stream-cipher = "0.6.0"
|
||||
sha2 = "0.9.1"
|
||||
|
||||
[dev-dependencies]
|
||||
hex-literal = "0.2.1"
|
||||
hex-literal = "0.3.0"
|
||||
|
||||
|
|
Loading…
Reference in New Issue