Update milagro_bls to new release (#1183)

* Update milagro_bls to new release

Signed-off-by: Kirk Baird <baird.k@outlook.com>

* Tidy up fake cryptos

Signed-off-by: Kirk Baird <baird.k@outlook.com>

* move SecretHash to bls and put plaintext back

Signed-off-by: Kirk Baird <baird.k@outlook.com>
This commit is contained in:
Kirk Baird
2020-05-29 14:39:33 +10:00
committed by Michael Sproul
parent ce10db15da
commit 197adeff0b
26 changed files with 182 additions and 132 deletions

View File

@@ -6,10 +6,10 @@ use crate::json_keystore::{
Aes128Ctr, ChecksumModule, Cipher, CipherModule, Crypto, EmptyMap, EmptyString, JsonKeystore,
Kdf, KdfModule, Scrypt, Sha256Checksum, Version,
};
use crate::PlainText;
use crate::Uuid;
use bls::{Keypair, PublicKey, SecretKey};
use bls::{Keypair, PublicKey, SecretHash, SecretKey};
use crypto::{digest::Digest, sha2::Sha256};
use eth2_key_derivation::PlainText;
use rand::prelude::*;
use serde::{Deserialize, Serialize};
use ssz::DecodeError;
@@ -136,7 +136,7 @@ impl Keystore {
uuid: Uuid,
path: String,
) -> Result<Self, Error> {
let secret: PlainText = keypair.sk.as_bytes();
let secret: SecretHash = keypair.sk.as_bytes();
let (cipher_text, checksum) = encrypt(secret.as_bytes(), password, &kdf, &cipher)?;

View File

@@ -6,7 +6,8 @@ mod keystore;
pub mod json_keystore;
pub use bls::PlainText;
pub use bls::SecretHash;
pub use eth2_key_derivation::PlainText;
pub use keystore::{
decrypt, default_kdf, encrypt, keypair_from_secret, Error, Keystore, KeystoreBuilder, DKLEN,
HASH_SIZE, IV_SIZE, SALT_SIZE,