Fix EC key conversion & constraints

This commit is contained in:
Quentin Gliech
2022-08-29 12:22:29 +02:00
parent 2df95f9503
commit 25d16b34e9
2 changed files with 3 additions and 3 deletions

View File

@@ -221,7 +221,7 @@ impl<'a> ConstraintSet<'a> {
ConstraintDecision::Positive => score += 1,
ConstraintDecision::Neutral => {}
// If any constraint was negative, don't add it to the candidates
ConstraintDecision::Negative => break 'outer,
ConstraintDecision::Negative => continue 'outer,
}
}

View File

@@ -152,7 +152,7 @@ mod ec_impls {
.get(..FieldSize::<C>::USIZE)
.ok_or_else(Self::Error::default)?;
let y = value
.x
.y
.get(..FieldSize::<C>::USIZE)
.ok_or_else(Self::Error::default)?;
@@ -220,7 +220,7 @@ mod legacy {
y.try_into()
.map_err(|_| anyhow::anyhow!("invalid curve parameter y"))?,
),
_ => bail!("Wrong key type"),
_ => bail!("Wrong curve"),
};
let point = sec1::EncodedPoint::from_affine_coordinates(&x.into(), &y.into(), false);