Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxNonceSize = 12 ATypeIPv4 = 1 ATypeDomain = 3 ATypeIpv6 = 4 )
Variables ¶
View Source
var ( CiphersConf = map[string]CipherConf{ "chacha20-ietf-poly1305": {KeyLen: 32, SaltLen: 32, NonceLen: 12, TagLen: 16, NewCipher: chacha20poly1305.New, NewPartialCipher: NewPC20P1305}, "chacha20-poly1305": {KeyLen: 32, SaltLen: 32, NonceLen: 12, TagLen: 16, NewCipher: chacha20poly1305.New, NewPartialCipher: NewPC20P1305}, "aes-256-gcm": {KeyLen: 32, SaltLen: 32, NonceLen: 12, TagLen: 16, NewCipher: NewGcm, NewPartialCipher: NewPGcm}, "aes-128-gcm": {KeyLen: 16, SaltLen: 16, NonceLen: 12, TagLen: 16, NewCipher: NewGcm, NewPartialCipher: NewPGcm}, } ZeroNonce [MaxNonceSize]byte ReusedInfo = []byte("ss-subkey") )
Functions ¶
func EVPBytesToKey ¶
func NewPC20P1305 ¶ added in v0.1.3
func NewPC20P1305(key []byte) (smaead.PartialAEAD, error)
Types ¶
type CipherConf ¶
type CipherConf struct { KeyLen int SaltLen int NonceLen int TagLen int NewCipher func(key []byte) (cipher.AEAD, error) NewPartialCipher func(key []byte) (smaead.PartialAEAD, error) }
func (*CipherConf) UnsafeVerifyATyp ¶ added in v0.1.3
func (conf *CipherConf) UnsafeVerifyATyp(buf []byte, masterKey []byte, salt []byte, cipherText []byte, subKey *[]byte) bool
Warning: UnsafeVerifyATyp brings less than 25% performance improvement in most cases. It is dangerous and NOT recommended. Do not use it if you feel unnecessary.
Click to show internal directories.
Click to hide internal directories.