diff --git a/transport/vless/encryption/common.go b/transport/vless/encryption/common.go index 940deda1..5284a0d6 100644 --- a/transport/vless/encryption/common.go +++ b/transport/vless/encryption/common.go @@ -4,16 +4,16 @@ import ( "bytes" "crypto/aes" "crypto/cipher" - "crypto/rand" "errors" "fmt" "io" - "math/big" "net" "time" - "github.com/metacubex/blake3" "github.com/metacubex/mihomo/common/pool" + + "github.com/metacubex/blake3" + "github.com/metacubex/randv2" ) type CommonConn struct { @@ -210,6 +210,5 @@ func randBetween(from int64, to int64) int64 { if from == to { return from } - bigInt, _ := rand.Int(rand.Reader, big.NewInt(to-from)) - return from + bigInt.Int64() + return from + randv2.Int64N(to-from) }