Skip to content

Commit

Permalink
Update to latest dalek
Browse files Browse the repository at this point in the history
  • Loading branch information
pietgeursen committed Sep 15, 2020
1 parent 38380d0 commit dfb154f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bamboo-core-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ hex = { git = "https://github.com/KokaKiwi/rust-hex", default-features = false }
varu64 = { git = "https://github.com/AljoschaMeyer/varu64-rs", default-features = false }
lipmaa-link = "0.1.1"
blake2b_simd = { version = "0.5.5", default-features = false }
ed25519-dalek = { git = "https://github.com/dalek-cryptography/ed25519-dalek", rev = "29a06e494ddd", default-features = false, features = ["u64_backend", "nightly", "alloc"] }
ed25519-dalek = { version = "1.0.0", default-features = false, features = ["u32_backend", "nightly", "alloc", "serde"] }
criterion = "0.2"
rand = "0.7.0"

Expand Down
2 changes: 1 addition & 1 deletion bamboo-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ hex = { git = "https://github.com/KokaKiwi/rust-hex", default-features = false }
varu64 = { git = "https://github.com/AljoschaMeyer/varu64-rs", default-features = false }
lipmaa-link = "0.1"
blake2b_simd = { version = "0.5", default-features = false }
ed25519-dalek = { git = "https://github.com/dalek-cryptography/ed25519-dalek", rev = "29a06e494ddd", default-features = false, features = ["u64_backend", "nightly"] }
ed25519-dalek = { version = "1.0.0", default-features = false, features = ["u32_backend", "nightly"] }
static_assertions = "0.3"
4 changes: 2 additions & 2 deletions bamboo-core/src/entry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use varu64::{
#[cfg(feature = "std")]
use varu64::encode_write as varu64_encode_write;

use ed25519_dalek::{PublicKey as DalekPublicKey, Signature as DalekSignature};
use ed25519_dalek::{PublicKey as DalekPublicKey, Signature as DalekSignature, Signer, Verifier};

use super::signature::{Signature, MAX_SIGNATURE_SIZE};
use super::yamf_hash::{YamfHash, MAX_YAMF_HASH_SIZE};
Expand Down Expand Up @@ -432,7 +432,7 @@ where
//Pluck off the signature before we encode it
let sig = self.sig.take();

let ssb_sig = DalekSignature::from_bytes(sig.as_ref().unwrap().0.borrow())
let ssb_sig = DalekSignature::try_from(sig.as_ref().unwrap().0.borrow())
.map_err(|_| Error::DecodeSsbSigError)?;

let mut buff = [0u8; 512];
Expand Down
8 changes: 4 additions & 4 deletions bamboo-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[package]
name = "bamboo-wasm"
version = "0.3.0"
version = "0.3.6"
authors = ["Piet Geursen <[email protected]>"]
edition = "2018"

[lib]
crate-type = ["cdylib", "rlib"]

[features]
default = ["wee_alloc"]
default = ["wee_alloc", "console_error_panic_hook"]

[dependencies]
arrayvec = { version = "0.5", default-features = false}
wasm-bindgen = { version = "0.2.62" , features = ["serde-serialize"] }
bamboo-core = {path = "../bamboo-core"}
ed25519-dalek = { git = "https://github.com/dalek-cryptography/ed25519-dalek", rev = "29a06e494ddd", default-features = false, features = ["u64_backend", "nightly", "alloc", "serde"] }
rand = { version = "0.7.0", features = ["wasm-bindgen"] }
ed25519-dalek = { version = "1.0.0", default-features = false, features = ["u32_backend", "alloc", "serde"] }
rand = { version = "0.7.3", features = ["wasm-bindgen"] }
serde = { version = "1.0.90", features = ["derive"] }


Expand Down
4 changes: 3 additions & 1 deletion bamboo-wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
mod utils;
pub mod utils;

pub use utils::set_panic_hook;

use serde::Serialize;
use wasm_bindgen::prelude::*;
Expand Down
4 changes: 4 additions & 0 deletions bamboo-wasm/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use wasm_bindgen::prelude::*;

#[no_mangle]
#[wasm_bindgen]
pub fn set_panic_hook() {
// When the `console_error_panic_hook` feature is enabled, we can call the
// `set_panic_hook` function at least once during initialization, and then
Expand Down
4 changes: 2 additions & 2 deletions bamboo-wasm/tests/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

extern crate wasm_bindgen_test;
use wasm_bindgen_test::*;

wasm_bindgen_test_configure!(run_in_browser);
use bamboo_wasm::*;

#[wasm_bindgen_test]
fn pass() {
let keypair = KeyPair::new();
assert_eq!(1 + 1, 2);
}

0 comments on commit dfb154f

Please sign in to comment.