Documentation ¶
Overview ¶
Package skein implements the Skein512 hash function based on the Threefish tweakable block cipher.
Index ¶
- Constants
- func New(hashsize int, conf *Config) hash.Hash
- func New256(key []byte) hash.Hash
- func New512(key []byte) hash.Hash
- func Sum(msg []byte, hashsize int, conf *Config) []byte
- func Sum160(msg, key []byte) (out [20]byte)
- func Sum256(msg, key []byte) (out [32]byte)
- func Sum384(msg, key []byte) (out [48]byte)
- func Sum512(msg, key []byte) (out [64]byte)
- type Config
Constants ¶
const ( // CfgKey is the config type for the Key. CfgKey uint64 = 0 // CfgConfig is the config type for the configuration. CfgConfig uint64 = 4 // CfgPersonal is the config type for the personalization. CfgPersonal uint64 = 8 // CfgPublicKey is the config type for the public key. CfgPublicKey uint64 = 12 // CfgKeyID is the config type for the key id. CfgKeyID uint64 = 16 // CfgNonce is the config type for the nonce. CfgNonce uint64 = 20 // CfgMessage is the config type for the message. CfgMessage uint64 = 48 // CfgOutput is the config type for the output. CfgOutput uint64 = 63 // FirstBlock is the first block flag FirstBlock uint64 = 1 << 62 // FinalBlock is the final block flag FinalBlock uint64 = 1 << 63 // The skein schema ID = S H A 3 1 0 0 0 SchemaID uint64 = 0x133414853 )
The different parameter types
const (
BlockSize = threefish.BlockSize512
)
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a hash.Hash computing the Skein512 checksum with the given hash size. The conf is optional and configurates the hash.Hash
func New256 ¶
New256 returns a hash.Hash computing the Skein512 256 bit checksum. The key is optional and turns the hash into a MAC.
func New512 ¶
New512 returns a hash.Hash computing the Skein512 512 bit checksum. The key is optional and turns the hash into a MAC.
func Sum ¶
Sum returns the Skein512 checksum with the given hash size of msg using the (optional) conf for configuration. The hashsize must be > 0.
func Sum160 ¶
Sum160 computes the 160 bit Skein512 checksum (or MAC if key is set) of msg and writes it to out. The key is optional and can be nil.
func Sum256 ¶
Sum256 computes the 256 bit Skein512 checksum (or MAC if key is set) of msg and writes it to out. The key is optional and can be nil.
Types ¶
type Config ¶
type Config struct { Key []byte // Optional: The secret key for MAC Personal []byte // Optional: The personalization for unique hashing PublicKey []byte // Optional: The public key for public-key bound hashing KeyID []byte // Optional: The key id for key derivation Nonce []byte // Optional: The nonce for randomized hashing }
Config contains the Skein configuration: - Key for computing MACs - Personal for personalized hashing - PublicKey for public-key-bound hashing - KeyID for key derivation - Nonce for randomized hashing All fields are optional and can be nil.
Directories ¶
Path | Synopsis |
---|---|
Package skein1024 implements the Skein1024 hash function based on the Threefish1024 tweakable block cipher.
|
Package skein1024 implements the Skein1024 hash function based on the Threefish1024 tweakable block cipher. |
Package skein256 implements the Skein256 hash function based on the Threefish256 tweakable block cipher.
|
Package skein256 implements the Skein256 hash function based on the Threefish256 tweakable block cipher. |
Package threefish implements the Threefish tweakable block cipher.
|
Package threefish implements the Threefish tweakable block cipher. |