mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-27 00:01:44 +00:00
b1107b9810
* Refine must2 and apply NewAesGcm() to all usage * Remove unused package * Fix test
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[:])
|
|
}
|