Documentation ¶
Index ¶
- Constants
- Variables
- func New() hash.Hash
- func NewWithDeriveKey(context []byte) hash.Hash
- func NewWithDeriveKeyAndSize(context []byte, size int) hash.Hash
- func NewWithKeyed(key []byte) (hash.Hash, error)
- func NewWithKeyedAndSize(key []byte, size int) (hash.Hash, error)
- func NewWithSize(size int) hash.Hash
- func Sum(data []byte) (out [Size]byte)
- func SumWithDeriveKey(data []byte, context []byte) (out [Size]byte)
- func SumWithKeyed(data []byte, key []byte) (out [Size]byte, err error)
Constants ¶
View Source
const ( // The size of blake3 hash in bytes. Size = 32 // The block size of the hash algorithm in bytes. BlockSize = 64 )
View Source
const ( CHUNK_START = 1 << 0 CHUNK_END = 1 << 1 PARENT = 1 << 2 ROOT = 1 << 3 KEYED_HASH = 1 << 4 DERIVE_KEY_CONTEXT = 1 << 5 DERIVE_KEY_MATERIAL = 1 << 6 )
View Source
const BLAKE3_BLOCK_LEN = 64
View Source
const BLAKE3_CHUNK_LEN = 1024
View Source
const BLAKE3_KEY_LEN = 32
View Source
const BLAKE3_MAX_DEPTH = 54
View Source
const BLAKE3_OUT_LEN = 32
Variables ¶
View Source
var MSG_SCHEDULE = [7][16]uint32{
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
{2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8},
{3, 4, 10, 12, 13, 2, 7, 14, 6, 5, 9, 0, 11, 15, 8, 1},
{10, 7, 12, 9, 14, 3, 13, 15, 4, 0, 11, 2, 5, 8, 1, 6},
{12, 13, 9, 11, 15, 10, 14, 8, 7, 2, 5, 3, 0, 1, 6, 4},
{9, 14, 11, 5, 8, 12, 15, 1, 13, 3, 0, 10, 2, 6, 4, 7},
{11, 15, 5, 0, 1, 9, 8, 6, 14, 10, 2, 12, 3, 4, 7, 13},
}
Functions ¶
func NewWithDeriveKey ¶
NewWithDeriveKey is like New but initializes context
func NewWithDeriveKeyAndSize ¶
NewWithDeriveKeyAndSize is like New but initializes context
func NewWithKeyed ¶
NewWithKeyed is like New but initializes key with the given 32-byte slice.
func NewWithKeyedAndSize ¶
NewWithKeyedAndSize is like New but initializes key with the given 32-byte slice.
func NewWithSize ¶
New returns a new hash.Hash computing the blake3 checksum.
func SumWithDeriveKey ¶
SumWithDeriveKey returns the blake3 checksum of the data.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.