OSDN Git Service

add package
[bytom/vapor.git] / vendor / github.com / minio / blake2b-simd / compress_amd64.go
1 /*
2  * Minio Cloud Storage, (C) 2016 Minio, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package blake2b
18
19 func compress(d *digest, p []uint8) {
20         // Verifies if AVX2 or AVX is available, use optimized code path.
21         if avx2 {
22                 compressAVX2(d, p)
23         } else if avx {
24                 compressAVX(d, p)
25         } else if ssse3 {
26                 compressSSE(d, p)
27         } else {
28                 compressGeneric(d, p)
29         }
30 }