mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-10 05:09:22 +00:00
Extend modular-frost to test with scaled and offset keys
The transcript transcripted the group key _plus_ the offset, when it should've only transcripted the group key as the declared group key already had the offset applied. This has been fixed.
This commit is contained in:
@@ -251,10 +251,11 @@ pub fn test_offset_schnorr<R: RngCore + CryptoRng, C: Curve, H: Hram<C>>(rng: &m
|
||||
let mut keys = key_gen(&mut *rng);
|
||||
let group_key = keys[&Participant::new(1).unwrap()].group_key();
|
||||
|
||||
let scalar = C::F::from(3);
|
||||
let offset = C::F::from(5);
|
||||
let offset_key = group_key + (C::generator() * offset);
|
||||
let offset_key = (group_key * scalar) + (C::generator() * offset);
|
||||
for keys in keys.values_mut() {
|
||||
*keys = keys.offset(offset);
|
||||
*keys = keys.clone().scale(scalar).unwrap().offset(offset);
|
||||
assert_eq!(keys.group_key(), offset_key);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user