mirror of
https://git.numenor-labs.us/dsfx.git
synced 2025-04-29 08:10:34 +00:00
12 lines
226 B
Go
12 lines
226 B
Go
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)
|
|
}
|