Total rework HAP pkg and HomeKit source

This commit is contained in:
Alexey Khit
2023-07-23 22:22:36 +03:00
parent d73e9f6bcf
commit 6d82b1ce89
31 changed files with 2074 additions and 2015 deletions
+17
View File
@@ -0,0 +1,17 @@
package hkdf
import (
"crypto/sha512"
"io"
"golang.org/x/crypto/hkdf"
)
func Sha512(key []byte, salt, info string) ([]byte, error) {
r := hkdf.New(sha512.New, key, []byte(salt), []byte(info))
buf := make([]byte, 32)
_, err := io.ReadFull(r, buf)
return buf, err
}