Skip to content

Commit 6b1cfd5

Browse files
Fix is_zero for twisted Edwards curves (#101)
* fix the te is_zero * update CHANGELOG Co-authored-by: onewayfunc <[email protected]>
1 parent 6512e48 commit 6b1cfd5

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ jobs:
186186
echo "ark-ec = { git = 'https://github.com/arkworks-rs/algebra' }"
187187
echo "ark-ff = { git = 'https://github.com/arkworks-rs/algebra' }"
188188
echo "ark-poly = { git = 'https://github.com/arkworks-rs/algebra' }"
189+
echo "ark-relations = { git = 'https://github.com/arkworks-rs/snark' }"
189190
echo "ark-serialize = { git = 'https://github.com/arkworks-rs/algebra' }"
190191
echo "ark-algebra-bench-templates = { git = 'https://github.com/arkworks-rs/algebra' }"
191192
echo "ark-algebra-test-templates = { git = 'https://github.com/arkworks-rs/algebra' }"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
### Bug Fixes
2020

21+
- [\#101](https://github.com/arkworks-rs/r1cs-std/pull/101) Fix `is_zero` for twisted Edwards curves.
2122
- [\#86](https://github.com/arkworks-rs/r1cs-std/pull/86) Make result of `query_position_to_coset` consistent with `ark-ldt`.
2223
- [\#77](https://github.com/arkworks-rs/r1cs-std/pull/77) Fix BLS12 `G2PreparedGadget`'s `AllocVar` when G2 uses a divisive twist.
2324

src/groups/curves/twisted_edwards/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ where
423423
}
424424

425425
fn is_zero(&self) -> Result<Boolean<<P::BaseField as Field>::BasePrimeField>, SynthesisError> {
426-
self.x.is_zero()?.and(&self.x.is_one()?)
426+
self.x.is_zero()?.and(&self.y.is_one()?)
427427
}
428428

429429
#[tracing::instrument(target = "r1cs", skip(cs, f))]

0 commit comments

Comments
 (0)