mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-04-06 06:37:36 +03:00
Deps update
This commit is contained in:
parent
dd878d4c60
commit
e8b183e576
12 changed files with 188 additions and 145 deletions
15
vendor/github.com/aead/chacha20/.travis.yml
generated
vendored
15
vendor/github.com/aead/chacha20/.travis.yml
generated
vendored
|
@ -1,23 +1,22 @@
|
|||
language: go
|
||||
|
||||
go:
|
||||
- "1.8.7"
|
||||
- "1.9.4"
|
||||
- "1.10"
|
||||
- "1.8.x"
|
||||
- "1.9.x"
|
||||
- "1.10.x"
|
||||
|
||||
env:
|
||||
- ARCH=x86_64
|
||||
- ARCH=i686
|
||||
- TRAVIS_GOARCH=amd64
|
||||
- TRAVIS_GOARCH=386
|
||||
|
||||
before_install:
|
||||
- export GOARCH=$TRAVIS_GOARCH
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
before_script:
|
||||
- go get -u github.com/klauspost/asmfmt/cmd/asmfmt
|
||||
|
||||
script:
|
||||
- diff -au <(gofmt -d .) <(printf "")
|
||||
- diff -au <(asmfmt -d .) <(printf "")
|
||||
- go test -v ./...
|
||||
|
|
182
vendor/github.com/aead/chacha20/chacha/chacha_amd64.s
generated
vendored
182
vendor/github.com/aead/chacha20/chacha/chacha_amd64.s
generated
vendored
|
@ -667,7 +667,7 @@ CHACHA_LOOP_192:
|
|||
ADDQ $64, Src
|
||||
SUBQ $64, Len
|
||||
JZ DONE
|
||||
CMPQ Len, $64 // If Len <= 64 -> gen. only 64 byte keystream.
|
||||
CMPQ Len, $64 // If Len <= 64 -> gen. only 64 byte keystream.
|
||||
JBE GENERATE_KEYSTREAM_64
|
||||
|
||||
GENERATE_KEYSTREAM_128:
|
||||
|
@ -793,13 +793,13 @@ TEXT ·xorKeyStreamAVX(SB), 4, $144-80
|
|||
VMOVDQU ·one<>(SB), X4
|
||||
VMOVDQU ·rol16<>(SB), X5
|
||||
VMOVDQU ·rol8<>(SB), X6
|
||||
VMOVDQA X0, 0*16(Stack)
|
||||
VMOVDQA X1, 1*16(Stack)
|
||||
VMOVDQA X2, 2*16(Stack)
|
||||
VMOVDQA X3, 3*16(Stack)
|
||||
VMOVDQA X4, 4*16(Stack)
|
||||
VMOVDQA X5, 6*16(Stack)
|
||||
VMOVDQA X6, 7*16(Stack)
|
||||
VMOVDQA X0, 0*16(Stack)
|
||||
VMOVDQA X1, 1*16(Stack)
|
||||
VMOVDQA X2, 2*16(Stack)
|
||||
VMOVDQA X3, 3*16(Stack)
|
||||
VMOVDQA X4, 4*16(Stack)
|
||||
VMOVDQA X5, 6*16(Stack)
|
||||
VMOVDQA X6, 7*16(Stack)
|
||||
|
||||
CMPQ Len, $64
|
||||
JBE GENERATE_KEYSTREAM_64
|
||||
|
@ -809,22 +809,22 @@ TEXT ·xorKeyStreamAVX(SB), 4, $144-80
|
|||
JBE GENERATE_KEYSTREAM_192
|
||||
|
||||
GENERATE_KEYSTREAM_256:
|
||||
VMOVDQA X0, X12
|
||||
VMOVDQA X1, X13
|
||||
VMOVDQA X2, X14
|
||||
VMOVDQA X3, X15
|
||||
VPADDQ 4*16(Stack), X15, X15
|
||||
VMOVDQA X0, X8
|
||||
VMOVDQA X1, X9
|
||||
VMOVDQA X2, X10
|
||||
VMOVDQA X15, X11
|
||||
VPADDQ 4*16(Stack), X11, X11
|
||||
VMOVDQA X0, X4
|
||||
VMOVDQA X1, X5
|
||||
VMOVDQA X2, X6
|
||||
VMOVDQA X11, X7
|
||||
VPADDQ 4*16(Stack), X7, X7
|
||||
MOVQ Rounds, Tmp0
|
||||
VMOVDQA X0, X12
|
||||
VMOVDQA X1, X13
|
||||
VMOVDQA X2, X14
|
||||
VMOVDQA X3, X15
|
||||
VPADDQ 4*16(Stack), X15, X15
|
||||
VMOVDQA X0, X8
|
||||
VMOVDQA X1, X9
|
||||
VMOVDQA X2, X10
|
||||
VMOVDQA X15, X11
|
||||
VPADDQ 4*16(Stack), X11, X11
|
||||
VMOVDQA X0, X4
|
||||
VMOVDQA X1, X5
|
||||
VMOVDQA X2, X6
|
||||
VMOVDQA X11, X7
|
||||
VPADDQ 4*16(Stack), X7, X7
|
||||
MOVQ Rounds, Tmp0
|
||||
|
||||
VMOVDQA X3, 3*16(Stack) // Save X3
|
||||
|
||||
|
@ -853,22 +853,22 @@ CHACHA_LOOP_256:
|
|||
CHACHA_SHUFFLE_AVX(X15, X14, X13)
|
||||
CHACHA_SHUFFLE_AVX(X11, X10, X9)
|
||||
CHACHA_SHUFFLE_AVX(X7, X6, X5)
|
||||
SUBQ $2, Tmp0
|
||||
JNZ CHACHA_LOOP_256
|
||||
SUBQ $2, Tmp0
|
||||
JNZ CHACHA_LOOP_256
|
||||
|
||||
VPADDD 0*16(Stack), X0, X0
|
||||
VPADDD 1*16(Stack), X1, X1
|
||||
VPADDD 2*16(Stack), X2, X2
|
||||
VPADDD 3*16(Stack), X3, X3
|
||||
VMOVDQA X4, 5*16(Stack) // Save X4
|
||||
VPADDD 0*16(Stack), X0, X0
|
||||
VPADDD 1*16(Stack), X1, X1
|
||||
VPADDD 2*16(Stack), X2, X2
|
||||
VPADDD 3*16(Stack), X3, X3
|
||||
VMOVDQA X4, 5*16(Stack) // Save X4
|
||||
XOR_AVX(Dst, Src, 0, X0, X1, X2, X3, X4)
|
||||
VMOVDQA 5*16(Stack), X4 // Restore X4
|
||||
VMOVDQA 5*16(Stack), X4 // Restore X4
|
||||
|
||||
VMOVDQA 0*16(Stack), X0
|
||||
VMOVDQA 1*16(Stack), X1
|
||||
VMOVDQA 2*16(Stack), X2
|
||||
VMOVDQA 3*16(Stack), X3
|
||||
VPADDQ 4*16(Stack), X3, X3
|
||||
VMOVDQA 0*16(Stack), X0
|
||||
VMOVDQA 1*16(Stack), X1
|
||||
VMOVDQA 2*16(Stack), X2
|
||||
VMOVDQA 3*16(Stack), X3
|
||||
VPADDQ 4*16(Stack), X3, X3
|
||||
|
||||
VPADDD X0, X12, X12
|
||||
VPADDD X1, X13, X13
|
||||
|
@ -889,9 +889,9 @@ CHACHA_LOOP_256:
|
|||
XOR_AVX(Dst, Src, 64, X12, X13, X14, X15, X0)
|
||||
XOR_AVX(Dst, Src, 128, X8, X9, X10, X11, X0)
|
||||
VMOVDQA 0*16(Stack), X0 // Restore X0
|
||||
ADDQ $192, Dst
|
||||
ADDQ $192, Src
|
||||
SUBQ $192, Len
|
||||
ADDQ $192, Dst
|
||||
ADDQ $192, Src
|
||||
SUBQ $192, Len
|
||||
|
||||
CMPQ Len, $64
|
||||
JB BUFFER_KEYSTREAM
|
||||
|
@ -909,21 +909,21 @@ CHACHA_LOOP_256:
|
|||
JA GENERATE_KEYSTREAM_256
|
||||
|
||||
GENERATE_KEYSTREAM_192:
|
||||
VMOVDQA X0, X12
|
||||
VMOVDQA X1, X13
|
||||
VMOVDQA X2, X14
|
||||
VMOVDQA X3, X15
|
||||
VMOVDQA X0, X8
|
||||
VMOVDQA X1, X9
|
||||
VMOVDQA X2, X10
|
||||
VMOVDQA X3, X11
|
||||
VPADDQ 4*16(Stack), X11, X11
|
||||
VMOVDQA X0, X4
|
||||
VMOVDQA X1, X5
|
||||
VMOVDQA X2, X6
|
||||
VMOVDQA X11, X7
|
||||
VPADDQ 4*16(Stack), X7, X7
|
||||
MOVQ Rounds, Tmp0
|
||||
VMOVDQA X0, X12
|
||||
VMOVDQA X1, X13
|
||||
VMOVDQA X2, X14
|
||||
VMOVDQA X3, X15
|
||||
VMOVDQA X0, X8
|
||||
VMOVDQA X1, X9
|
||||
VMOVDQA X2, X10
|
||||
VMOVDQA X3, X11
|
||||
VPADDQ 4*16(Stack), X11, X11
|
||||
VMOVDQA X0, X4
|
||||
VMOVDQA X1, X5
|
||||
VMOVDQA X2, X6
|
||||
VMOVDQA X11, X7
|
||||
VPADDQ 4*16(Stack), X7, X7
|
||||
MOVQ Rounds, Tmp0
|
||||
|
||||
VMOVDQA 6*16(Stack), X1 // Load 16 bit rotate-left constant
|
||||
VMOVDQA 7*16(Stack), X2 // Load 8 bit rotate-left constant
|
||||
|
@ -944,31 +944,31 @@ CHACHA_LOOP_192:
|
|||
SUBQ $2, Tmp0
|
||||
JNZ CHACHA_LOOP_192
|
||||
|
||||
VMOVDQA 0*16(Stack), X0 // Restore X0
|
||||
VMOVDQA 1*16(Stack), X1 // Restore X1
|
||||
VMOVDQA 2*16(Stack), X2 // Restore X2
|
||||
VPADDD X0, X12, X12
|
||||
VPADDD X1, X13, X13
|
||||
VPADDD X2, X14, X14
|
||||
VPADDD X3, X15, X15
|
||||
VPADDQ 4*16(Stack), X3, X3
|
||||
VPADDD X0, X8, X8
|
||||
VPADDD X1, X9, X9
|
||||
VPADDD X2, X10, X10
|
||||
VPADDD X3, X11, X11
|
||||
VPADDQ 4*16(Stack), X3, X3
|
||||
VPADDD X0, X4, X4
|
||||
VPADDD X1, X5, X5
|
||||
VPADDD X2, X6, X6
|
||||
VPADDD X3, X7, X7
|
||||
VPADDQ 4*16(Stack), X3, X3
|
||||
VMOVDQA 0*16(Stack), X0 // Restore X0
|
||||
VMOVDQA 1*16(Stack), X1 // Restore X1
|
||||
VMOVDQA 2*16(Stack), X2 // Restore X2
|
||||
VPADDD X0, X12, X12
|
||||
VPADDD X1, X13, X13
|
||||
VPADDD X2, X14, X14
|
||||
VPADDD X3, X15, X15
|
||||
VPADDQ 4*16(Stack), X3, X3
|
||||
VPADDD X0, X8, X8
|
||||
VPADDD X1, X9, X9
|
||||
VPADDD X2, X10, X10
|
||||
VPADDD X3, X11, X11
|
||||
VPADDQ 4*16(Stack), X3, X3
|
||||
VPADDD X0, X4, X4
|
||||
VPADDD X1, X5, X5
|
||||
VPADDD X2, X6, X6
|
||||
VPADDD X3, X7, X7
|
||||
VPADDQ 4*16(Stack), X3, X3
|
||||
|
||||
XOR_AVX(Dst, Src, 0, X12, X13, X14, X15, X0)
|
||||
XOR_AVX(Dst, Src, 64, X8, X9, X10, X11, X0)
|
||||
VMOVDQA 0*16(Stack), X0 // Restore X0
|
||||
ADDQ $128, Dst
|
||||
ADDQ $128, Src
|
||||
SUBQ $128, Len
|
||||
ADDQ $128, Dst
|
||||
ADDQ $128, Src
|
||||
SUBQ $128, Len
|
||||
|
||||
CMPQ Len, $64
|
||||
JB BUFFER_KEYSTREAM
|
||||
|
@ -978,20 +978,20 @@ CHACHA_LOOP_192:
|
|||
ADDQ $64, Src
|
||||
SUBQ $64, Len
|
||||
JZ DONE
|
||||
CMPQ Len, $64 // If Len <= 64 -> gen. only 64 byte keystream.
|
||||
CMPQ Len, $64 // If Len <= 64 -> gen. only 64 byte keystream.
|
||||
JBE GENERATE_KEYSTREAM_64
|
||||
|
||||
GENERATE_KEYSTREAM_128:
|
||||
VMOVDQA X0, X8
|
||||
VMOVDQA X1, X9
|
||||
VMOVDQA X2, X10
|
||||
VMOVDQA X3, X11
|
||||
VMOVDQA X0, X4
|
||||
VMOVDQA X1, X5
|
||||
VMOVDQA X2, X6
|
||||
VMOVDQA X3, X7
|
||||
VPADDQ 4*16(Stack), X7, X7
|
||||
MOVQ Rounds, Tmp0
|
||||
VMOVDQA X0, X8
|
||||
VMOVDQA X1, X9
|
||||
VMOVDQA X2, X10
|
||||
VMOVDQA X3, X11
|
||||
VMOVDQA X0, X4
|
||||
VMOVDQA X1, X5
|
||||
VMOVDQA X2, X6
|
||||
VMOVDQA X3, X7
|
||||
VPADDQ 4*16(Stack), X7, X7
|
||||
MOVQ Rounds, Tmp0
|
||||
|
||||
VMOVDQA 6*16(Stack), X13 // Load 16 bit rotate-left constant
|
||||
VMOVDQA 7*16(Stack), X14 // Load 8 bit rotate-left constant
|
||||
|
@ -1038,7 +1038,7 @@ GENERATE_KEYSTREAM_64:
|
|||
VMOVDQA X1, X5
|
||||
VMOVDQA X2, X6
|
||||
VMOVDQA X3, X7
|
||||
MOVQ Rounds, Tmp0
|
||||
MOVQ Rounds, Tmp0
|
||||
|
||||
VMOVDQA 6*16(Stack), X9 // Load 16 bit rotate-left constant
|
||||
VMOVDQA 7*16(Stack), X10 // Load 8 bit rotate-left constant
|
||||
|
@ -1071,14 +1071,14 @@ BUFFER_KEYSTREAM:
|
|||
VMOVDQU X5, 1*16(Buffer)
|
||||
VMOVDQU X6, 2*16(Buffer)
|
||||
VMOVDQU X7, 3*16(Buffer)
|
||||
MOVQ Len, Tmp0
|
||||
MOVQ Len, Tmp0
|
||||
FINALIZE(Dst, Src, Buffer, Tmp0, Tmp1, Tmp2)
|
||||
|
||||
DONE:
|
||||
MOVQ SavedSP, Stack // Restore stack pointer
|
||||
MOVQ SavedSP, Stack // Restore stack pointer
|
||||
VMOVDQU X3, 3*16(State)
|
||||
VZEROUPPER
|
||||
MOVQ Len, ret+72(FP)
|
||||
MOVQ Len, ret+72(FP)
|
||||
RET
|
||||
|
||||
#undef Dst
|
||||
|
|
4
vendor/github.com/aead/chacha20/chacha/chacha_test.go
generated
vendored
4
vendor/github.com/aead/chacha20/chacha/chacha_test.go
generated
vendored
|
@ -34,7 +34,7 @@ func TestHChaCha20(t *testing.T) {
|
|||
}
|
||||
if useAVX {
|
||||
t.Log("AVX version")
|
||||
testIncremental(t, 5, 2049)
|
||||
testHChaCha20(t)
|
||||
useAVX = false
|
||||
}
|
||||
if useSSSE3 {
|
||||
|
@ -63,7 +63,7 @@ func TestVectors(t *testing.T) {
|
|||
}
|
||||
if useAVX {
|
||||
t.Log("AVX version")
|
||||
testIncremental(t, 5, 2049)
|
||||
testVectors(t)
|
||||
useAVX = false
|
||||
}
|
||||
if useSSSE3 {
|
||||
|
|
2
vendor/github.com/aead/chacha20/chacha/const.s
generated
vendored
2
vendor/github.com/aead/chacha20/chacha/const.s
generated
vendored
|
@ -38,7 +38,7 @@ DATA ·two_AVX2<>+0x00(SB)/8, $2
|
|||
DATA ·two_AVX2<>+0x08(SB)/8, $0
|
||||
DATA ·two_AVX2<>+0x10(SB)/8, $2
|
||||
DATA ·two_AVX2<>+0x18(SB)/8, $0
|
||||
GLOBL ·two_AVX2<>(SB), (NOPTR+RODATA), $32
|
||||
GLOBL ·two_AVX2<>(SB), (NOPTR+RODATA), $32
|
||||
|
||||
DATA ·rol16_AVX2<>+0x00(SB)/8, $0x0504070601000302
|
||||
DATA ·rol16_AVX2<>+0x08(SB)/8, $0x0D0C0F0E09080B0A
|
||||
|
|
54
vendor/github.com/aead/chacha20/chacha/macro.s
generated
vendored
54
vendor/github.com/aead/chacha20/chacha/macro.s
generated
vendored
|
@ -5,7 +5,7 @@
|
|||
// +build 386,!gccgo,!appengine,!nacl amd64,!gccgo,!appengine,!nacl
|
||||
|
||||
// ROTL_SSE rotates all 4 32 bit values of the XMM register v
|
||||
// left by n bits using SSE2 instructions (0 <= n <= 32).
|
||||
// left by n bits using SSE2 instructions (0 <= n <= 32).
|
||||
// The XMM register t is used as a temp. register.
|
||||
#define ROTL_SSE(n, t, v) \
|
||||
MOVO v, t; \
|
||||
|
@ -14,7 +14,7 @@
|
|||
PXOR t, v
|
||||
|
||||
// ROTL_AVX rotates all 4/8 32 bit values of the AVX/AVX2 register v
|
||||
// left by n bits using AVX/AVX2 instructions (0 <= n <= 32).
|
||||
// left by n bits using AVX/AVX2 instructions (0 <= n <= 32).
|
||||
// The AVX/AVX2 register t is used as a temp. register.
|
||||
#define ROTL_AVX(n, t, v) \
|
||||
VPSLLD $n, v, t; \
|
||||
|
@ -25,41 +25,41 @@
|
|||
// 4 XMM registers v0, v1, v2 and v3. It uses only ROTL_SSE2 for
|
||||
// rotations. The XMM register t is used as a temp. register.
|
||||
#define CHACHA_QROUND_SSE2(v0, v1, v2, v3, t) \
|
||||
PADDL v1, v0; \
|
||||
PXOR v0, v3; \
|
||||
PADDL v1, v0; \
|
||||
PXOR v0, v3; \
|
||||
ROTL_SSE(16, t, v3); \
|
||||
PADDL v3, v2; \
|
||||
PXOR v2, v1; \
|
||||
PADDL v3, v2; \
|
||||
PXOR v2, v1; \
|
||||
ROTL_SSE(12, t, v1); \
|
||||
PADDL v1, v0; \
|
||||
PXOR v0, v3; \
|
||||
PADDL v1, v0; \
|
||||
PXOR v0, v3; \
|
||||
ROTL_SSE(8, t, v3); \
|
||||
PADDL v3, v2; \
|
||||
PXOR v2, v1; \
|
||||
PADDL v3, v2; \
|
||||
PXOR v2, v1; \
|
||||
ROTL_SSE(7, t, v1)
|
||||
|
||||
// CHACHA_QROUND_SSSE3 performs a ChaCha quarter-round using the
|
||||
// 4 XMM registers v0, v1, v2 and v3. It uses PSHUFB for 8/16 bit
|
||||
// 4 XMM registers v0, v1, v2 and v3. It uses PSHUFB for 8/16 bit
|
||||
// rotations. The XMM register t is used as a temp. register.
|
||||
//
|
||||
// r16 holds the PSHUFB constant for a 16 bit left rotate.
|
||||
// r8 holds the PSHUFB constant for a 8 bit left rotate.
|
||||
#define CHACHA_QROUND_SSSE3(v0, v1, v2, v3, t, r16, r8) \
|
||||
PADDL v1, v0; \
|
||||
PXOR v0, v3; \
|
||||
PSHUFB r16, v3; \
|
||||
PADDL v3, v2; \
|
||||
PXOR v2, v1; \
|
||||
PADDL v1, v0; \
|
||||
PXOR v0, v3; \
|
||||
PSHUFB r16, v3; \
|
||||
PADDL v3, v2; \
|
||||
PXOR v2, v1; \
|
||||
ROTL_SSE(12, t, v1); \
|
||||
PADDL v1, v0; \
|
||||
PXOR v0, v3; \
|
||||
PSHUFB r8, v3; \
|
||||
PADDL v3, v2; \
|
||||
PXOR v2, v1; \
|
||||
PADDL v1, v0; \
|
||||
PXOR v0, v3; \
|
||||
PSHUFB r8, v3; \
|
||||
PADDL v3, v2; \
|
||||
PXOR v2, v1; \
|
||||
ROTL_SSE(7, t, v1)
|
||||
|
||||
// CHACHA_QROUND_AVX performs a ChaCha quarter-round using the
|
||||
// 4 AVX/AVX2 registers v0, v1, v2 and v3. It uses VPSHUFB for 8/16 bit
|
||||
// 4 AVX/AVX2 registers v0, v1, v2 and v3. It uses VPSHUFB for 8/16 bit
|
||||
// rotations. The AVX/AVX2 register t is used as a temp. register.
|
||||
//
|
||||
// r16 holds the VPSHUFB constant for a 16 bit left rotate.
|
||||
|
@ -70,7 +70,7 @@
|
|||
VPSHUFB r16, v3, v3; \
|
||||
VPADDD v2, v3, v2; \
|
||||
VPXOR v1, v2, v1; \
|
||||
ROTL_AVX(12, t, v1); \
|
||||
ROTL_AVX(12, t, v1); \
|
||||
VPADDD v0, v1, v0; \
|
||||
VPXOR v3, v0, v3; \
|
||||
VPSHUFB r8, v3, v3; \
|
||||
|
@ -94,8 +94,8 @@
|
|||
VPSHUFD $0x4E, v2, v2; \
|
||||
VPSHUFD $0x93, v3, v3
|
||||
|
||||
// XOR_SSE extracts 4x16 byte vectors from src at
|
||||
// off, xors all vectors with the corresponding XMM
|
||||
// XOR_SSE extracts 4x16 byte vectors from src at
|
||||
// off, xors all vectors with the corresponding XMM
|
||||
// register (v0 - v3) and writes the result to dst
|
||||
// at off.
|
||||
// The XMM register t is used as a temp. register.
|
||||
|
@ -113,8 +113,8 @@
|
|||
PXOR v3, t; \
|
||||
MOVOU t, 48+off(dst)
|
||||
|
||||
// XOR_AVX extracts 4x16 byte vectors from src at
|
||||
// off, xors all vectors with the corresponding AVX
|
||||
// XOR_AVX extracts 4x16 byte vectors from src at
|
||||
// off, xors all vectors with the corresponding AVX
|
||||
// register (v0 - v3) and writes the result to dst
|
||||
// at off.
|
||||
// The XMM register t is used as a temp. register.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue