Files
crypto/cache/empty.go
T
Hanzo Dev 0be2fe8f6c crypto: implement post-quantum primitives with circl
- Implement ML-DSA-65 (FIPS 204) using cloudflare/circl
  * Single implementation with automatic CGO optimization
  * Sign ~440μs, Verify ~130μs, KeyGen ~165μs on M1 Max
  * All 11 tests passing

- Simplify ML-KEM implementation
  * Remove redundant optimized versions
  * Use circl ML-KEM-768 directly

- Simplify SLH-DSA implementation
  * Remove premature optimizations
  * Clean stub for future circl support (FIPS 205)

- Add comprehensive cache package
  * LRU cache from luxfi/node
  * Metercacher for metrics integration
  * Test utilities

- Add crypto utils
  * Atomic operations
  * Bytes utilities
  * Complete utils package from luxfi/node

- Update secp256k1 and BLS
  * All BLS tests passing (23 tests)
  * secp256k1 fuzz test added

All post-quantum implementations now use cloudflare/circl as single source
of truth, following DRY principle and ensuring FIPS compliance.
2025-11-22 16:37:21 -08:00

30 lines
597 B
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package cache
import "github.com/luxfi/node/utils"
var _ Cacher[struct{}, struct{}] = (*Empty[struct{}, struct{}])(nil)
// Empty is a cache that doesn't store anything.
type Empty[K any, V any] struct{}
func (*Empty[K, V]) Put(K, V) {}
func (*Empty[K, V]) Get(K) (V, bool) {
return utils.Zero[V](), false
}
func (*Empty[K, _]) Evict(K) {}
func (*Empty[_, _]) Flush() {}
func (*Empty[_, _]) Len() int {
return 0
}
func (*Empty[_, _]) PortionFilled() float64 {
return 0
}