mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-20 14:28:37 +00:00
Update SecretKey to 32 bytes (#1072)
* Update SecretKey to 32 bytes Signed-off-by: Kirk Baird <baird.k@outlook.com> * Stop test from padding to 48 bytes Signed-off-by: Kirk Baird <baird.k@outlook.com> * Fix keypair file secret key length Signed-off-by: Kirk Baird <baird.k@outlook.com>
This commit is contained in:
@@ -5,7 +5,7 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.0.0" }
|
||||
milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.0.1" }
|
||||
eth2_hashing = "0.1.0"
|
||||
hex = "0.3"
|
||||
rand = "0.7.2"
|
||||
|
||||
@@ -56,7 +56,7 @@ mod reals {
|
||||
|
||||
pub const BLS_AGG_SIG_BYTE_SIZE: usize = 96;
|
||||
pub const BLS_SIG_BYTE_SIZE: usize = 96;
|
||||
pub const BLS_SECRET_KEY_BYTE_SIZE: usize = 48;
|
||||
pub const BLS_SECRET_KEY_BYTE_SIZE: usize = 32;
|
||||
pub const BLS_PUBLIC_KEY_BYTE_SIZE: usize = 48;
|
||||
|
||||
use eth2_hashing::hash;
|
||||
|
||||
@@ -80,9 +80,8 @@ mod tests {
|
||||
#[test]
|
||||
pub fn test_ssz_round_trip() {
|
||||
let byte_key = [
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 211, 210, 129, 231, 69, 162, 234,
|
||||
16, 15, 244, 214, 126, 201, 0, 85, 28, 239, 82, 121, 208, 190, 223, 6, 169, 202, 86,
|
||||
236, 197, 218, 3, 69,
|
||||
3, 211, 210, 129, 231, 69, 162, 234, 16, 15, 244, 214, 126, 201, 0, 85, 28, 239, 82,
|
||||
121, 208, 190, 223, 6, 169, 202, 86, 236, 197, 218, 3, 69,
|
||||
];
|
||||
let original = SecretKey::from_bytes(&byte_key).unwrap();
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ lazy_static = "1.4.0"
|
||||
num-bigint = "0.2.3"
|
||||
eth2_hashing = "0.1.0"
|
||||
hex = "0.3"
|
||||
milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.0.0" }
|
||||
milagro_bls = { git = "https://github.com/sigp/milagro_bls", tag = "v1.0.1" }
|
||||
serde_yaml = "0.8.11"
|
||||
serde = "1.0.102"
|
||||
serde_derive = "1.0.102"
|
||||
|
||||
@@ -27,7 +27,7 @@ use std::convert::TryInto;
|
||||
use std::fs::File;
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub const PRIVATE_KEY_BYTES: usize = 48;
|
||||
pub const PRIVATE_KEY_BYTES: usize = 32;
|
||||
pub const PUBLIC_KEY_BYTES: usize = 48;
|
||||
pub const HASH_BYTES: usize = 32;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user