Documentation ¶
Index ¶
- type BlockCrypt
- func NewAESBlockCrypt(key []byte) (BlockCrypt, error)
- func NewNoneBlockCrypt(key []byte) (BlockCrypt, error)
- func NewSM4BlockCrypt(key []byte) (BlockCrypt, error)
- func NewSalsa20BlockCrypt(key []byte) (BlockCrypt, error)
- func NewSimpleXORBlockCrypt(key []byte) (BlockCrypt, error)
- func NewTripleDESBlockCrypt(key []byte) (BlockCrypt, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockCrypt ¶
type BlockCrypt interface { // Encrypt encrypts the whole block in src into dst. // Dst and src may point at the same memory. Encrypt(dst, src []byte) // Decrypt decrypts the whole block in src into dst. // Dst and src may point at the same memory. Decrypt(dst, src []byte) }
BlockCrypt defines encryption/decryption methods for a given byte slice. Notes on implementing: the data to be encrypted contains a builtin nonce at the first 16 bytes
func NewAESBlockCrypt ¶
func NewAESBlockCrypt(key []byte) (BlockCrypt, error)
NewAESBlockCrypt https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
func NewNoneBlockCrypt ¶
func NewNoneBlockCrypt(key []byte) (BlockCrypt, error)
NewNoneBlockCrypt does nothing but copying
func NewSM4BlockCrypt ¶
func NewSM4BlockCrypt(key []byte) (BlockCrypt, error)
NewSM4BlockCrypt https://github.com/tjfoc/gmsm/tree/master/sm4
func NewSalsa20BlockCrypt ¶
func NewSalsa20BlockCrypt(key []byte) (BlockCrypt, error)
NewSalsa20BlockCrypt https://en.wikipedia.org/wiki/Salsa20
func NewSimpleXORBlockCrypt ¶
func NewSimpleXORBlockCrypt(key []byte) (BlockCrypt, error)
NewSimpleXORBlockCrypt simple xor with key expanding
func NewTripleDESBlockCrypt ¶
func NewTripleDESBlockCrypt(key []byte) (BlockCrypt, error)
NewTripleDESBlockCrypt https://en.wikipedia.org/wiki/Triple_DES
Click to show internal directories.
Click to hide internal directories.