Fixing expect script for digital locker example (#118)

This commit is contained in:
Kevin Lewi
2021-01-21 22:09:34 -08:00
committed by GitHub
parent 511d371c9a
commit e421aaad07
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -224,13 +224,13 @@ fn main() {
let locker_index: usize = match locker.parse() {
Ok(index) => index,
Err(_) => {
println!("Could not find locker number");
println!("Error: Could not find locker number");
continue;
}
};
if locker_index >= registered_lockers.len() {
println!("Could not find locker number");
println!("Error: Could not find locker number");
continue;
}
+1 -2
View File
@@ -88,8 +88,7 @@ pub(crate) fn expand_message_xmd<H: Hash>(
let l_i_b_str = i2osp(len_in_bytes, 2);
let msg_prime = [&z_pad, msg, &l_i_b_str, &i2osp(0, 1), &dst_prime].concat();
let mut b: Vec<Vec<u8>> = Vec::new();
b.push(H::digest(&msg_prime).to_vec()); // b[0]
let mut b: Vec<Vec<u8>> = vec![H::digest(&msg_prime).to_vec()]; // b[0]
let mut h = H::new();
h.update(&b[0]);