Documentation ¶
Index ¶
- Constants
- type GCMCipherKey
- func (gck *GCMCipherKey) CodeName() string
- func (gck *GCMCipherKey) Decrypt(cipherText []byte) ([]byte, error)
- func (gck *GCMCipherKey) DecryptInPlace(cipherText []byte) ([]byte, error)
- func (gck *GCMCipherKey) Encrypt(plainText []byte) ([]byte, error)
- func (gck *GCMCipherKey) Key() []byte
- func (gck *GCMCipherKey) Overhead() uint8
Constants ¶
const (
// GCMCipherKeyLength is the key length for GCMCipherKey
GCMCipherKeyLength = 32
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCMCipherKey ¶
type GCMCipherKey [GCMCipherKeyLength]byte
GCMCipherKey is the implementation of two fish-GCM algorithm, implementing crypto.CipherKey interface
func GenerateGCMCipherKey ¶
func GenerateGCMCipherKey() (*GCMCipherKey, error)
GenerateGCMCipherKey will generate a new GCMCipherKey with random seed
func NewGCMCipherKey ¶
func NewGCMCipherKey(seed []byte) (*GCMCipherKey, error)
NewGCMCipherKey returns a new GCMCipherKey using the input seed. The input key must be of exact size of GCMCipherKeyLength, which is 32
func (*GCMCipherKey) CodeName ¶
func (gck *GCMCipherKey) CodeName() string
CodeName return the GCMCipherCode specifying the key type
func (*GCMCipherKey) Decrypt ¶
func (gck *GCMCipherKey) Decrypt(cipherText []byte) ([]byte, error)
Decrypt decrypt the input cipherText using AES-GCM algorithm
func (*GCMCipherKey) DecryptInPlace ¶
func (gck *GCMCipherKey) DecryptInPlace(cipherText []byte) ([]byte, error)
DecryptInPlace make use of the input string and decrypt the cipherText in place
func (*GCMCipherKey) Encrypt ¶
func (gck *GCMCipherKey) Encrypt(plainText []byte) ([]byte, error)
Encrypt encrypt the input plainText using AES-GCM algorithm
func (*GCMCipherKey) Key ¶
func (gck *GCMCipherKey) Key() []byte
Key returns the encryption/decryption key for the GCMCipherKey
func (*GCMCipherKey) Overhead ¶
func (gck *GCMCipherKey) Overhead() uint8
Overhead returns the additional overhead used for nonce