diff options
Diffstat (limited to 'vendor/github.com/minio/md5-simd/md5-util_amd64.go')
-rw-r--r-- | vendor/github.com/minio/md5-simd/md5-util_amd64.go | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/vendor/github.com/minio/md5-simd/md5-util_amd64.go b/vendor/github.com/minio/md5-simd/md5-util_amd64.go deleted file mode 100644 index 73981b0..0000000 --- a/vendor/github.com/minio/md5-simd/md5-util_amd64.go +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | //+build !noasm,!appengine,gc | ||
2 | |||
3 | // Copyright (c) 2020 MinIO Inc. All rights reserved. | ||
4 | // Use of this source code is governed by a license that can be | ||
5 | // found in the LICENSE file. | ||
6 | |||
7 | package md5simd | ||
8 | |||
9 | // Helper struct for sorting blocks based on length | ||
10 | type lane struct { | ||
11 | len uint | ||
12 | pos uint | ||
13 | } | ||
14 | |||
15 | type digest struct { | ||
16 | s [4]uint32 | ||
17 | } | ||
18 | |||
19 | // Helper struct for generating number of rounds in combination with mask for valid lanes | ||
20 | type maskRounds struct { | ||
21 | mask uint64 | ||
22 | rounds uint64 | ||
23 | } | ||
24 | |||
25 | func generateMaskAndRounds8(input [8][]byte, mr *[8]maskRounds) (rounds int) { | ||
26 | // Sort on blocks length small to large | ||
27 | var sorted [8]lane | ||
28 | for c, inpt := range input[:] { | ||
29 | sorted[c] = lane{uint(len(inpt)), uint(c)} | ||
30 | for i := c - 1; i >= 0; i-- { | ||
31 | // swap so largest is at the end... | ||
32 | if sorted[i].len > sorted[i+1].len { | ||
33 | sorted[i], sorted[i+1] = sorted[i+1], sorted[i] | ||
34 | continue | ||
35 | } | ||
36 | break | ||
37 | } | ||
38 | } | ||
39 | |||
40 | // Create mask array including 'rounds' (of processing blocks of 64 bytes) between masks | ||
41 | m, round := uint64(0xff), uint64(0) | ||
42 | |||
43 | for _, s := range sorted[:] { | ||
44 | if s.len > 0 { | ||
45 | if uint64(s.len)>>6 > round { | ||
46 | mr[rounds] = maskRounds{m, (uint64(s.len) >> 6) - round} | ||
47 | rounds++ | ||
48 | } | ||
49 | round = uint64(s.len) >> 6 | ||
50 | } | ||
51 | m = m & ^(1 << uint(s.pos)) | ||
52 | } | ||
53 | return | ||
54 | } | ||
55 | |||
56 | func generateMaskAndRounds16(input [16][]byte, mr *[16]maskRounds) (rounds int) { | ||
57 | // Sort on blocks length small to large | ||
58 | var sorted [16]lane | ||
59 | for c, inpt := range input[:] { | ||
60 | sorted[c] = lane{uint(len(inpt)), uint(c)} | ||
61 | for i := c - 1; i >= 0; i-- { | ||
62 | // swap so largest is at the end... | ||
63 | if sorted[i].len > sorted[i+1].len { | ||
64 | sorted[i], sorted[i+1] = sorted[i+1], sorted[i] | ||
65 | continue | ||
66 | } | ||
67 | break | ||
68 | } | ||
69 | } | ||
70 | |||
71 | // Create mask array including 'rounds' (of processing blocks of 64 bytes) between masks | ||
72 | m, round := uint64(0xffff), uint64(0) | ||
73 | |||
74 | for _, s := range sorted[:] { | ||
75 | if s.len > 0 { | ||
76 | if uint64(s.len)>>6 > round { | ||
77 | mr[rounds] = maskRounds{m, (uint64(s.len) >> 6) - round} | ||
78 | rounds++ | ||
79 | } | ||
80 | round = uint64(s.len) >> 6 | ||
81 | } | ||
82 | m = m & ^(1 << uint(s.pos)) | ||
83 | } | ||
84 | return | ||
85 | } | ||