Debian Codegraph @

blake2/blake2b/constants.go

raw symbols SCIP
1 // Use of this source code is governed by a license
2 // that can be found in the LICENSE file.
3
4 package blake2b
5
6 const (
7 // The block flag for message blocks
8 MsgFlag uint64 = 0
9 // The block flag for the last block
10 FinalFlag uint64 = 0xffffffffffffffff
11 )
12
13 // the blake2b iv constants
14 var iv = [8]uint64{
15 0x6a09e667f3bcc908,
16 0xbb67ae8584caa73b,
17 0x3c6ef372fe94f82b,
18 0xa54ff53a5f1d36f1,
19 0x510e527fade682d1,
20 0x9b05688c2b3e6c1f,
21 0x1f83d9abfb41bd6b,
22 0x5be0cd19137e2179,
23 }
24
25 // the precomputed values for blake2b
26 // there are 12 16-byte arrays - one for each round
27 // the entries are calculated from the sigma constants.
28 var precomputed [12][16]byte = [12][16]byte{
29 {0, 2, 4, 6, 5, 7, 3, 1, 8, 10, 12, 14, 13, 15, 11, 9},
30 {14, 4, 9, 13, 15, 6, 8, 10, 1, 0, 11, 5, 7, 3, 2, 12},
31 {11, 12, 5, 15, 2, 13, 0, 8, 10, 3, 7, 9, 1, 4, 6, 14},
32 {7, 3, 13, 11, 12, 14, 1, 9, 2, 5, 4, 15, 0, 8, 10, 6},
33 {9, 5, 2, 10, 4, 15, 7, 0, 14, 11, 6, 3, 8, 13, 12, 1},
34 {2, 6, 0, 8, 11, 3, 10, 12, 4, 7, 15, 1, 14, 9, 5, 13},
35 {12, 1, 14, 4, 13, 10, 15, 5, 0, 6, 9, 8, 2, 11, 3, 7},
36 {13, 7, 12, 3, 1, 9, 14, 11, 5, 15, 8, 2, 6, 10, 4, 0},
37 {6, 14, 11, 0, 3, 8, 9, 15, 12, 13, 1, 10, 4, 5, 7, 2},
38 {10, 8, 7, 1, 6, 5, 4, 2, 15, 9, 3, 13, 12, 0, 14, 11},
39 {0, 2, 4, 6, 5, 7, 3, 1, 8, 10, 12, 14, 13, 15, 11, 9}, // equal to the first
40 {14, 4, 9, 13, 15, 6, 8, 10, 1, 0, 11, 5, 7, 3, 2, 12}, // equal to the secound
41 }