dsfx/pkg/dcrypto/hkdf.go

12 lines
226 B
Go
Raw Normal View History

2025-03-07 21:05:37 -05:00
package dcrypto
import (
"crypto/hkdf"
"crypto/sha256"
)
// Key creates a key from the given secret and salt using HKDF.
func Key(secret, salt []byte) ([]byte, error) {
return hkdf.Key(sha256.New, secret, salt, "", 32)
}