Skip to content

Commit 9c4f0fa

Browse files
committed
Fix ToConstraintField bound for Affine
1 parent 25d4b7e commit 9c4f0fa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ec/src/models/short_weierstrass/affine.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub struct Affine<P: SWCurveConfig> {
3333
#[doc(hidden)]
3434
pub y: P::BaseField,
3535
#[doc(hidden)]
36-
pub infinity: P::ZeroFlag,
36+
pub(super) infinity: P::ZeroFlag,
3737
}
3838

3939
impl<P: SWCurveConfig> PartialEq<Projective<P>> for Affine<P> {
@@ -433,13 +433,12 @@ impl<P: SWCurveConfig> CanonicalDeserialize for Affine<P> {
433433
impl<M: SWCurveConfig, ConstraintF: Field> ToConstraintField<ConstraintF> for Affine<M>
434434
where
435435
M::BaseField: ToConstraintField<ConstraintF>,
436-
M::ZeroFlag: ToConstraintField<ConstraintF>,
437436
{
438437
#[inline]
439438
fn to_field_elements(&self) -> Option<Vec<ConstraintF>> {
440439
let mut x = self.x.to_field_elements()?;
441440
let y = self.y.to_field_elements()?;
442-
let infinity = self.infinity.to_field_elements()?;
441+
let infinity = self.is_zero().to_field_elements()?;
443442
x.extend_from_slice(&y);
444443
x.extend_from_slice(&infinity);
445444
Some(x)

0 commit comments

Comments
 (0)