Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ed448-goldilocks/src/decaf/points.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,11 @@ impl Group for DecafPoint {
let mut bytes = DecafPointRepr::default();

loop {
rng.try_fill_bytes(bytes.as_mut())?;
if let Some(point) = Self::from_bytes(&bytes).into() {
rng.try_fill_bytes(&mut bytes)?;
if let Some(point) = Self::from_bytes(&bytes)
.into_option()
.filter(|&point| point != Self::IDENTITY)
{
return Ok(point);
}
}
Expand Down
7 changes: 5 additions & 2 deletions ed448-goldilocks/src/edwards/extended.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,11 @@ impl Group for EdwardsPoint {
let mut bytes = Array::default();

loop {
rng.try_fill_bytes(bytes.as_mut())?;
if let Some(point) = Self::from_bytes(&bytes).into() {
rng.try_fill_bytes(&mut bytes)?;
if let Some(point) = Self::from_bytes(&bytes)
.into_option()
.filter(|&point| point != Self::IDENTITY)
{
return Ok(point);
}
}
Expand Down