mirror of
https://github.com/saymrwulf/fips205-source.git
synced 2026-09-03 19:53:49 +00:00
aus2cc
This commit is contained in:
parent
befcf9a600
commit
1e584bef6c
1 changed files with 2 additions and 2 deletions
|
|
@ -43,7 +43,7 @@ pub(crate) fn to_int(x: &[u8], n: usize) -> u64 {
|
|||
/// Input: Integer `x`, string length `n`. <br>
|
||||
/// Output: Byte string of length `n` containing binary representation of `x` in big-endian byte-order.
|
||||
pub(crate) fn to_byte(x: u64, n: usize) -> Vec<u8> {
|
||||
let mut s = vec![0u8; n];
|
||||
let mut s = vec![0u8; n]; // TODO revisit generic array
|
||||
|
||||
// 1: total ← x
|
||||
let mut total = x;
|
||||
|
|
@ -73,7 +73,7 @@ pub(crate) fn to_byte(x: u64, n: usize) -> Vec<u8> {
|
|||
/// Output: Array of `out_len` integers in the range `[0, . . . , 2^b − 1]`.
|
||||
pub(crate) fn base_2b(x: &[u8], b: u32, out_len: usize) -> Vec<u64> {
|
||||
assert!(x.len() >= out_len * b as usize / 8);
|
||||
let mut baseb = vec![0u64; out_len];
|
||||
let mut baseb = vec![0u64; out_len]; // TODO revisit GenericArray
|
||||
|
||||
// 1: in ← 0
|
||||
let mut inn = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue