mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-08-23 01:56:48 +08:00
14 lines
245 B
Go
14 lines
245 B
Go
package kcp
|
|
|
|
import (
|
|
"crypto/cipher"
|
|
"crypto/sha256"
|
|
|
|
"github.com/xtls/xray-core/common/crypto"
|
|
)
|
|
|
|
func NewAEADAESGCMBasedOnSeed(seed string) cipher.AEAD {
|
|
hashedSeed := sha256.Sum256([]byte(seed))
|
|
return crypto.NewAesGcm(hashedSeed[:])
|
|
}
|