Skip to content

Commit

Permalink
bump bls dashpay repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Oct 6, 2024
1 parent 05bb5b9 commit 3b339dd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 27 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions dash-spv-masternode-processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ bip38 = { git = "https://github.com/pankcuf/bip38", rev = "87abd21" }
bitcoin_hashes = { version = "0.11.0", default-features = false }
bitcoinconsensus = { version = "0.19.0-3", optional = true }
blake3 = "1.3.2"
#bls-signatures = { git = "https://github.com/knst/bls-signatures", rev = "cc50aa28e60b134b1eaf493c08970fda0d224b7d", features = ["legacy", "bip32", "apple", "use_serde"] }
bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "4a11186d078be8560b448d16a2bea16473dc1806", features = ["legacy", "bip32", "apple", "use_serde" ] }
#bls-signatures = { path = "../../bls-signatures/rust-bindings/bls-signatures", features = ["legacy", "bip32", "apple", "use_serde"] }
bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "3ffa7fa2b62aecf3943c142508de4b7ec6005bb5", features = ["legacy", "bip32", "apple", "use_serde" ] }
byte = "0.2"
core2 = { version = "0.4.0", optional = true, default-features = false }
dirs-next = "2.0.0"
Expand Down
14 changes: 1 addition & 13 deletions dash-spv-masternode-processor/src/keys/bls_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,20 +177,8 @@ impl BLSKey {
pub fn key_with_seed_data(seed: &[u8], use_legacy: bool) -> Self {
let bls_private_key = PrivateKey::from_bip32_seed(seed);
let bls_public_key = bls_private_key.g1_element().unwrap();
let seckey = UInt256::from(bls_private_key);
let sec_key_s = format!("{}", seckey);

let seckey = UInt256::from(&*bls_private_key.to_bytes());
let pubkey = UInt384(g1_element_serialized(&bls_public_key, use_legacy));
let pubkey_s = format!("{}", pubkey);


let pub_key_legacy = UInt384(g1_element_serialized(&bls_public_key, true));
let pub_key_legacy_s = format!("{}", pub_key_legacy);
let pub_key_basic = UInt384(g1_element_serialized(&bls_public_key, false));
let pub_key_basic_s = format!("{}", pub_key_basic);

println!("pri_key:{} pub_key_leg:{} pub_key_basic:{}\n", seckey, pub_key_legacy_s, pub_key_basic_s);

Self { seckey, pubkey, use_legacy, ..Default::default() }
}

Expand Down
13 changes: 2 additions & 11 deletions dash-spv-masternode-processor/src/tests/keys/bls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ fn bls_pub() {
#[test]
fn test_bls_from_bip32_short_seed() {
let private_key = PrivateKey::from_bip32_seed(&[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

//println!("{:?}", &*private_key.serialize());
//println!("{:?}", &*private_key.serialize().as_slice());
println!("{:?}", &*private_key.to_bytes().as_slice());
assert_eq!(
private_key.to_bytes().as_slice(),
Vec::from_hex("46891c2cec49593c81921e473db7480029e0fc1eb933c6b93d81f5370eb19fbd").unwrap().as_slice(),
Expand All @@ -87,14 +85,7 @@ fn test_bls_from_bip32_long_seed() {
// let seed = [50, 67, 148, 112, 207, 6, 210, 118, 137, 125, 27, 144, 105, 189, 214, 228, 68, 83, 144, 205, 80, 105, 133, 222, 14, 26, 28, 136, 167, 111, 241, 118];
// let secret =
let private_key = PrivateKey::from_bip32_seed(&seed);
println!("private_key:{}", UInt256::from(private_key.to_bytes().as_slice()));
let public_key = private_key.g1_element().unwrap();
let pub_key_legacy = UInt384(crate::keys::bls_key::g1_element_serialized(&public_key, true));
println!("pub_key_legacy:{}", pub_key_legacy);
let pub_key_basic = UInt384(crate::keys::bls_key::g1_element_serialized(&public_key, false));
println!("pub_key_basic:{}", pub_key_basic);
//println!("{:?}", &*private_key.serialize());
//println!("{:?}", &*private_key.serialize().as_slice());
println!("{:?}", &*private_key.to_bytes().as_slice());
assert_eq!(
private_key.to_bytes().as_slice(),
private_key_test_data.as_slice(),
Expand Down

0 comments on commit 3b339dd

Please sign in to comment.