Improve bls::SecretKey privacy (#1164)

* Improve bls::SecretKey privacy

* Add missed file

* Remove more methods from bls::SecretKey

* Add as_bytes() to SecretKey, remove as_raw

* Remove as_raw

* Add back as_raw

* Address review comments
This commit is contained in:
Paul Hauner
2020-05-19 11:23:08 +10:00
committed by GitHub
parent 314fae41fe
commit c93f9c351b
26 changed files with 102 additions and 295 deletions

View File

@@ -118,7 +118,7 @@ impl Harness {
check_keystore(&validator.dir().join(VOTING_KEYSTORE_FILE), &password_dir);
if !config.random_voting_keystore {
assert_eq!(voting_keypair, generate_deterministic_keypair(0))
assert_eq!(voting_keypair.pk, generate_deterministic_keypair(0).pk)
}
// Use OR here instead of AND so we *always* check for the withdrawal keystores if random
@@ -128,11 +128,11 @@ impl Harness {
let withdrawal_keypair = check_keystore(&withdrawal_keystore_path, &password_dir);
if !config.random_withdrawal_keystore {
assert_eq!(withdrawal_keypair, generate_deterministic_keypair(1))
assert_eq!(withdrawal_keypair.pk, generate_deterministic_keypair(1).pk)
}
// The withdrawal keys should be distinct from the voting keypairs.
assert_ne!(withdrawal_keypair, voting_keypair);
assert_ne!(withdrawal_keypair.pk, voting_keypair.pk);
}
if !config.store_withdrawal_keystore && !config.random_withdrawal_keystore {