Skip to content

Commit e74253a

Browse files
committed
test: cover dynamic dory uint8 varbinary offset
1 parent 1bf50a6 commit e74253a

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

crates/proof-of-sql/src/proof_primitive/dory/dynamic_dory_compute_commitments_test.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,31 @@ fn we_can_compute_a_dynamic_dory_commitment_with_mixed_committable_columns_with_
379379
assert_eq!(res[9].0, expected);
380380
}
381381

382+
#[test]
383+
fn we_can_compute_dynamic_dory_commitments_for_uint8_and_varbinary_with_an_offset() {
384+
let public_parameters = PublicParameters::test_rand(5, &mut test_rng());
385+
let setup = ProverSetup::from(&public_parameters);
386+
let res = compute_dynamic_dory_commitments(
387+
&[
388+
CommittableColumn::Uint8(&[0, u8::MAX]),
389+
CommittableColumn::VarBinary(vec![[3, 0, 0, 0], [4, 0, 0, 0]]),
390+
],
391+
1,
392+
&setup,
393+
);
394+
395+
assert_eq!(res.len(), 2);
396+
let Gamma_1 = public_parameters.Gamma_1;
397+
let Gamma_2 = public_parameters.Gamma_2;
398+
let expected: GT = Pairing::pairing(Gamma_1[1], Gamma_2[1]) * F::from(0)
399+
+ Pairing::pairing(Gamma_1[0], Gamma_2[2]) * F::from(u8::MAX);
400+
assert_eq!(res[0].0, expected);
401+
402+
let expected: GT = Pairing::pairing(Gamma_1[1], Gamma_2[1]) * F::from(3)
403+
+ Pairing::pairing(Gamma_1[0], Gamma_2[2]) * F::from(4);
404+
assert_eq!(res[1].0, expected);
405+
}
406+
382407
#[test]
383408
fn we_can_compute_a_dynamic_dory_commitment_with_mixed_committable_columns_with_signed_values() {
384409
let public_parameters = PublicParameters::test_rand(5, &mut test_rng());

0 commit comments

Comments
 (0)