Started migration to sub-packages
This commit is contained in:
parent
51a6001bb9
commit
b461343171
6 changed files with 69 additions and 29 deletions
|
|
@ -3,6 +3,7 @@ package main
|
|||
import (
|
||||
"crypto/hmac"
|
||||
"crypto/rand"
|
||||
"git.zx2c4.com/wireguard-go/internal/xchacha20poly1305"
|
||||
"golang.org/x/crypto/blake2s"
|
||||
"golang.org/x/crypto/chacha20poly1305"
|
||||
"sync"
|
||||
|
|
@ -154,7 +155,7 @@ func (st *CookieChecker) CreateReply(
|
|||
return nil, err
|
||||
}
|
||||
|
||||
XChaCha20Poly1305Encrypt(
|
||||
xchacha20poly1305.Encrypt(
|
||||
reply.Cookie[:0],
|
||||
&reply.Nonce,
|
||||
cookie[:],
|
||||
|
|
@ -198,7 +199,7 @@ func (st *CookieGenerator) ConsumeReply(msg *MessageCookieReply) bool {
|
|||
|
||||
var cookie [blake2s.Size128]byte
|
||||
|
||||
_, err := XChaCha20Poly1305Decrypt(
|
||||
_, err := xchacha20poly1305.Decrypt(
|
||||
cookie[:0],
|
||||
&msg.Nonce,
|
||||
msg.Cookie[:],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue