| 1 | // +build amd64,!noasm arm64,!noasm |
| 2 | |
| 3 | package p751scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/ |
| 4 | |
| 5 | import . "github.com/henrydcase/nobs/dh/sidh/internal/isogenyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/" |
| 6 | |
| 7 | // If choice = 0, leave x,y unchanged. If choice = 1, set x,y = y,x. |
| 8 | // If choice is neither 0 nor 1 then behaviour is undefined. |
| 9 | // This function executes in constant time. |
| 10 | //go:noescape |
| 11 | func fp751ConditionalSwapscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751ConditionalSwap().(x, y *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#, choice uint8) |
| 12 | |
| 13 | // Compute z = x + y (mod p). |
| 14 | //go:noescape |
| 15 | func fp751AddReducedscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751AddReduced().(z, x, y *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#) |
| 16 | |
| 17 | // Compute z = x - y (mod p). |
| 18 | //go:noescape |
| 19 | func fp751SubReducedscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751SubReduced().(z, x, y *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#) |
| 20 | |
| 21 | // Compute z = x + y, without reducing mod p. |
| 22 | //go:noescape |
| 23 | func fp751AddLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751AddLazy().(z, x, y *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#) |
| 24 | |
| 25 | // Compute z = x + y, without reducing mod p. |
| 26 | //go:noescape |
| 27 | func fp751X2AddLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751X2AddLazy().(z, x, y *FpElementX2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElementX2#) |
| 28 | |
| 29 | // Compute z = x - y, without reducing mod p. |
| 30 | //go:noescape |
| 31 | func fp751X2SubLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751X2SubLazy().(z, x, y *FpElementX2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElementX2#) |
| 32 | |
| 33 | // Compute z = x * y. |
| 34 | //go:noescape |
| 35 | func fp751Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751Mul().(z *FpElementX2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElementX2#, x, y *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#) |
| 36 | |
| 37 | // Compute Montgomery reduction: set z = x * R^{-1} (mod 2*p). |
| 38 | // It may destroy the input value. |
| 39 | //go:noescape |
| 40 | func fp751MontgomeryReducescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751MontgomeryReduce().(z *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#, x *FpElementX2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElementX2#) |
| 41 | |
| 42 | // Reduce a field element in [0, 2*p) to one in [0,p). |
| 43 | //go:noescape |
| 44 | func fp751StrongReducescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p751`/fp751StrongReduce().(x *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#) |