1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-26 20:15:26 -05:00
This commit is contained in:
Darien Raymond
2017-07-25 22:21:59 +02:00
parent ef59f67961
commit 21284fbd61
3 changed files with 52 additions and 52 deletions

View File

@@ -41,23 +41,23 @@ type FnvAuthenticator struct {
}
// NonceSize implements AEAD.NonceSize().
func (v *FnvAuthenticator) NonceSize() int {
func (*FnvAuthenticator) NonceSize() int {
return 0
}
// Overhead impelements AEAD.Overhead().
func (v *FnvAuthenticator) Overhead() int {
func (*FnvAuthenticator) Overhead() int {
return 4
}
// Seal implements AEAD.Seal().
func (v *FnvAuthenticator) Seal(dst, nonce, plaintext, additionalData []byte) []byte {
func (*FnvAuthenticator) Seal(dst, nonce, plaintext, additionalData []byte) []byte {
dst = serial.Uint32ToBytes(Authenticate(plaintext), dst)
return append(dst, plaintext...)
}
// Open implements AEAD.Open().
func (v *FnvAuthenticator) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) {
func (*FnvAuthenticator) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) {
if serial.BytesToUint32(ciphertext[:4]) != Authenticate(ciphertext[4:]) {
return dst, newError("invalid authentication")
}
@@ -87,7 +87,7 @@ func NewShakeSizeParser(nonce []byte) *ShakeSizeParser {
}
}
func (s *ShakeSizeParser) SizeBytes() int {
func (*ShakeSizeParser) SizeBytes() int {
return 2
}