mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-23 02:18:13 -05:00
14 lines
181 B
Go
14 lines
181 B
Go
|
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]
|
||
|
}
|