V2bX/common/crypt/x25519.go

14 lines
181 B
Go
Raw Normal View History

2023-07-15 07:37:44 -04:00
package crypt
import (
"crypto/sha256"
)
func GenX25519Private(data []byte) []byte {
key := sha256.Sum256(data)
key[0] &= 248
key[31] &= 127
key[31] |= 64
return key[:32]
}