mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-08-22 09:36:49 +08:00
Use X25519 for XOR; Add "divide" (ECH, before and includes type 0); Change config format
https://github.com/XTLS/Xray-core/pull/4952#issuecomment-3207449672
This commit is contained in:
@@ -3,6 +3,7 @@ package all
|
||||
import (
|
||||
"crypto/mlkem"
|
||||
"crypto/rand"
|
||||
"crypto/sha3"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
|
||||
@@ -40,8 +41,10 @@ func executeMLKEM768(cmd *base.Command, args []string) {
|
||||
rand.Read(seed[:])
|
||||
}
|
||||
key, _ := mlkem.NewDecapsulationKey768(seed[:])
|
||||
pub := key.EncapsulationKey()
|
||||
fmt.Printf("Seed: %v\nClient: %v",
|
||||
client := key.EncapsulationKey().Bytes()
|
||||
hash32 := sha3.Sum256(client)
|
||||
fmt.Printf("Seed: %v\nClient: %v\nHash11: %v",
|
||||
base64.RawURLEncoding.EncodeToString(seed[:]),
|
||||
base64.RawURLEncoding.EncodeToString(pub.Bytes()))
|
||||
base64.RawURLEncoding.EncodeToString(client),
|
||||
base64.RawURLEncoding.EncodeToString(hash32[:11]))
|
||||
}
|
||||
|
Reference in New Issue
Block a user