mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 04:09:23 +00:00
3.2.3 Don't yield identity in Group::random
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user