mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-20 08:14:26 +00:00
Use standard mldsa65
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
package all
|
||||
|
||||
import (
|
||||
"crypto/mldsa"
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
|
||||
"github.com/cloudflare/circl/sign/mldsa/mldsa65"
|
||||
"github.com/xtls/xray-core/common"
|
||||
"github.com/xtls/xray-core/main/commands/base"
|
||||
)
|
||||
|
||||
@@ -39,8 +40,9 @@ func executeMLDSA65(cmd *base.Command, args []string) {
|
||||
} else {
|
||||
rand.Read(seed[:])
|
||||
}
|
||||
pub, _ := mldsa65.NewKeyFromSeed(&seed)
|
||||
priv := common.Must2(mldsa.NewPrivateKey(mldsa.MLDSA65(), seed[:]))
|
||||
fmt.Printf("Seed: %v\nVerify: %v\n",
|
||||
base64.RawURLEncoding.EncodeToString(seed[:]),
|
||||
base64.RawURLEncoding.EncodeToString(pub.Bytes()))
|
||||
base64.RawURLEncoding.EncodeToString(priv.PublicKey().Bytes()),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user