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:
Kirk Baird
2020-04-28 18:27:33 +10:00
committed by GitHub
parent 1abb54dabd
commit c102d9d1f9
8 changed files with 15 additions and 24 deletions

View File

@@ -23,7 +23,6 @@ impl Case for BlsSign {
// Convert private_key and message to required types
let mut sk = hex::decode(&self.input.privkey[2..])
.map_err(|e| Error::FailedToParseTest(format!("{:?}", e)))?;
pad_to_48(&mut sk);
let sk = SecretKey::from_bytes(&sk).unwrap();
let msg = hex::decode(&self.input.message[2..])
.map_err(|e| Error::FailedToParseTest(format!("{:?}", e)))?;
@@ -37,10 +36,3 @@ impl Case for BlsSign {
compare_result::<Vec<u8>, Vec<u8>>(&Ok(signature.as_bytes()), &Some(decoded))
}
}
// Increase the size of an array to 48 bytes
fn pad_to_48(array: &mut Vec<u8>) {
while array.len() < 48 {
array.insert(0, 0);
}
}