This commit is contained in:
RPRX 2020-12-04 09:36:16 +08:00
parent ed8d6d743c
commit 16544c18ab
627 changed files with 3247 additions and 2635 deletions

View file

@ -4,7 +4,7 @@ import (
"crypto/aes"
"crypto/cipher"
"github.com/xtls/xray-core/v1/common"
"github.com/xtls/xray-core/common"
)
// NewAesDecryptionStream creates a new AES encryption stream based on given key and IV.

View file

@ -5,10 +5,10 @@ import (
"io"
"math/rand"
"github.com/xtls/xray-core/v1/common"
"github.com/xtls/xray-core/v1/common/buf"
"github.com/xtls/xray-core/v1/common/bytespool"
"github.com/xtls/xray-core/v1/common/protocol"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/buf"
"github.com/xtls/xray-core/common/bytespool"
"github.com/xtls/xray-core/common/protocol"
)
type BytesGenerator func() []byte

View file

@ -10,10 +10,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/xtls/xray-core/v1/common"
"github.com/xtls/xray-core/v1/common/buf"
. "github.com/xtls/xray-core/v1/common/crypto"
"github.com/xtls/xray-core/v1/common/protocol"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/buf"
. "github.com/xtls/xray-core/common/crypto"
"github.com/xtls/xray-core/common/protocol"
)
func TestAuthenticationReaderWriter(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"crypto/cipher"
"testing"
. "github.com/xtls/xray-core/v1/common/crypto"
. "github.com/xtls/xray-core/common/crypto"
)
const benchSize = 1024 * 1024

View file

@ -3,7 +3,7 @@ package crypto
import (
"crypto/cipher"
"github.com/xtls/xray-core/v1/common/crypto/internal"
"github.com/xtls/xray-core/common/crypto/internal"
)
// NewChaCha20Stream creates a new Chacha20 encryption/descryption stream based on give key and IV.

View file

@ -7,8 +7,8 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/xtls/xray-core/v1/common"
. "github.com/xtls/xray-core/v1/common/crypto"
"github.com/xtls/xray-core/common"
. "github.com/xtls/xray-core/common/crypto"
)
func mustDecodeHex(s string) []byte {

View file

@ -4,8 +4,8 @@ import (
"encoding/binary"
"io"
"github.com/xtls/xray-core/v1/common"
"github.com/xtls/xray-core/v1/common/buf"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/buf"
)
// ChunkSizeDecoder is a utility class to decode size value from bytes.

View file

@ -5,9 +5,9 @@ import (
"io"
"testing"
"github.com/xtls/xray-core/v1/common"
"github.com/xtls/xray-core/v1/common/buf"
. "github.com/xtls/xray-core/v1/common/crypto"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/buf"
. "github.com/xtls/xray-core/common/crypto"
)
func TestChunkStreamIO(t *testing.T) {

View file

@ -1,4 +1,4 @@
// Package crypto provides common crypto libraries for Xray.
package crypto // import "github.com/xtls/xray-core/v1/common/crypto"
package crypto // import "github.com/xtls/xray-core/common/crypto"
//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

View file

@ -1,6 +1,6 @@
package crypto
import "github.com/xtls/xray-core/v1/common/errors"
import "github.com/xtls/xray-core/common/errors"
type errPathObjHolder struct{}

View file

@ -4,7 +4,7 @@ import (
"crypto/cipher"
"io"
"github.com/xtls/xray-core/v1/common/buf"
"github.com/xtls/xray-core/common/buf"
)
type CryptionReader struct {