github.com/switchupcb/yaegi@v0.10.2/stdlib/go1_16_crypto_cipher.go (about)

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