twofishgcm

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL