| 1 | // +build amd64,!noasm |
| 2 | |
| 3 | package csidhscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/ |
| 4 | |
| 5 | import "math/bitsscip-go gomod github.com/golang/go/src go1.12 `math/bits`/" |
| 6 | |
| 7 | //go:noescape |
| 8 | func mul512scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/mul512().(a, b *fpscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/fp#, c uint64) |
| 9 | |
| 10 | //go:noescape |
| 11 | func mul576scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/mul576().(a *[9]uint64, b *fpscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/fp#, c uint64) |
| 12 | |
| 13 | //go:noescape |
| 14 | func cswap512scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/cswap512().(x, y *fpscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/fp#, choice uint8) |
| 15 | |
| 16 | //go:noescape |
| 17 | func mulBmiAsmscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/mulBmiAsm().(res, x, y *fpscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/fp#) |
| 18 | |
| 19 | // mulRdc performs montgomery multiplication r = x * y mod P. |
| 20 | // Returned result r is already reduced and in Montgomery domain. |
| 21 | func mulRdcscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/mulRdc().(r, x, y *fpscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/fp#) { |
| 22 | var t fpscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/fp# |
| 23 | var c uint64 |
| 24 | |
| 25 | if hasADXandBMI2scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/hasADXandBMI2. { |
| 26 | mulBmiAsmscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/mulBmiAsm().(r, x, y) |
| 27 | } else { |
| 28 | mulGenericscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/mulGeneric().(r, x, y) |
| 29 | } |
| 30 | |
| 31 | // if p <= r < 2p then r = r-p |
| 32 | t[0], c = bitsscip-go gomod github.com/golang/go/src go1.12 `math/bits`/.Sub64scip-go gomod github.com/golang/go/src go1.12 `math/bits`/Sub64().(r[0], pscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/p.[0], 0) |
| 33 | t[1], c = bitsscip-go gomod github.com/golang/go/src go1.12 `math/bits`/.Sub64scip-go gomod github.com/golang/go/src go1.12 `math/bits`/Sub64().(r[1], pscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/p.[1], c) |
| 34 | t[2], c = bitsscip-go gomod github.com/golang/go/src go1.12 `math/bits`/.Sub64scip-go gomod github.com/golang/go/src go1.12 `math/bits`/Sub64().(r[2], pscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/p.[2], c) |
| 35 | t[3], c = bitsscip-go gomod github.com/golang/go/src go1.12 `math/bits`/.Sub64scip-go gomod github.com/golang/go/src go1.12 `math/bits`/Sub64().(r[3], pscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/p.[3], c) |
| 36 | t[4], c = bitsscip-go gomod github.com/golang/go/src go1.12 `math/bits`/.Sub64scip-go gomod github.com/golang/go/src go1.12 `math/bits`/Sub64().(r[4], pscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/p.[4], c) |
| 37 | t[5], c = bitsscip-go gomod github.com/golang/go/src go1.12 `math/bits`/.Sub64scip-go gomod github.com/golang/go/src go1.12 `math/bits`/Sub64().(r[5], pscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/p.[5], c) |
| 38 | t[6], c = bitsscip-go gomod github.com/golang/go/src go1.12 `math/bits`/.Sub64scip-go gomod github.com/golang/go/src go1.12 `math/bits`/Sub64().(r[6], pscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/p.[6], c) |
| 39 | t[7], c = bitsscip-go gomod github.com/golang/go/src go1.12 `math/bits`/.Sub64scip-go gomod github.com/golang/go/src go1.12 `math/bits`/Sub64().(r[7], pscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/p.[7], c) |
| 40 | |
| 41 | var w = 0 - c |
| 42 | r[0] = ctPick64scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/ctPick64().(w, r[0], t[0]) |
| 43 | r[1] = ctPick64scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/ctPick64().(w, r[1], t[1]) |
| 44 | r[2] = ctPick64scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/ctPick64().(w, r[2], t[2]) |
| 45 | r[3] = ctPick64scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/ctPick64().(w, r[3], t[3]) |
| 46 | r[4] = ctPick64scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/ctPick64().(w, r[4], t[4]) |
| 47 | r[5] = ctPick64scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/ctPick64().(w, r[5], t[5]) |
| 48 | r[6] = ctPick64scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/ctPick64().(w, r[6], t[6]) |
| 49 | r[7] = ctPick64scip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/dh/csidh`/ctPick64().(w, r[7], t[7]) |
| 50 | } |