effectfully / tiny-lang

BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

The characteristic of the field in Jubjub.hs isn't a prime number! #42

Closed kwxm closed 5 years ago

kwxm commented 5 years ago

I don't have time time fix this at the moment, but I just noticed that the number 5243587517512619047944774050818596583769055250052763782260365869993858118451352435875175126190479447740508185965837690552500527637822603658699938581184513

in Jubjub.hs isn't prime. If you look closely it's the same number repeated twice, so it's equal to 52435875175126190479447740508185965837690552500527637822603658699938581184513 * 100000000000000000000000000000000000000000000000000000000000000000000000000001

Oops.

I think I must have accidentally clicked twice while pasting at some point. This adds some force to the suggestion in #36 that we should have a test to make sure that characteristics are actually prime.

effectfully commented 5 years ago
5243587517512619047944774050818596583769055250052763782260365869993858118451352435875175126190479447740508185965837690552500527637822603658699938581184513

But it's not what in the Jubjub module? It's

52435875175126190479447740508185965837690552500527637822603658699938581184513

there.

I just checked, the number there is equal to r, i.e. it's the correct one.

kwxm commented 5 years ago

Oh. I was experimenting with the type in there a little and maybe I pasted it in twice when I was doing that.

Sorry for the false alarm.