Skip to content

Commit

Permalink
sm2ec/fiat: regenerate to include more functions and scalar/order rel…
Browse files Browse the repository at this point in the history
…ated
  • Loading branch information
emmansun authored Aug 14, 2024
1 parent b7f95a5 commit 6926113
Show file tree
Hide file tree
Showing 8 changed files with 2,567 additions and 1,382 deletions.
9 changes: 8 additions & 1 deletion internal/sm2ec/fiat/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ var curves = []struct {
FiatType: "[4]uint64",
BytesLen: 32,
},
{
Element: "SM2P256OrderElement",
Prime: "2^256 - 2^224 - 188730267045675049073202170516080344797",
Prefix: "sm2p256scalar",
FiatType: "[4]uint64",
BytesLen: 32,
},
}

func main() {
Expand Down Expand Up @@ -70,7 +77,7 @@ func main() {
"--doc-prepend-header", "Code generated by Fiat Cryptography. DO NOT EDIT.",
"--package-name", "fiat", "--no-prefix-fiat", c.Prefix, "64", c.Prime,
"mul", "square", "add", "sub", "one", "from_montgomery", "to_montgomery",
"selectznz", "to_bytes", "from_bytes")
"selectznz", "to_bytes", "from_bytes", "nonzero", "opp", "msat", "divstep", "divstep_precomp")
cmd.Stderr = os.Stderr
out, err := cmd.Output()
if err != nil {
Expand Down
339 changes: 335 additions & 4 deletions internal/sm2ec/fiat/sm2p256_fiat64.go

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

Loading

0 comments on commit 6926113

Please sign in to comment.