Skip to content

Commit

Permalink
Remove some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Jan 10, 2024
1 parent 9cc9496 commit 7ca3d97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
1 change: 0 additions & 1 deletion belt-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ pub fn belt_compress(x1: [u32; 4], x2: [u32; 4], x34: [u32; 8]) -> ([u32; 4], [u

#[inline(always)]
fn xor(a: [u32; 4], b: [u32; 4]) -> [u32; 4] {
// TODO: use array zip on stabilization and MSRV bump
[a[0] ^ b[0], a[1] ^ b[1], a[2] ^ b[2], a[3] ^ b[3]]
}

Expand Down
19 changes: 6 additions & 13 deletions shabal/src/core_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,12 @@ impl VariableOutputCore for ShabalVarCore {
64 => consts::INIT_512,
_ => return Err(InvalidOutputSize),
};
let w = Wrapping(1);
// TODO: use `array::map` on MSRV bump
let mut a = [Wrapping(0u32); 12];
let mut b = [Wrapping(0u32); 16];
let mut c = [Wrapping(0u32); 16];
for i in 0..12 {
a[i] = Wrapping(init.0[i]);
}
for i in 0..16 {
b[i] = Wrapping(init.1[i]);
c[i] = Wrapping(init.2[i]);
}
Ok(Self { a, b, c, w })
Ok(Self {
a: init.0.map(Wrapping),
b: init.1.map(Wrapping),
c: init.2.map(Wrapping),
w: Wrapping(1),
})
}

#[inline]
Expand Down

0 comments on commit 7ca3d97

Please sign in to comment.