mirror of
https://github.com/luxfi/crypto.git
synced 2026-07-27 01:54:50 +00:00
- Add secret/ package: wraps runtime/secret.Do() for secure key erasure when built with GOEXPERIMENT=runtimesecret, no-op stub otherwise - Add encryption/hpke.go: HPKE encryption using Go 1.26 stdlib crypto/hpke with X25519 (classical) and ML-KEM-768+X25519 (post-quantum hybrid) - Wrap BLS key generation (both CGO and pure Go) in secret.Do() - Wrap HexToECDSA and LoadECDSA in secret.Do() for key byte cleanup - Simplify random.go: crypto/rand.Read never errors in Go 1.26 - Update CI workflows to Go 1.26.1, add GOEXPERIMENT=runtimesecret job - Update dependencies: circl 1.6.3, x/crypto 0.48.0, age 1.3.1
21 lines
575 B
Go
21 lines
575 B
Go
// Copyright (C) 2020-2026, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
//go:build !goexperiment.runtimesecret
|
|
|
|
package secret
|
|
|
|
// Do executes f directly. Without GOEXPERIMENT=runtimesecret, this is a
|
|
// pass-through with no runtime secret memory protection.
|
|
//
|
|
// Callers should still clear(key) sensitive byte slices manually.
|
|
func Do(f func()) {
|
|
f()
|
|
}
|
|
|
|
// Enabled reports whether the runtime secret erasure support is active.
|
|
// Returns false when built without GOEXPERIMENT=runtimesecret.
|
|
func Enabled() bool {
|
|
return false
|
|
}
|