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

     1  // Code generated by 'yaegi extract crypto'. DO NOT EDIT.
     2  
     3  //go:build go1.17
     4  // +build go1.17
     5  
     6  package stdlib
     7  
     8  import (
     9  	"crypto"
    10  	"io"
    11  	"reflect"
    12  )
    13  
    14  func init() {
    15  	Symbols["crypto/crypto"] = map[string]reflect.Value{
    16  		// function, constant and variable definitions
    17  		"BLAKE2b_256":  reflect.ValueOf(crypto.BLAKE2b_256),
    18  		"BLAKE2b_384":  reflect.ValueOf(crypto.BLAKE2b_384),
    19  		"BLAKE2b_512":  reflect.ValueOf(crypto.BLAKE2b_512),
    20  		"BLAKE2s_256":  reflect.ValueOf(crypto.BLAKE2s_256),
    21  		"MD4":          reflect.ValueOf(crypto.MD4),
    22  		"MD5":          reflect.ValueOf(crypto.MD5),
    23  		"MD5SHA1":      reflect.ValueOf(crypto.MD5SHA1),
    24  		"RIPEMD160":    reflect.ValueOf(crypto.RIPEMD160),
    25  		"RegisterHash": reflect.ValueOf(crypto.RegisterHash),
    26  		"SHA1":         reflect.ValueOf(crypto.SHA1),
    27  		"SHA224":       reflect.ValueOf(crypto.SHA224),
    28  		"SHA256":       reflect.ValueOf(crypto.SHA256),
    29  		"SHA384":       reflect.ValueOf(crypto.SHA384),
    30  		"SHA3_224":     reflect.ValueOf(crypto.SHA3_224),
    31  		"SHA3_256":     reflect.ValueOf(crypto.SHA3_256),
    32  		"SHA3_384":     reflect.ValueOf(crypto.SHA3_384),
    33  		"SHA3_512":     reflect.ValueOf(crypto.SHA3_512),
    34  		"SHA512":       reflect.ValueOf(crypto.SHA512),
    35  		"SHA512_224":   reflect.ValueOf(crypto.SHA512_224),
    36  		"SHA512_256":   reflect.ValueOf(crypto.SHA512_256),
    37  
    38  		// type definitions
    39  		"Decrypter":     reflect.ValueOf((*crypto.Decrypter)(nil)),
    40  		"DecrypterOpts": reflect.ValueOf((*crypto.DecrypterOpts)(nil)),
    41  		"Hash":          reflect.ValueOf((*crypto.Hash)(nil)),
    42  		"PrivateKey":    reflect.ValueOf((*crypto.PrivateKey)(nil)),
    43  		"PublicKey":     reflect.ValueOf((*crypto.PublicKey)(nil)),
    44  		"Signer":        reflect.ValueOf((*crypto.Signer)(nil)),
    45  		"SignerOpts":    reflect.ValueOf((*crypto.SignerOpts)(nil)),
    46  
    47  		// interface wrapper definitions
    48  		"_Decrypter":     reflect.ValueOf((*_crypto_Decrypter)(nil)),
    49  		"_DecrypterOpts": reflect.ValueOf((*_crypto_DecrypterOpts)(nil)),
    50  		"_PrivateKey":    reflect.ValueOf((*_crypto_PrivateKey)(nil)),
    51  		"_PublicKey":     reflect.ValueOf((*_crypto_PublicKey)(nil)),
    52  		"_Signer":        reflect.ValueOf((*_crypto_Signer)(nil)),
    53  		"_SignerOpts":    reflect.ValueOf((*_crypto_SignerOpts)(nil)),
    54  	}
    55  }
    56  
    57  // _crypto_Decrypter is an interface wrapper for Decrypter type
    58  type _crypto_Decrypter struct {
    59  	IValue   interface{}
    60  	WDecrypt func(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error)
    61  	WPublic  func() crypto.PublicKey
    62  }
    63  
    64  func (W _crypto_Decrypter) Decrypt(rand io.Reader, msg []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) {
    65  	return W.WDecrypt(rand, msg, opts)
    66  }
    67  func (W _crypto_Decrypter) Public() crypto.PublicKey {
    68  	return W.WPublic()
    69  }
    70  
    71  // _crypto_DecrypterOpts is an interface wrapper for DecrypterOpts type
    72  type _crypto_DecrypterOpts struct {
    73  	IValue interface{}
    74  }
    75  
    76  // _crypto_PrivateKey is an interface wrapper for PrivateKey type
    77  type _crypto_PrivateKey struct {
    78  	IValue interface{}
    79  }
    80  
    81  // _crypto_PublicKey is an interface wrapper for PublicKey type
    82  type _crypto_PublicKey struct {
    83  	IValue interface{}
    84  }
    85  
    86  // _crypto_Signer is an interface wrapper for Signer type
    87  type _crypto_Signer struct {
    88  	IValue  interface{}
    89  	WPublic func() crypto.PublicKey
    90  	WSign   func(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)
    91  }
    92  
    93  func (W _crypto_Signer) Public() crypto.PublicKey {
    94  	return W.WPublic()
    95  }
    96  func (W _crypto_Signer) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error) {
    97  	return W.WSign(rand, digest, opts)
    98  }
    99  
   100  // _crypto_SignerOpts is an interface wrapper for SignerOpts type
   101  type _crypto_SignerOpts struct {
   102  	IValue    interface{}
   103  	WHashFunc func() crypto.Hash
   104  }
   105  
   106  func (W _crypto_SignerOpts) HashFunc() crypto.Hash {
   107  	return W.WHashFunc()
   108  }