Skip to content

Commit

Permalink
Add type annotations for old compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave committed Jun 7, 2024
1 parent d25aae2 commit 483f551
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
27 changes: 15 additions & 12 deletions src/flp/types/dp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,11 @@ mod tests {

{
let mut rng = XofTurboShake128::init(&[0; 16], &[]).into_seed_stream();
let [mut share1, mut share2] = split_vector(&[Field128::zero(); SIZE], 2)
.unwrap()
.try_into()
.unwrap();
let [mut share1, mut share2]: [Vec<Field128>; 2] =
split_vector(&[Field128::zero(); SIZE], 2)
.unwrap()
.try_into()
.unwrap();

let sumvec: SumVec<_, ParallelSum<_, _>> = SumVec::new(1, SIZE, 1).unwrap();
sumvec
Expand Down Expand Up @@ -247,10 +248,11 @@ mod tests {

{
let mut rng = XofTurboShake128::init(&[1; 16], &[]).into_seed_stream();
let [mut share1, mut share2] = split_vector(&[Field128::zero(); SIZE], 2)
.unwrap()
.try_into()
.unwrap();
let [mut share1, mut share2]: [Vec<Field128>; 2] =
split_vector(&[Field128::zero(); SIZE], 2)
.unwrap()
.try_into()
.unwrap();

let sumvec: SumVec<_, ParallelSum<_, _>> = SumVec::new(2, SIZE, 1).unwrap();
sumvec
Expand Down Expand Up @@ -289,10 +291,11 @@ mod tests {
const SIZE: usize = 10;

let mut rng = XofTurboShake128::init(&[2; 16], &[]).into_seed_stream();
let [mut share1, mut share2] = split_vector(&[Field128::zero(); SIZE], 2)
.unwrap()
.try_into()
.unwrap();
let [mut share1, mut share2]: [Vec<Field128>; 2] =
split_vector(&[Field128::zero(); SIZE], 2)
.unwrap()
.try_into()
.unwrap();

let histogram: Histogram<_, ParallelSum<_, _>> = Histogram::new(SIZE, 1).unwrap();
histogram
Expand Down
6 changes: 4 additions & 2 deletions src/vdaf/prio2/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ mod tests {
];

let proof: Vec<FieldPrio2> = proof_u32.iter().map(|x| FieldPrio2::from(*x)).collect();
let [share1, share2] = split_vector(&proof, 2).unwrap().try_into().unwrap();
let [share1, share2]: [Vec<FieldPrio2>; 2] =
split_vector(&proof, 2).unwrap().try_into().unwrap();
let eval_at = FieldPrio2::from(12313);

let v1 = generate_verification_message(dim, eval_at, &share1, true).unwrap();
Expand All @@ -241,7 +242,8 @@ mod tests {
];

let proof: Vec<FieldPrio2> = proof_u32.iter().map(|x| FieldPrio2::from(*x)).collect();
let [share1, share2] = split_vector(&proof, 2).unwrap().try_into().unwrap();
let [share1, share2]: [Vec<FieldPrio2>; 2] =
split_vector(&proof, 2).unwrap().try_into().unwrap();
let eval_at = FieldPrio2::from(12313);

let v1 = generate_verification_message(dim, eval_at, &share1, true).unwrap();
Expand Down

0 comments on commit 483f551

Please sign in to comment.