From 2e408957db69de8ea752b8cea5b559237846a634 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sun, 11 Nov 2018 10:54:08 +1300 Subject: [PATCH] Update zip32 crate to use ff crate --- Cargo.lock | 1 + zip32/Cargo.toml | 1 + zip32/src/lib.rs | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index fa0511c..3715c7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -463,6 +463,7 @@ dependencies = [ "aes 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)", "byteorder 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ff 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "fpe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "pairing 0.14.2", diff --git a/zip32/Cargo.toml b/zip32/Cargo.toml index 031d636..49ae186 100644 --- a/zip32/Cargo.toml +++ b/zip32/Cargo.toml @@ -14,6 +14,7 @@ repository = "https://github.com/zcash-hackworks/zip32" [dependencies] aes = "0.2" byteorder = "1" +ff = "0.4" fpe = "0.1" lazy_static = "1.0" pairing = { path = "../pairing" } diff --git a/zip32/src/lib.rs b/zip32/src/lib.rs index 5b322db..f26ccad 100644 --- a/zip32/src/lib.rs +++ b/zip32/src/lib.rs @@ -1,6 +1,7 @@ extern crate aes; extern crate blake2_rfc; extern crate byteorder; +extern crate ff; extern crate fpe; #[macro_use] extern crate lazy_static; @@ -10,8 +11,9 @@ extern crate sapling_crypto; use aes::Aes256; use blake2_rfc::blake2b::{Blake2b, Blake2bResult}; use byteorder::{ByteOrder, LittleEndian, ReadBytesExt, WriteBytesExt}; +use ff::{Field, PrimeField, PrimeFieldRepr}; use fpe::ff1::{BinaryNumeralString, FF1}; -use pairing::{bls12_381::Bls12, Field, PrimeField, PrimeFieldRepr}; +use pairing::bls12_381::Bls12; use sapling_crypto::{ jubjub::{ edwards, FixedGenerators, JubjubBls12, JubjubEngine, JubjubParams, ToUniform, Unknown,