mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-04-04 21:57:44 +03:00
Update deps
This commit is contained in:
parent
d7454b38b9
commit
8d20cd7550
19 changed files with 262 additions and 216 deletions
36
vendor/github.com/aead/chacha20/chacha/chacha_386.go
generated
vendored
36
vendor/github.com/aead/chacha20/chacha/chacha_386.go
generated
vendored
|
@ -6,11 +6,15 @@
|
|||
|
||||
package chacha
|
||||
|
||||
import "encoding/binary"
|
||||
import (
|
||||
"encoding/binary"
|
||||
|
||||
"golang.org/x/sys/cpu"
|
||||
)
|
||||
|
||||
func init() {
|
||||
useSSE2 = supportsSSE2()
|
||||
useSSSE3 = supportsSSSE3()
|
||||
useSSE2 = cpu.X86.HasSSE2
|
||||
useSSSE3 = cpu.X86.HasSSSE3
|
||||
useAVX = false
|
||||
useAVX2 = false
|
||||
}
|
||||
|
@ -24,14 +28,6 @@ func initialize(state *[64]byte, key []byte, nonce *[16]byte) {
|
|||
copy(state[48:], nonce[:])
|
||||
}
|
||||
|
||||
// This function is implemented in chacha_386.s
|
||||
//go:noescape
|
||||
func supportsSSE2() bool
|
||||
|
||||
// This function is implemented in chacha_386.s
|
||||
//go:noescape
|
||||
func supportsSSSE3() bool
|
||||
|
||||
// This function is implemented in chacha_386.s
|
||||
//go:noescape
|
||||
func hChaCha20SSE2(out *[32]byte, nonce *[16]byte, key *[32]byte)
|
||||
|
@ -44,25 +40,21 @@ func hChaCha20SSSE3(out *[32]byte, nonce *[16]byte, key *[32]byte)
|
|||
//go:noescape
|
||||
func xorKeyStreamSSE2(dst, src []byte, block, state *[64]byte, rounds int) int
|
||||
|
||||
// This function is implemented in chacha_386.s
|
||||
//go:noescape
|
||||
func xorKeyStreamSSSE3(dst, src []byte, block, state *[64]byte, rounds int) int
|
||||
|
||||
func hChaCha20(out *[32]byte, nonce *[16]byte, key *[32]byte) {
|
||||
if useSSSE3 {
|
||||
switch {
|
||||
case useSSSE3:
|
||||
hChaCha20SSSE3(out, nonce, key)
|
||||
} else if useSSE2 {
|
||||
case useSSE2:
|
||||
hChaCha20SSE2(out, nonce, key)
|
||||
} else {
|
||||
default:
|
||||
hChaCha20Generic(out, nonce, key)
|
||||
}
|
||||
}
|
||||
|
||||
func xorKeyStream(dst, src []byte, block, state *[64]byte, rounds int) int {
|
||||
if useSSSE3 {
|
||||
return xorKeyStreamSSSE3(dst, src, block, state, rounds)
|
||||
} else if useSSE2 {
|
||||
if useSSE2 {
|
||||
return xorKeyStreamSSE2(dst, src, block, state, rounds)
|
||||
default:
|
||||
return xorKeyStreamGeneric(dst, src, block, state, rounds)
|
||||
}
|
||||
return xorKeyStreamGeneric(dst, src, block, state, rounds)
|
||||
}
|
||||
|
|
134
vendor/github.com/aead/chacha20/chacha/chacha_386.s
generated
vendored
134
vendor/github.com/aead/chacha20/chacha/chacha_386.s
generated
vendored
|
@ -24,27 +24,6 @@
|
|||
DECL len; \
|
||||
JG FINALIZE_LOOP \
|
||||
|
||||
// func supportsSSE2() bool
|
||||
TEXT ·supportsSSE2(SB), NOSPLIT, $0-1
|
||||
XORL AX, AX
|
||||
INCL AX
|
||||
CPUID
|
||||
SHRL $26, DX
|
||||
ANDL $1, DX
|
||||
MOVB DX, ret+0(FP)
|
||||
RET
|
||||
|
||||
// func supportsSSSE3() bool
|
||||
TEXT ·supportsSSSE3(SB), NOSPLIT, $0-1
|
||||
XORL AX, AX
|
||||
INCL AX
|
||||
CPUID
|
||||
SHRL $9, CX
|
||||
ANDL $1, CX
|
||||
MOVB CX, DX
|
||||
MOVB DX, ret+0(FP)
|
||||
RET
|
||||
|
||||
#define Dst DI
|
||||
#define Nonce AX
|
||||
#define Key BX
|
||||
|
@ -109,8 +88,7 @@ chacha_loop:
|
|||
#define State AX
|
||||
#define Dst DI
|
||||
#define Src SI
|
||||
#define Len CX
|
||||
#define Rounds DX
|
||||
#define Len DX
|
||||
#define Tmp0 BX
|
||||
#define Tmp1 BP
|
||||
|
||||
|
@ -119,8 +97,8 @@ TEXT ·xorKeyStreamSSE2(SB), 4, $0-40
|
|||
MOVL dst_base+0(FP), Dst
|
||||
MOVL src_base+12(FP), Src
|
||||
MOVL state+28(FP), State
|
||||
MOVL rounds+32(FP), Rounds
|
||||
MOVL src_len+16(FP), Len
|
||||
MOVL $0, ret+36(FP) // Number of bytes written to the keystream buffer - 0 iff len mod 64 == 0
|
||||
|
||||
MOVOU 0*16(State), X0
|
||||
MOVOU 1*16(State), X1
|
||||
|
@ -134,7 +112,7 @@ GENERATE_KEYSTREAM:
|
|||
MOVO X1, X5
|
||||
MOVO X2, X6
|
||||
MOVO X3, X7
|
||||
MOVL Rounds, Tmp0
|
||||
MOVL rounds+32(FP), Tmp0
|
||||
|
||||
CHACHA_LOOP:
|
||||
CHACHA_QROUND_SSE2(X4, X5, X6, X7, X0)
|
||||
|
@ -164,17 +142,15 @@ CHACHA_LOOP:
|
|||
JMP GENERATE_KEYSTREAM // There is at least one more plaintext byte
|
||||
|
||||
BUFFER_KEYSTREAM:
|
||||
MOVL Len, Rounds // Use Rounds as tmp. register for Len - we don't need Rounds anymore
|
||||
MOVL block+24(FP), State
|
||||
MOVOU X4, 0(State)
|
||||
MOVOU X5, 16(State)
|
||||
MOVOU X6, 32(State)
|
||||
MOVOU X7, 48(State)
|
||||
FINALIZE(Dst, Src, State, Rounds, Tmp0, Tmp1)
|
||||
MOVL Len, ret+36(FP) // Number of bytes written to the keystream buffer - 0 < Len < 64
|
||||
FINALIZE(Dst, Src, State, Len, Tmp0, Tmp1)
|
||||
|
||||
DONE:
|
||||
MOVL Len, Tmp0 // Number of bytes written to the keystream buffer - 0 iff Len mod 64 == 0
|
||||
MOVL Tmp0, ret+36(FP)
|
||||
MOVL state+28(FP), State
|
||||
MOVOU X3, 3*16(State)
|
||||
RET
|
||||
|
@ -183,105 +159,5 @@ DONE:
|
|||
#undef Dst
|
||||
#undef Src
|
||||
#undef Len
|
||||
#undef Rounds
|
||||
#undef Tmp0
|
||||
#undef Tmp1
|
||||
|
||||
#define Dst DI
|
||||
#define Src SI
|
||||
#define Len CX
|
||||
#define Rounds DX
|
||||
#define State SP
|
||||
#define Stack State
|
||||
#define Tmp0 AX
|
||||
#define Tmp1 BX
|
||||
#define Tmp2 BP
|
||||
|
||||
// func xorKeyStreamSSSE3(dst, src []byte, block, state *[64]byte, rounds int) int
|
||||
TEXT ·xorKeyStreamSSSE3(SB), 4, $80-40
|
||||
MOVL dst_base+0(FP), Dst
|
||||
MOVL src_base+12(FP), Src
|
||||
MOVL state+28(FP), Tmp0
|
||||
MOVL rounds+32(FP), Rounds
|
||||
MOVL src_len+16(FP), Len
|
||||
|
||||
MOVL Stack, Tmp2 // save stack pointer
|
||||
ADDL $16, Stack // ensure 16 byte stack alignment
|
||||
ANDL $-16, Stack
|
||||
|
||||
MOVOU 0*16(Tmp0), X0
|
||||
MOVOU 1*16(Tmp0), X1
|
||||
MOVOU 2*16(Tmp0), X2
|
||||
MOVOU 3*16(Tmp0), X3
|
||||
|
||||
TESTL Len, Len
|
||||
JZ DONE
|
||||
|
||||
MOVOU ·one<>(SB), X4
|
||||
MOVO X0, 0*16(State)
|
||||
MOVO X1, 1*16(State)
|
||||
MOVO X2, 2*16(State)
|
||||
MOVO X4, 3*16(Stack) // store constant on stack
|
||||
|
||||
MOVOU ·rol16<>(SB), X1
|
||||
MOVOU ·rol8<>(SB), X2
|
||||
|
||||
GENERATE_KEYSTREAM:
|
||||
MOVO 0*16(State), X4
|
||||
MOVO 1*16(State), X5
|
||||
MOVO 2*16(State), X6
|
||||
MOVO X3, X7
|
||||
MOVL Rounds, Tmp0
|
||||
|
||||
CHACHA_LOOP:
|
||||
CHACHA_QROUND_SSSE3(X4, X5, X6, X7, X0, X1, X2)
|
||||
CHACHA_SHUFFLE_SSE(X5, X6, X7)
|
||||
CHACHA_QROUND_SSSE3(X4, X5, X6, X7, X0, X1, X2)
|
||||
CHACHA_SHUFFLE_SSE(X7, X6, X5)
|
||||
SUBL $2, Tmp0
|
||||
JA CHACHA_LOOP
|
||||
|
||||
PADDL 0*16(State), X4
|
||||
PADDL 1*16(State), X5
|
||||
PADDL 2*16(State), X6
|
||||
PADDL X3, X7
|
||||
PADDQ 3*16(Stack), X3
|
||||
|
||||
CMPL Len, $64
|
||||
JL BUFFER_KEYSTREAM
|
||||
|
||||
XOR_SSE(Dst, Src, 0, X4, X5, X6, X7, X0)
|
||||
ADDL $64, Src
|
||||
ADDL $64, Dst
|
||||
SUBL $64, Len
|
||||
JZ DONE
|
||||
JMP GENERATE_KEYSTREAM
|
||||
|
||||
BUFFER_KEYSTREAM:
|
||||
MOVL Tmp2, Stack // restore stack pointer
|
||||
MOVL Len, Tmp2
|
||||
MOVL block+24(FP), Tmp1
|
||||
MOVOU X4, 0*16(Tmp1)
|
||||
MOVOU X5, 1*16(Tmp1)
|
||||
MOVOU X6, 2*16(Tmp1)
|
||||
MOVOU X7, 3*16(Tmp1)
|
||||
FINALIZE(DI, SI, Tmp1, Tmp2, Tmp0, Rounds)// we don't need the number of rounds anymore
|
||||
MOVL Stack, Tmp2 // set BP to SP so that DONE resets SP correctly
|
||||
|
||||
DONE:
|
||||
MOVL Len, Tmp0
|
||||
MOVL Tmp0, ret+36(FP)
|
||||
MOVL Tmp2, Stack // restore stack pointer
|
||||
MOVL state+28(FP), Tmp0
|
||||
MOVOU X3, 3*16(Tmp0)
|
||||
RET
|
||||
|
||||
#undef Dst
|
||||
#undef Src
|
||||
#undef Len
|
||||
#undef Rounds
|
||||
#undef State
|
||||
#undef Stack
|
||||
#undef Tmp0
|
||||
#undef Tmp1
|
||||
#undef Tmp2
|
||||
|
|
43
vendor/github.com/aead/chacha20/chacha/chacha_amd64.go
generated
vendored
43
vendor/github.com/aead/chacha20/chacha/chacha_amd64.go
generated
vendored
|
@ -6,29 +6,19 @@
|
|||
|
||||
package chacha
|
||||
|
||||
import "golang.org/x/sys/cpu"
|
||||
|
||||
func init() {
|
||||
useSSE2 = true
|
||||
useSSSE3 = supportsSSSE3()
|
||||
useAVX = supportsAVX()
|
||||
useAVX2 = supportsAVX2() && false // disable until #16 is fixed
|
||||
useSSE2 = cpu.X86.HasSSE2
|
||||
useSSSE3 = cpu.X86.HasSSSE3
|
||||
useAVX = cpu.X86.HasAVX
|
||||
useAVX2 = cpu.X86.HasAVX2 && false // disable until #16 is fixed
|
||||
}
|
||||
|
||||
// This function is implemented in chacha_amd64.s
|
||||
//go:noescape
|
||||
func initialize(state *[64]byte, key []byte, nonce *[16]byte)
|
||||
|
||||
// This function is implemented in chacha_amd64.s
|
||||
//go:noescape
|
||||
func supportsSSSE3() bool
|
||||
|
||||
// This function is implemented in chacha_amd64.s
|
||||
//go:noescape
|
||||
func supportsAVX() bool
|
||||
|
||||
// This function is implemented in chacha_amd64.s
|
||||
//go:noescape
|
||||
func supportsAVX2() bool
|
||||
|
||||
// This function is implemented in chacha_amd64.s
|
||||
//go:noescape
|
||||
func hChaCha20SSE2(out *[32]byte, nonce *[16]byte, key *[32]byte)
|
||||
|
@ -58,26 +48,29 @@ func xorKeyStreamAVX(dst, src []byte, block, state *[64]byte, rounds int) int
|
|||
func xorKeyStreamAVX2(dst, src []byte, block, state *[64]byte, rounds int) int
|
||||
|
||||
func hChaCha20(out *[32]byte, nonce *[16]byte, key *[32]byte) {
|
||||
if useAVX {
|
||||
switch {
|
||||
case useAVX:
|
||||
hChaCha20AVX(out, nonce, key)
|
||||
} else if useSSSE3 {
|
||||
case useSSSE3:
|
||||
hChaCha20SSSE3(out, nonce, key)
|
||||
} else if useSSE2 { // on amd64 this is always true - necessary for testing generic on amd64
|
||||
case useSSE2:
|
||||
hChaCha20SSE2(out, nonce, key)
|
||||
} else {
|
||||
default:
|
||||
hChaCha20Generic(out, nonce, key)
|
||||
}
|
||||
}
|
||||
|
||||
func xorKeyStream(dst, src []byte, block, state *[64]byte, rounds int) int {
|
||||
if useAVX2 {
|
||||
switch {
|
||||
case useAVX2:
|
||||
return xorKeyStreamAVX2(dst, src, block, state, rounds)
|
||||
} else if useAVX {
|
||||
case useAVX:
|
||||
return xorKeyStreamAVX(dst, src, block, state, rounds)
|
||||
} else if useSSSE3 {
|
||||
case useSSSE3:
|
||||
return xorKeyStreamSSSE3(dst, src, block, state, rounds)
|
||||
} else if useSSE2 { // on amd64 this is always true - necessary for testing generic on amd64
|
||||
case useSSE2:
|
||||
return xorKeyStreamSSE2(dst, src, block, state, rounds)
|
||||
default:
|
||||
return xorKeyStreamGeneric(dst, src, block, state, rounds)
|
||||
}
|
||||
return xorKeyStreamGeneric(dst, src, block, state, rounds)
|
||||
}
|
||||
|
|
24
vendor/github.com/aead/chacha20/chacha/chacha_amd64.s
generated
vendored
24
vendor/github.com/aead/chacha20/chacha/chacha_amd64.s
generated
vendored
|
@ -24,28 +24,6 @@
|
|||
DECQ len; \
|
||||
JG FINALIZE_LOOP \
|
||||
|
||||
// func supportsSSSE3() bool
|
||||
TEXT ·supportsSSSE3(SB), NOSPLIT, $0-1
|
||||
XORQ AX, AX
|
||||
INCQ AX
|
||||
CPUID
|
||||
SHRQ $9, CX
|
||||
ANDQ $1, CX
|
||||
MOVB CX, ret+0(FP)
|
||||
RET
|
||||
|
||||
// func supportsAVX() bool
|
||||
TEXT ·supportsAVX(SB), 4, $0-1
|
||||
MOVQ runtime·support_avx(SB), AX
|
||||
MOVB AX, ret+0(FP)
|
||||
RET
|
||||
|
||||
// func supportsAVX2() bool
|
||||
TEXT ·supportsAVX2(SB), 4, $0-1
|
||||
MOVQ runtime·support_avx2(SB), AX
|
||||
MOVB AX, ret+0(FP)
|
||||
RET
|
||||
|
||||
#define Dst DI
|
||||
#define Nonce AX
|
||||
#define Key BX
|
||||
|
@ -152,7 +130,7 @@ chacha_loop:
|
|||
|
||||
#define Dst DI
|
||||
#define Src SI
|
||||
#define Len CX
|
||||
#define Len R12
|
||||
#define Rounds DX
|
||||
#define Buffer BX
|
||||
#define State AX
|
||||
|
|
2
vendor/github.com/jedisct1/dlog/Gopkg.lock
generated
vendored
2
vendor/github.com/jedisct1/dlog/Gopkg.lock
generated
vendored
|
@ -15,7 +15,7 @@
|
|||
"windows/registry",
|
||||
"windows/svc/eventlog"
|
||||
]
|
||||
revision = "378d26f46672a356c46195c28f61bdb4c0a781dd"
|
||||
revision = "78d5f264b493f125018180c204871ecf58a2dce1"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
|
|
9
vendor/github.com/kardianos/service/service_systemd_linux.go
generated
vendored
9
vendor/github.com/kardianos/service/service_systemd_linux.go
generated
vendored
|
@ -156,9 +156,6 @@ func (s *systemd) Restart() error {
|
|||
const systemdScript = `[Unit]
|
||||
Description={{.Description}}
|
||||
ConditionFileIsExecutable={{.Path|cmdEscape}}
|
||||
{{range .UnitAdd}}
|
||||
{{.Key}}={{.Value}}
|
||||
{{end}}
|
||||
|
||||
[Service]
|
||||
StartLimitInterval=5
|
||||
|
@ -172,13 +169,7 @@ ExecStart={{.Path|cmdEscape}}{{range .Arguments}} {{.|cmd}}{{end}}
|
|||
Restart=always
|
||||
RestartSec=120
|
||||
EnvironmentFile=-/etc/sysconfig/{{.Name}}
|
||||
{{range .ServiceAdd}}
|
||||
{{.Key}}={{.Value}}
|
||||
{{end}}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
{{range .InstallAdd}}
|
||||
{{.Key}}={{.Value}}
|
||||
{{end}}
|
||||
`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue