| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
package stdlib |
| 7 |
|
| 8 |
import ( |
| 9 |
"crypto/cipher" |
| 10 |
"reflect" |
| 11 |
) |
| 12 |
|
| 13 |
func init() { |
| 14 |
Symbols["crypto/cipher/cipher"] = map[string]reflect.Value{ |
| 15 |
|
| 16 |
"NewCBCDecrypter": reflect.ValueOf(cipher.NewCBCDecrypter), |
| 17 |
"NewCBCEncrypter": reflect.ValueOf(cipher.NewCBCEncrypter), |
| 18 |
"NewCFBDecrypter": reflect.ValueOf(cipher.NewCFBDecrypter), |
| 19 |
"NewCFBEncrypter": reflect.ValueOf(cipher.NewCFBEncrypter), |
| 20 |
"NewCTR": reflect.ValueOf(cipher.NewCTR), |
| 21 |
"NewGCM": reflect.ValueOf(cipher.NewGCM), |
| 22 |
"NewGCMWithNonceSize": reflect.ValueOf(cipher.NewGCMWithNonceSize), |
| 23 |
"NewGCMWithTagSize": reflect.ValueOf(cipher.NewGCMWithTagSize), |
| 24 |
"NewOFB": reflect.ValueOf(cipher.NewOFB), |
| 25 |
|
| 26 |
|
| 27 |
"AEAD": reflect.ValueOf((*cipher.AEAD)(nil)), |
| 28 |
"Block": reflect.ValueOf((*cipher.Block)(nil)), |
| 29 |
"BlockMode": reflect.ValueOf((*cipher.BlockMode)(nil)), |
| 30 |
"Stream": reflect.ValueOf((*cipher.Stream)(nil)), |
| 31 |
"StreamReader": reflect.ValueOf((*cipher.StreamReader)(nil)), |
| 32 |
"StreamWriter": reflect.ValueOf((*cipher.StreamWriter)(nil)), |
| 33 |
|
| 34 |
|
| 35 |
"_AEAD": reflect.ValueOf((*_crypto_cipher_AEAD)(nil)), |
| 36 |
"_Block": reflect.ValueOf((*_crypto_cipher_Block)(nil)), |
| 37 |
"_BlockMode": reflect.ValueOf((*_crypto_cipher_BlockMode)(nil)), |
| 38 |
"_Stream": reflect.ValueOf((*_crypto_cipher_Stream)(nil)), |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
|
| 43 |
type _crypto_cipher_AEAD struct { |
| 44 |
IValue interface{} |
| 45 |
WNonceSize func() int |
| 46 |
WOpen func(dst []byte, nonce []byte, ciphertext []byte, additionalData []byte) ([]byte, error) |
| 47 |
WOverhead func() int |
| 48 |
WSeal func(dst []byte, nonce []byte, plaintext []byte, additionalData []byte) []byte |
| 49 |
} |
| 50 |
|
| 51 |
func (W _crypto_cipher_AEAD) NonceSize() int { return W.WNonceSize() } |
| 52 |
func (W _crypto_cipher_AEAD) Open(dst []byte, nonce []byte, ciphertext []byte, additionalData []byte) ([]byte, error) { |
| 53 |
return W.WOpen(dst, nonce, ciphertext, additionalData) |
| 54 |
} |
| 55 |
func (W _crypto_cipher_AEAD) Overhead() int { return W.WOverhead() } |
| 56 |
func (W _crypto_cipher_AEAD) Seal(dst []byte, nonce []byte, plaintext []byte, additionalData []byte) []byte { |
| 57 |
return W.WSeal(dst, nonce, plaintext, additionalData) |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
type _crypto_cipher_Block struct { |
| 62 |
IValue interface{} |
| 63 |
WBlockSize func() int |
| 64 |
WDecrypt func(dst []byte, src []byte) |
| 65 |
WEncrypt func(dst []byte, src []byte) |
| 66 |
} |
| 67 |
|
| 68 |
func (W _crypto_cipher_Block) BlockSize() int { return W.WBlockSize() } |
| 69 |
func (W _crypto_cipher_Block) Decrypt(dst []byte, src []byte) { W.WDecrypt(dst, src) } |
| 70 |
func (W _crypto_cipher_Block) Encrypt(dst []byte, src []byte) { W.WEncrypt(dst, src) } |
| 71 |
|
| 72 |
|
| 73 |
type _crypto_cipher_BlockMode struct { |
| 74 |
IValue interface{} |
| 75 |
WBlockSize func() int |
| 76 |
WCryptBlocks func(dst []byte, src []byte) |
| 77 |
} |
| 78 |
|
| 79 |
func (W _crypto_cipher_BlockMode) BlockSize() int { return W.WBlockSize() } |
| 80 |
func (W _crypto_cipher_BlockMode) CryptBlocks(dst []byte, src []byte) { W.WCryptBlocks(dst, src) } |
| 81 |
|
| 82 |
|
| 83 |
type _crypto_cipher_Stream struct { |
| 84 |
IValue interface{} |
| 85 |
WXORKeyStream func(dst []byte, src []byte) |
| 86 |
} |
| 87 |
|
| 88 |
func (W _crypto_cipher_Stream) XORKeyStream(dst []byte, src []byte) { W.WXORKeyStream(dst, src) } |