Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package crypto is a Subset of the Go `crypto` Package with a Resumable Hash
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHash ¶
func RegisterHash(h Hash, f func() ResumableHash)
RegisterHash registers a function that returns a new instance of the given hash function. This is intended to be called from the init function in packages that implement hash functions.
Types ¶
type Hash ¶
type Hash uint
Hash identifies a cryptographic hash function that is implemented in another package.
func (Hash) Available ¶
Available reports whether the given hash function is linked into the binary.
func (Hash) HashFunc ¶
HashFunc simply returns the value of h so that Hash implements SignerOpts.
func (Hash) New ¶
func (h Hash) New() ResumableHash
New returns a new ResumableHash calculating the given hash function. New panics if the hash function is not linked into the binary.
type ResumableHash ¶
type ResumableHash interface {
	// ResumableHash is a superset of hash.Hash
	hash.Hash
	// Len returns the number of bytes written to the Hash so far.
	Len() uint64
	// State returns a snapshot of the state of the Hash.
	State() ([]byte, error)
	// Restore resets the Hash to the given state.
	Restore(state []byte) error
}
    ResumableHash is the common interface implemented by all resumable hash functions.
      
      Source Files
      ¶
    
- crypto.go
 
      
      Directories
      ¶
    
    | Path | Synopsis | 
|---|---|
| 
       Package sha256 implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4. 
         | 
      Package sha256 implements the SHA224 and SHA256 hash algorithms as defined in FIPS 180-4. | 
| 
       Package sha512 implements the SHA384 and SHA512 hash algorithms as defined in FIPS 180-2. 
         | 
      Package sha512 implements the SHA384 and SHA512 hash algorithms as defined in FIPS 180-2. |