Documentation
¶
Index ¶
Constants ¶
View Source
const BlockCrypt_BlockCrypt_MAX = BlockCrypt_BlockCrypt_SALSA20
BlockCrypt_BlockCrypt_MAX is the maximum value for BlockCrypt.
Variables ¶
View Source
var BlockCrypt_name = map[int32]string{
0: "BlockCrypt_UNKNOWN",
1: "BlockCrypt_NONE",
2: "BlockCrypt_AES256",
3: "BlockCrypt_AES128",
4: "BlockCrypt_AES192",
5: "BlockCrypt_SM4_16",
6: "BlockCrypt_XOR",
7: "BlockCrypt_3DES",
8: "BlockCrypt_SALSA20",
}
View Source
var BlockCrypt_value = map[string]int32{
"BlockCrypt_UNKNOWN": 0,
"BlockCrypt_NONE": 1,
"BlockCrypt_AES256": 2,
"BlockCrypt_AES128": 3,
"BlockCrypt_AES192": 4,
"BlockCrypt_SM4_16": 5,
"BlockCrypt_XOR": 6,
"BlockCrypt_3DES": 7,
"BlockCrypt_SALSA20": 8,
}
Functions ¶
This section is empty.
Types ¶
type BlockCrypt ¶
type BlockCrypt int32
BlockCrypt sets the type of block crypto to use.
const ( // BlockCrypt_UNKNOWN defaults to BlockCrypt_AES256 BlockCrypt_BlockCrypt_UNKNOWN BlockCrypt = 0 // BlockCrypt_NONE is unencrypted. BlockCrypt_BlockCrypt_NONE BlockCrypt = 1 // BlockCrypt_AES256 is AES 256-bit block encryption. BlockCrypt_BlockCrypt_AES256 BlockCrypt = 2 // BlockCrypt_AES128 is AES 128-bit block encryption. BlockCrypt_BlockCrypt_AES128 BlockCrypt = 3 // BlockCrypt_AES192 is AES 192-bit block encryption. BlockCrypt_BlockCrypt_AES192 BlockCrypt = 4 // BlockCrypt_SM4_16 is SM4 16-bit block encryption. BlockCrypt_BlockCrypt_SM4_16 BlockCrypt = 5 // BlockCrypt_XOR is simple XOR block encryption. BlockCrypt_BlockCrypt_XOR BlockCrypt = 6 // BlockCrypt_3DES is 3des 24-bit block encryption. BlockCrypt_BlockCrypt_3DES BlockCrypt = 7 // BlockCrypt_SALSA20 is salsa20 32-bit block encryption. BlockCrypt_BlockCrypt_SALSA20 BlockCrypt = 8 )
func (BlockCrypt) EnumDescriptor ¶
func (BlockCrypt) EnumDescriptor() ([]byte, []int)
func (BlockCrypt) String ¶
func (x BlockCrypt) String() string
type Crypt ¶
type Crypt interface { // Encrypt encrypts the whole block in src into dst. // Dst and src may point at the same memory. Encrypt(dst, src []byte) // Decrypt decrypts the whole block in src into dst. // Dst and src may point at the same memory. Decrypt(dst, src []byte) }
Crypt defines encryption/decryption methods for a given byte slice. Notes on implementing: the data to be encrypted contains a builtin nonce at the first 16 bytes
func BuildBlockCrypt ¶
func BuildBlockCrypt(crypt BlockCrypt, pass []byte) (Crypt, error)
BuildBlockCrypt builds block crypt from known types.
Click to show internal directories.
Click to hide internal directories.