mirror of
https://github.com/logos-messaging/noise.git
synced 2026-01-07 16:43:05 +00:00
Hide cipher functions from docs
Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
This commit is contained in:
parent
9d237a2bfc
commit
f63da97e27
@ -136,8 +136,9 @@ func (c cipherFn) Cipher(k [32]byte) Cipher { return c.fn(k) }
|
|||||||
func (c cipherFn) CipherName() string { return c.name }
|
func (c cipherFn) CipherName() string { return c.name }
|
||||||
|
|
||||||
// CipherAESGCM is the AES256-GCM AEAD cipher.
|
// CipherAESGCM is the AES256-GCM AEAD cipher.
|
||||||
var CipherAESGCM CipherFunc = cipherFn{
|
var CipherAESGCM CipherFunc = cipherFn{cipherAESGCM, "AESGCM"}
|
||||||
func(k [32]byte) Cipher {
|
|
||||||
|
func cipherAESGCM(k [32]byte) Cipher {
|
||||||
c, err := aes.NewCipher(k[:])
|
c, err := aes.NewCipher(k[:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@ -154,13 +155,12 @@ var CipherAESGCM CipherFunc = cipherFn{
|
|||||||
return nonce[:]
|
return nonce[:]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"AESGCM",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CipherChaChaPoly is the ChaCha20-Poly1305 AEAD cipher construction.
|
// CipherChaChaPoly is the ChaCha20-Poly1305 AEAD cipher construction.
|
||||||
var CipherChaChaPoly CipherFunc = cipherFn{
|
var CipherChaChaPoly CipherFunc = cipherFn{cipherChaChaPoly, "ChaChaPoly"}
|
||||||
func(k [32]byte) Cipher {
|
|
||||||
|
func cipherChaChaPoly(k [32]byte) Cipher {
|
||||||
return aeadCipher{
|
return aeadCipher{
|
||||||
chap.NewCipher(&k),
|
chap.NewCipher(&k),
|
||||||
func(n uint64) []byte {
|
func(n uint64) []byte {
|
||||||
@ -169,8 +169,6 @@ var CipherChaChaPoly CipherFunc = cipherFn{
|
|||||||
return nonce[:]
|
return nonce[:]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"ChaChaPoly",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type aeadCipher struct {
|
type aeadCipher struct {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user