1
2
3
4
5
6
7 package aes
8
9
10
11
12 func ctrBlocks1Asm(nr int, xk *[60]uint32, dst, src *[BlockSize]byte, ivlo, ivhi uint64)
13
14
15 func ctrBlocks2Asm(nr int, xk *[60]uint32, dst, src *[2 * BlockSize]byte, ivlo, ivhi uint64)
16
17
18 func ctrBlocks4Asm(nr int, xk *[60]uint32, dst, src *[4 * BlockSize]byte, ivlo, ivhi uint64)
19
20
21 func ctrBlocks8Asm(nr int, xk *[60]uint32, dst, src *[8 * BlockSize]byte, ivlo, ivhi uint64)
22
23 func ctrBlocks1(b *Block, dst, src *[BlockSize]byte, ivlo, ivhi uint64) {
24 if !supportsAES {
25 ctrBlocks(b, dst[:], src[:], ivlo, ivhi)
26 } else {
27 ctrBlocks1Asm(b.rounds, &b.enc, dst, src, ivlo, ivhi)
28 }
29 }
30
31 func ctrBlocks2(b *Block, dst, src *[2 * BlockSize]byte, ivlo, ivhi uint64) {
32 if !supportsAES {
33 ctrBlocks(b, dst[:], src[:], ivlo, ivhi)
34 } else {
35 ctrBlocks2Asm(b.rounds, &b.enc, dst, src, ivlo, ivhi)
36 }
37 }
38
39 func ctrBlocks4(b *Block, dst, src *[4 * BlockSize]byte, ivlo, ivhi uint64) {
40 if !supportsAES {
41 ctrBlocks(b, dst[:], src[:], ivlo, ivhi)
42 } else {
43 ctrBlocks4Asm(b.rounds, &b.enc, dst, src, ivlo, ivhi)
44 }
45 }
46
47 func ctrBlocks8(b *Block, dst, src *[8 * BlockSize]byte, ivlo, ivhi uint64) {
48 if !supportsAES {
49 ctrBlocks(b, dst[:], src[:], ivlo, ivhi)
50 } else {
51 ctrBlocks8Asm(b.rounds, &b.enc, dst, src, ivlo, ivhi)
52 }
53 }
54
View as plain text