mirror of
https://github.com/luxfi/crypto.git
synced 2026-07-27 01:54:50 +00:00
Author lux/crypto/blake3/ to mirror lux/crypto/keccak and lux/crypto/sha256:
- blake3.go: Hash, HashHex, HashBatch, New, NewKeyed, KeyedHash,
DeriveKey, Reader (XOF), Concat. Backed by github.com/zeebo/blake3
(BSD-3, pure Go with SSE4.1/AVX2/NEON), counted as vanilla per
CANONICAL_AUDIT.md directive.
- gpu.go: batchGPU stub matching keccak/sha256 dispatch surface; falls
through to CPU because luxfi/accel does not yet expose a real BLAKE3
kernel (its HashBlake3 currently aliases SHA-256). When accel ships
the kernel, wire it in here, no API change.
- blake3_test.go: 35/35 official BLAKE3 reference KAT vectors
(test_vectors.json embedded) for hash, keyed_hash, derive_key. Plus
batch parity, incremental==contiguous, XOF, hex, key-size validation.
- doc.go: package overview matching keccak/sha256 docs.
Closes the blake3 hard violation in CANONICAL_AUDIT.md (commit 9affea3).
16 lines
722 B
Go
16 lines
722 B
Go
// Package blake3 implements the BLAKE3 cryptographic hash function.
|
|
//
|
|
// This is the canonical entry point for BLAKE3 in the luxfi/crypto module.
|
|
// It exposes:
|
|
//
|
|
// - Hash: single-input fixed-size (32 byte) digest, allocations-1.
|
|
// - HashBatch: batch variant with optional GPU dispatch above BatchThreshold.
|
|
// - New: streaming hash.Hash for incremental input.
|
|
// - NewKeyed: keyed hash (32-byte key) for MAC use.
|
|
// - DeriveKey: KDF mode (RFC 9106-style context separation).
|
|
// - Reader: variable-length output stream (XOF).
|
|
//
|
|
// Backed by github.com/zeebo/blake3 (BSD-3, pure Go with SSE4.1/AVX2/NEON).
|
|
// Mirrors the lux/crypto/keccak and lux/crypto/sha256 dispatch pattern.
|
|
package blake3
|