| 1 | // +build amd64,!noasm arm64,!noasm |
| 2 | |
| 3 | package p503scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p503`/ |
| 4 | |
| 5 | import ( |
| 6 | . "github.com/henrydcase/nobs/dh/sidh/internal/isogenyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/" |
| 7 | ) |
| 8 | |
| 9 | // If choice = 0, leave x,y unchanged. If choice = 1, set x,y = y,x. |
| 10 | // If choice is neither 0 nor 1 then behaviour is undefined. |
| 11 | // This function executes in constant time. |
| 12 | //go:noescape |
| 13 | func fp503ConditionalSwapscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p503`/fp503ConditionalSwap().(x, y *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#, choice uint8) |
| 14 | |
| 15 | // Compute z = x + y (mod p). |
| 16 | //go:noescape |
| 17 | func fp503AddReducedscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p503`/fp503AddReduced().(z, x, y *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#) |
| 18 | |
| 19 | // Compute z = x - y (mod p). |
| 20 | //go:noescape |
| 21 | func fp503SubReducedscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p503`/fp503SubReduced().(z, x, y *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#) |
| 22 | |
| 23 | // Compute z = x + y, without reducing mod p. |
| 24 | //go:noescape |
| 25 | func fp503AddLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p503`/fp503AddLazy().(z, x, y *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#) |
| 26 | |
| 27 | // Compute z = x + y, without reducing mod p. |
| 28 | //go:noescape |
| 29 | func fp503X2AddLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p503`/fp503X2AddLazy().(z, x, y *FpElementX2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElementX2#) |
| 30 | |
| 31 | // Compute z = x - y, without reducing mod p. |
| 32 | //go:noescape |
| 33 | func fp503X2SubLazyscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p503`/fp503X2SubLazy().(z, x, y *FpElementX2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElementX2#) |
| 34 | |
| 35 | // Reduce a field element in [0, 2*p) to one in [0,p). |
| 36 | //go:noescape |
| 37 | func fp503StrongReducescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p503`/fp503StrongReduce().(x *FpElementscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/internal/isogeny`/FpElement#) |
| 38 | |
| 39 | // Computes z = x * y. |
| 40 | //go:noescape |
| 41 | func fp503Mulscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p503`/fp503Mul().(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#) |
| 42 | |
| 43 | // Computes the Montgomery reduction z = x R^{-1} (mod 2*p). On return value |
| 44 | // of x may be changed. z=x not allowed. |
| 45 | //go:noescape |
| 46 | func fp503MontgomeryReducescip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/sidh/p503`/fp503MontgomeryReduce().(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#) |