FiloSottile / edwards25519

filippo.io/edwards25519 — A safer, faster, and more powerful low-level edwards25519 Go implementation.
https://filippo.io/edwards25519
BSD 3-Clause "New" or "Revised" License
139 stars 30 forks source link

How to regenerate scalar_fiat.go? #46

Open jas4711 opened 2 weeks ago

jas4711 commented 2 weeks ago

Hi. The file claims to be auto-generated:

// Autogenerated: word_by_word_montgomery --lang Go --cmovznz-by-mul --relax-primitive-carry-to-bitwidth 32,64 --public-function-case camelCase --public-type-case camelCase --private-function-case camelCase --private-type-case camelCase --doc-text-before-function-name '' --doc-newline-before-package-declaration --doc-prepend-header 'Code generated by Fiat Cryptography. DO NOT EDIT.' --package-name edwards25519 Scalar 64 '2^252 + 27742317777372353535851937790883648493' mul add sub opp nonzero from_montgomery to_montgomery to_bytes from_bytes

I cannot find any instructions where to find this tool, or which version was used, or how to use it. Help?

Forwarded from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1085809 and https://lists.debian.org/debian-go/2024/05/msg00017.html

FiloSottile commented 2 weeks ago

I'm a little surprised I didn't check in the Dockerfile, but the tool and version are here

https://github.com/FiloSottile/edwards25519/blob/a7dfd8e4e6b456f2f0d11f0176885421029b6e3f/scalar.go#L28-L54