Documentation ¶
Index ¶
- Constants
- Variables
- func ReadFileContentAndHash(algo Algorithms, path string) ([]byte, error)
- func ReadFileContentAndHmac(algo Algorithms, path string) ([]byte, error)
- type Algorithms
- type Argon2ID
- type Blake2b256
- func (b *Blake2b256) GetEncoder() generic.Encoder
- func (b *Blake2b256) Hash(plaintext []byte) ([]byte, error)
- func (b *Blake2b256) Hmac(plaintext []byte) ([]byte, error)
- func (b *Blake2b256) SetEncoder(encoder generic.Encoder)
- func (b *Blake2b256) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (b *Blake2b256) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Blake2b384
- func (b *Blake2b384) GetEncoder() generic.Encoder
- func (b *Blake2b384) Hash(plaintext []byte) ([]byte, error)
- func (b *Blake2b384) Hmac(plaintext []byte) ([]byte, error)
- func (b *Blake2b384) SetEncoder(encoder generic.Encoder)
- func (b *Blake2b384) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (b *Blake2b384) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Blake2b512
- func (b *Blake2b512) GetEncoder() generic.Encoder
- func (b *Blake2b512) Hash(plaintext []byte) ([]byte, error)
- func (b *Blake2b512) Hmac(plaintext []byte) ([]byte, error)
- func (b *Blake2b512) SetEncoder(encoder generic.Encoder)
- func (b *Blake2b512) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (b *Blake2b512) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Blake2s128
- func (b *Blake2s128) GetEncoder() generic.Encoder
- func (b *Blake2s128) Hash(plaintext []byte) ([]byte, error)
- func (b *Blake2s128) Hmac(plaintext []byte) ([]byte, error)
- func (b *Blake2s128) SetEncoder(encoder generic.Encoder)
- func (b *Blake2s128) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (b *Blake2s128) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Blake2s256
- func (b *Blake2s256) GetEncoder() generic.Encoder
- func (b *Blake2s256) Hash(plaintext []byte) ([]byte, error)
- func (b *Blake2s256) Hmac(plaintext []byte) ([]byte, error)
- func (b *Blake2s256) SetEncoder(encoder generic.Encoder)
- func (b *Blake2s256) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (b *Blake2s256) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Hkdf
- type Kdf
- type Parameters
- type Sha2256
- func (s *Sha2256) GetEncoder() generic.Encoder
- func (s *Sha2256) Hash(plaintext []byte) ([]byte, error)
- func (s *Sha2256) Hmac(plaintext []byte) ([]byte, error)
- func (s *Sha2256) SetEncoder(encoder generic.Encoder)
- func (s *Sha2256) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (s *Sha2256) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Sha2384
- func (s *Sha2384) GetEncoder() generic.Encoder
- func (s *Sha2384) Hash(plaintext []byte) ([]byte, error)
- func (s *Sha2384) Hmac(plaintext []byte) ([]byte, error)
- func (s *Sha2384) SetEncoder(encoder generic.Encoder)
- func (s *Sha2384) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (s *Sha2384) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Sha2512
- func (s *Sha2512) GetEncoder() generic.Encoder
- func (s *Sha2512) Hash(plaintext []byte) ([]byte, error)
- func (s *Sha2512) Hmac(plaintext []byte) ([]byte, error)
- func (s *Sha2512) SetEncoder(encoder generic.Encoder)
- func (s *Sha2512) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (s *Sha2512) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Sha3224
- func (s *Sha3224) GetEncoder() generic.Encoder
- func (s *Sha3224) Hash(plaintext []byte) ([]byte, error)
- func (s *Sha3224) Hmac(plaintext []byte) ([]byte, error)
- func (s *Sha3224) SetEncoder(encoder generic.Encoder)
- func (s *Sha3224) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (s *Sha3224) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Sha3256
- func (s *Sha3256) GetEncoder() generic.Encoder
- func (s *Sha3256) Hash(plaintext []byte) ([]byte, error)
- func (s *Sha3256) Hmac(plaintext []byte) ([]byte, error)
- func (s *Sha3256) SetEncoder(encoder generic.Encoder)
- func (s *Sha3256) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (s *Sha3256) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Sha3384
- func (s *Sha3384) GetEncoder() generic.Encoder
- func (s *Sha3384) Hash(plaintext []byte) ([]byte, error)
- func (s *Sha3384) Hmac(plaintext []byte) ([]byte, error)
- func (s *Sha3384) SetEncoder(encoder generic.Encoder)
- func (s *Sha3384) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (s *Sha3384) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Sha3512
- func (s *Sha3512) GetEncoder() generic.Encoder
- func (s *Sha3512) Hash(plaintext []byte) ([]byte, error)
- func (s *Sha3512) Hmac(plaintext []byte) ([]byte, error)
- func (s *Sha3512) SetEncoder(encoder generic.Encoder)
- func (s *Sha3512) ValidateHash(plaintext, expectedHash []byte) (bool, error)
- func (s *Sha3512) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
- type Shake128
- type Shake256
Constants ¶
Variables ¶
View Source
var ErrBlake2s128Key = errors.New("blake2s: a key is required for a 128-bit hash")
View Source
var ErrHmacSecretNil = errors.New("HMAC secret is nil")
Functions ¶
func ReadFileContentAndHash ¶
func ReadFileContentAndHash(algo Algorithms, path string) ([]byte, error)
func ReadFileContentAndHmac ¶
func ReadFileContentAndHmac(algo Algorithms, path string) ([]byte, error)
Types ¶
type Algorithms ¶
type Algorithms interface { Hash(plaintext []byte) ([]byte, error) ValidateHash(plaintext []byte, expectedHash []byte) (bool, error) Hmac(plaintext []byte) ([]byte, error) ValidateHmac(plaintext []byte, expectedHash []byte) (bool, error) SetEncoder(encoder generic.Encoder) GetEncoder() generic.Encoder }
type Argon2ID ¶
type Argon2ID struct { Salt []byte Memory uint32 Iterations uint32 Parallelism uint8 KeyLen uint32 }
func (*Argon2ID) ExtractParameters ¶
func (a *Argon2ID) ExtractParameters(input string) (Parameters, error)
type Blake2b256 ¶
func (*Blake2b256) GetEncoder ¶ added in v0.1.1
func (b *Blake2b256) GetEncoder() generic.Encoder
func (*Blake2b256) SetEncoder ¶ added in v0.1.1
func (b *Blake2b256) SetEncoder(encoder generic.Encoder)
func (*Blake2b256) ValidateHash ¶
func (b *Blake2b256) ValidateHash(plaintext, expectedHash []byte) (bool, error)
func (*Blake2b256) ValidateHmac ¶
func (b *Blake2b256) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
type Blake2b384 ¶
func (*Blake2b384) GetEncoder ¶ added in v0.1.1
func (b *Blake2b384) GetEncoder() generic.Encoder
func (*Blake2b384) SetEncoder ¶ added in v0.1.1
func (b *Blake2b384) SetEncoder(encoder generic.Encoder)
func (*Blake2b384) ValidateHash ¶
func (b *Blake2b384) ValidateHash(plaintext, expectedHash []byte) (bool, error)
func (*Blake2b384) ValidateHmac ¶
func (b *Blake2b384) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
type Blake2b512 ¶
func (*Blake2b512) GetEncoder ¶ added in v0.1.1
func (b *Blake2b512) GetEncoder() generic.Encoder
func (*Blake2b512) SetEncoder ¶ added in v0.1.1
func (b *Blake2b512) SetEncoder(encoder generic.Encoder)
func (*Blake2b512) ValidateHash ¶
func (b *Blake2b512) ValidateHash(plaintext, expectedHash []byte) (bool, error)
func (*Blake2b512) ValidateHmac ¶
func (b *Blake2b512) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
type Blake2s128 ¶ added in v0.1.1
func (*Blake2s128) GetEncoder ¶ added in v0.1.1
func (b *Blake2s128) GetEncoder() generic.Encoder
func (*Blake2s128) Hash ¶ added in v0.1.1
func (b *Blake2s128) Hash(plaintext []byte) ([]byte, error)
func (*Blake2s128) Hmac ¶ added in v0.1.1
func (b *Blake2s128) Hmac(plaintext []byte) ([]byte, error)
func (*Blake2s128) SetEncoder ¶ added in v0.1.1
func (b *Blake2s128) SetEncoder(encoder generic.Encoder)
func (*Blake2s128) ValidateHash ¶ added in v0.1.1
func (b *Blake2s128) ValidateHash(plaintext, expectedHash []byte) (bool, error)
func (*Blake2s128) ValidateHmac ¶ added in v0.1.1
func (b *Blake2s128) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
type Blake2s256 ¶ added in v0.1.1
func (*Blake2s256) GetEncoder ¶ added in v0.1.1
func (b *Blake2s256) GetEncoder() generic.Encoder
func (*Blake2s256) Hash ¶ added in v0.1.1
func (b *Blake2s256) Hash(plaintext []byte) ([]byte, error)
func (*Blake2s256) Hmac ¶ added in v0.1.1
func (b *Blake2s256) Hmac(plaintext []byte) ([]byte, error)
func (*Blake2s256) SetEncoder ¶ added in v0.1.1
func (b *Blake2s256) SetEncoder(encoder generic.Encoder)
func (*Blake2s256) ValidateHash ¶ added in v0.1.1
func (b *Blake2s256) ValidateHash(plaintext, expectedHash []byte) (bool, error)
func (*Blake2s256) ValidateHmac ¶ added in v0.1.1
func (b *Blake2s256) ValidateHmac(plaintext, expectedHash []byte) (bool, error)
type Parameters ¶ added in v0.0.2
type Sha2256 ¶ added in v0.1.1
func (*Sha2256) GetEncoder ¶ added in v0.1.1
func (*Sha2256) SetEncoder ¶ added in v0.1.1
func (*Sha2256) ValidateHash ¶ added in v0.1.1
type Sha2384 ¶ added in v0.1.1
func (*Sha2384) GetEncoder ¶ added in v0.1.1
func (*Sha2384) SetEncoder ¶ added in v0.1.1
func (*Sha2384) ValidateHash ¶ added in v0.1.1
type Sha2512 ¶ added in v0.1.1
func (*Sha2512) GetEncoder ¶ added in v0.1.1
func (*Sha2512) SetEncoder ¶ added in v0.1.1
func (*Sha2512) ValidateHash ¶ added in v0.1.1
type Sha3224 ¶ added in v0.1.1
func (*Sha3224) GetEncoder ¶ added in v0.1.1
func (*Sha3224) SetEncoder ¶ added in v0.1.1
func (*Sha3224) ValidateHash ¶ added in v0.1.1
type Sha3256 ¶
func (*Sha3256) GetEncoder ¶ added in v0.1.1
func (*Sha3256) SetEncoder ¶ added in v0.1.1
func (*Sha3256) ValidateHash ¶
type Sha3384 ¶
func (*Sha3384) GetEncoder ¶ added in v0.1.1
func (*Sha3384) SetEncoder ¶ added in v0.1.1
func (*Sha3384) ValidateHash ¶
type Sha3512 ¶
func (*Sha3512) GetEncoder ¶ added in v0.1.1
func (*Sha3512) SetEncoder ¶ added in v0.1.1
func (*Sha3512) ValidateHash ¶
Click to show internal directories.
Click to hide internal directories.