Skip to content

Commit

Permalink
Merge pull request #227 from ConsenSys/fix/element_setstring
Browse files Browse the repository at this point in the history
element.SetString() returns error instead of panic if invalid input)
  • Loading branch information
gbotrel authored Jul 27, 2022
2 parents e01af17 + 0692859 commit 006aa72
Show file tree
Hide file tree
Showing 42 changed files with 140 additions and 120 deletions.
2 changes: 1 addition & 1 deletion ecc/bls12-377/bls12-377.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func init() {

g1Gen.X.SetString("81937999373150964239938255573465948239988671502647976594219695644855304257327692006745978603320413799295628339695")
g1Gen.Y.SetString("241266749859715473739788878240585681733927191168601896383759122102112907357779751001206799952863815012735208165030")
g1Gen.Z.SetString("1")
g1Gen.Z.SetOne()

g2Gen.X.SetString("233578398248691099356572568220835526895379068987715365179118596935057653620464273615301663571204657964920925606294",
"140913150380207355837477652521042157274541796891053068589147167627541651775299824604154852141315666357241556069118")
Expand Down
9 changes: 5 additions & 4 deletions ecc/bls12-377/fp/element.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions ecc/bls12-377/fr/element.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ecc/bls12-377/multiexp_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ecc/bls12-378/bls12-378.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func init() {
// E(3,y) * cofactor
g1Gen.X.SetString("302027100877540500544138164010696035562809807233645104772290911818386302983750063098216015456036850656714568735197")
g1Gen.Y.SetString("232851047397483214541821965369374725182070455016459237170823497053622811786333462699984177726412751508198874482530")
g1Gen.Z.SetString("1")
g1Gen.Z.SetOne()

// E_t(1,y) * cofactor'
g2Gen.X.SetString("470810816643554779222760025249941413452299198622737082648784137654933833261310635469274149014014206108405592809732",
Expand Down
9 changes: 5 additions & 4 deletions ecc/bls12-378/fp/element.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions ecc/bls12-378/fr/element.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ecc/bls12-378/multiexp_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ecc/bls12-381/bls12-381.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func init() {

g1Gen.X.SetString("3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507")
g1Gen.Y.SetString("1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569")
g1Gen.Z.SetString("1")
g1Gen.Z.SetOne()

g2Gen.X.SetString("352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160",
"3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758")
Expand Down
9 changes: 5 additions & 4 deletions ecc/bls12-381/fp/element.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions ecc/bls12-381/fr/element.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ecc/bls12-381/multiexp_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ecc/bls24-315/bls24-315.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func init() {
// E(1,y)*c
g1Gen.X.SetString("34223510504517033132712852754388476272837911830964394866541204856091481856889569724484362330263")
g1Gen.Y.SetString("24215295174889464585413596429561903295150472552154479431771837786124301185073987899223459122783")
g1Gen.Z.SetString("1")
g1Gen.Z.SetOne()

// E'(5,y)*c'
g2Gen.X.B0.SetString("24614737899199071964341749845083777103809664018538138889239909664991294445469052467064654073699",
Expand Down
9 changes: 5 additions & 4 deletions ecc/bls24-315/fp/element.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions ecc/bls24-315/fr/element.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions ecc/bls24-315/hash_to_g2.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ func svdwMapG2(u fptower.E4) G2Affine {
// constants
// sage script to find z: https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#appendix-E.1
var z, c1, c2, c3, c4 fptower.E4
z.B0.A0.SetString("1")
z.B0.A0.SetOne()
z.B0.A1.SetString("0")
z.B1.A0.SetString("1")
z.B1.A0.SetOne()
z.B1.A1.SetString("0")
c1.B0.A0.SetString("1")
c1.B0.A1.SetString("1")
c1.B0.A0.SetOne()
c1.B0.A1.SetOne()
c1.B1.A0.SetString("2")
c1.B1.A1.SetString("6108483493771298205388567675447533806912846525679192205394505462405828322019437284165171866703")
c2.B0.A0.SetString("19852571354756719167512844945204484872466751208457374667532142752818942046563171173536808566784")
Expand Down
4 changes: 2 additions & 2 deletions ecc/bls24-315/multiexp_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 006aa72

Please sign in to comment.