drbg

package
v1.0.2065 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	/* seedlen for hash_drgb, table 2 of nist sp 800-90a rev.1 */
	DIGEST_MAX_SIZE = 64

	HASH_DRBG_SEED_SIZE     = 55
	HASH_DRBG_MAX_SEED_SIZE = 111

	HASH_DRBG_RESEED_INTERVAL = (uint64(1) << 48)
)
View Source
const MAX_BYTES = 1 << 27
View Source
const MAX_BYTES_PER_GENERATE = 1 << 11

Variables

View Source
var ErrReseedRequired = errors.New("the DRGB must be reseeded")

Functions

func NewCTR

func NewCTR(cip BlockCipher, keyLen int, entropy, nonce, personalstr []byte) (*ctrDRBG, error)

func NewGMHash

func NewGMHash(digest hash.Hash, entropy []byte, nonce []byte, personalstr []byte) (*hashDRBG, error)

func NewHMAC

func NewHMAC(h func() hash.Hash, entropy, nonce, personalstr []byte) (*hmacDRBG, error)

func NewHash

func NewHash(digest hash.Hash, entropy []byte, nonce []byte, personalstr []byte, isGm bool) (*hashDRBG, error)

func NewNISTHash

func NewNISTHash(digest hash.Hash, entropy []byte, nonce []byte, personalstr []byte) (*hashDRBG, error)

Types

type BlockCipher

type BlockCipher = func(key []byte) (cipher.Block, error)

Jump to

Keyboard shortcuts

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