mirror of
https://github.com/serai-dex/serai.git
synced 2024-11-17 01:17:36 +00:00
3.2.3 Don't yield identity in Group::random
This commit is contained in:
parent
40a6672547
commit
74647b1b52
1 changed files with 5 additions and 1 deletions
|
@ -358,7 +358,11 @@ macro_rules! dalek_group {
|
|||
bytes[31] |= u8::try_from(rng.next_u32() % 2).unwrap() << 7;
|
||||
let opt = Self::from_bytes(&bytes);
|
||||
if opt.is_some().into() {
|
||||
return opt.unwrap();
|
||||
let opt = opt.unwrap();
|
||||
// Ban identity, per the trait specification
|
||||
if !bool::from(opt.is_identity()) {
|
||||
return opt;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue