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