Package list golang-github-minio-sha256-simd / 0d7ea3c
fixing noasm tag build (#42) Dylan Dreyer authored 2 years ago Harshavardhana committed 2 years ago
8 changed file(s) with 26 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
7575 )
7676
7777 var blockfunc blockfuncType
78
79 func block(dig *digest, p []byte) {
80 if blockfunc == blockfuncSha {
81 blockShaGo(dig, p)
82 } else if blockfunc == blockfuncAvx2 {
83 blockAvx2Go(dig, p)
84 } else if blockfunc == blockfuncAvx {
85 blockAvxGo(dig, p)
86 } else if blockfunc == blockfuncSsse {
87 blockSsseGo(dig, p)
88 } else if blockfunc == blockfuncArm {
89 blockArmGo(dig, p)
90 } else if blockfunc == blockfuncGeneric {
91 blockGeneric(dig, p)
92 }
93 }
9478
9579 func init() {
9680 is386bit := runtime.GOARCH == "386"
0 //+build !noasm !appengine
0 //+build !noasm,!appengine
11
22 // SHA256 implementation for AVX2
33
0 //+build !noasm,!appengine
1
02 TEXT ·sha256X16Avx512(SB), 7, $0
13 MOVQ digests+0(FP), DI
24 MOVQ scratch+8(FP), R12
0 //+build !noasm !appengine
0 //+build !noasm,!appengine
11
22 // SHA256 implementation for AVX
33
0 //+build !noasm !appengine
0 //+build !noasm,!appengine
11
22 // SHA intrinsic version of SHA256
33
0 //+build !noasm !appengine
0 //+build !noasm,!appengine
11
22 // SHA256 implementation for SSSE3
33
1616 */
1717
1818 package sha256
19
20 func block(dig *digest, p []byte) {
21 blockGeneric(dig, p)
22 }
1923
2024 func blockGeneric(dig *digest, p []byte) {
2125 var w [64]uint32
2121 func blockSsseGo(dig *digest, p []byte) {}
2222 func blockShaGo(dig *digest, p []byte) {}
2323 func blockArmGo(dig *digest, p []byte) {}
24
25 func block(dig *digest, p []byte) {
26 if blockfunc == blockfuncSha {
27 blockShaGo(dig, p)
28 } else if blockfunc == blockfuncAvx2 {
29 blockAvx2Go(dig, p)
30 } else if blockfunc == blockfuncAvx {
31 blockAvxGo(dig, p)
32 } else if blockfunc == blockfuncSsse {
33 blockSsseGo(dig, p)
34 } else if blockfunc == blockfuncArm {
35 blockArmGo(dig, p)
36 } else if blockfunc == blockfuncGeneric {
37 blockGeneric(dig, p)
38 }
39 }