Documentation
¶
Index ¶
- Constants
- func BNAsc2bn(a **BIGNUM, str *c.Char) c.Int
- func BNDec2bn(a **BIGNUM, str *c.Char) c.Int
- func BNHex2bn(a **BIGNUM, str *c.Char) c.Int
- func ERRClearError()
- func ERRErrorString(e Errno, buf *c.Char) *c.Char
- func ERRLibErrorString(e Errno) *c.Char
- func ERRPrintErrorsCb(cb func(str *c.Char, len uintptr, u unsafe.Pointer) c.Int, u unsafe.Pointer)
- func ERRPrintErrorsFp(fp c.FilePtr)
- func ERRReasonErrorString(e Errno) *c.Char
- func Free(ptr unsafe.Pointer)
- func FreeCStr(ptr *c.Char)
- func MD5(data unsafe.Pointer, n uintptr, md *byte) *byte
- func MD5Bytes(data []byte, md *byte) *byte
- func MD5String(data string, md *byte) *byte
- func RANDBufferWithLen(buf *byte, num c.Int) c.Int
- func RANDBytes(buf []byte) c.Int
- func RANDFileName(file *c.Char, num uintptr) *c.Char
- func RANDKeepRandomDevicesOpen(keep c.Int)
- func RANDLoadFile(file *c.Char, maxBytes c.Long) c.Int
- func RANDPoll() c.Int
- func RANDPrivBufferWithLen(buf *byte, num c.Int) c.Int
- func RANDPrivBytes(buf []byte) c.Int
- func RANDSeed(buf unsafe.Pointer, num c.Int)
- func RANDStatus() c.Int
- func RANDWriteFile(file *c.Char) c.Int
- func RSAPrivateDecrypt(flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int
- func RSAPrivateEncrypt(flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int
- func RSAPublicDecrypt(flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int
- func RSAPublicEncrypt(flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int
- func RSASign(typ c.Int, msg *byte, mlen c.Uint, sigret *byte, siglen *c.Uint, rsa *RSA) c.Int
- func SHA1(data unsafe.Pointer, n uintptr, md *byte) *byte
- func SHA1Bytes(data []byte, md *byte) *byte
- func SHA1String(data string, md *byte) *byte
- func SHA224(data unsafe.Pointer, n uintptr, md *byte) *byte
- func SHA224Bytes(data []byte, md *byte) *byte
- func SHA224String(data string, md *byte) *byte
- func SHA256(data unsafe.Pointer, n uintptr, md *byte) *byte
- func SHA256Bytes(data []byte, md *byte) *byte
- func SHA256String(data string, md *byte) *byte
- func SHA384(data unsafe.Pointer, n uintptr, md *byte) *byte
- func SHA384Bytes(data []byte, md *byte) *byte
- func SHA384String(data string, md *byte) *byte
- func SHA512(data unsafe.Pointer, n uintptr, md *byte) *byte
- func SHA512Bytes(data []byte, md *byte) *byte
- func SHA512String(data string, md *byte) *byte
- type BIGNUM
- func BNBin2bn(s *byte, len c.Int, ret *BIGNUM) *BIGNUM
- func BNLebin2bn(s *byte, len c.Int, ret *BIGNUM) *BIGNUM
- func BNMpi2bn(s *byte, len c.Int, ret *BIGNUM) *BIGNUM
- func BNNative2bn(s *byte, len c.Int, ret *BIGNUM) *BIGNUM
- func BNNew() *BIGNUM
- func BNSecureNew() *BIGNUM
- func BNSignedBin2bn(s *byte, len c.Int, ret *BIGNUM) *BIGNUM
- func BNSignedLebin2bn(s *byte, len c.Int, ret *BIGNUM) *BIGNUM
- func BNSignedNative2bn(s *byte, len c.Int, ret *BIGNUM) *BIGNUM
- func (*BIGNUM) AbsIsWord(w BN_ULONG) c.Int
- func (*BIGNUM) Add(a, b *BIGNUM) c.Int
- func (*BIGNUM) AddWord(w BN_ULONG) c.Int
- func (*BIGNUM) AreCoprime(b *BIGNUM, ctx *BN_CTX) c.Int
- func (bn *BIGNUM) Bn2bin(to *byte) c.Int
- func (bn *BIGNUM) Bn2binpad(to *byte, tolen c.Int) c.Int
- func (*BIGNUM) Bn2dec() *c.Char
- func (*BIGNUM) Bn2hex() *c.Char
- func (bn *BIGNUM) Bn2lebinpad(to *byte, tolen c.Int) c.Int
- func (bn *BIGNUM) Bn2mpi(to *byte) c.Int
- func (bn *BIGNUM) Bn2nativepad(to *byte, tolen c.Int) c.Int
- func (*BIGNUM) CStr() *c.Char
- func (*BIGNUM) Clear()
- func (*BIGNUM) ClearBit(n c.Int) c.Int
- func (*BIGNUM) ClearFree()
- func (*BIGNUM) Cmp(b *BIGNUM) c.Int
- func (*BIGNUM) Copy(b *BIGNUM) *BIGNUM
- func (*BIGNUM) Div(rem, m, d *BIGNUM, ctx *BN_CTX) c.Int
- func (*BIGNUM) DivWord(w BN_ULONG) BN_ULONG
- func (*BIGNUM) Dup() *BIGNUM
- func (*BIGNUM) Exp(a, p *BIGNUM, ctx *BN_CTX) c.Int
- func (*BIGNUM) Free()
- func (*BIGNUM) Gcd(a, b *BIGNUM, ctx *BN_CTX) c.Int
- func (*BIGNUM) GetWord() BN_ULONG
- func (*BIGNUM) IsBitSet(n c.Int) c.Int
- func (*BIGNUM) IsNegative() c.Int
- func (*BIGNUM) IsOdd() c.Int
- func (*BIGNUM) IsOne() c.Int
- func (*BIGNUM) IsWord(w BN_ULONG) c.Int
- func (*BIGNUM) IsZero() c.Int
- func (*BIGNUM) Lshift(a *BIGNUM, n c.Int) c.Int
- func (*BIGNUM) Lshift1(a *BIGNUM) c.Int
- func (*BIGNUM) ModExp(a, p, m *BIGNUM, ctx *BN_CTX) c.Int
- func (*BIGNUM) ModWord(w BN_ULONG) BN_ULONG
- func (*BIGNUM) Mul(r, a, b *BIGNUM, ctx *BN_CTX) c.Int
- func (*BIGNUM) MulWord(w BN_ULONG) c.Int
- func (*BIGNUM) Nnmod(r, m, d *BIGNUM, ctx *BN_CTX) c.Int
- func (*BIGNUM) Rshift(a *BIGNUM, n c.Int) c.Int
- func (*BIGNUM) Rshift1(a *BIGNUM) c.Int
- func (*BIGNUM) SetBit(n c.Int) c.Int
- func (*BIGNUM) SetNegative(n c.Int)
- func (*BIGNUM) SetWord(w BN_ULONG) c.Int
- func (*BIGNUM) SetZero()
- func (bn *BIGNUM) SignedBn2bin(to *byte, tolen c.Int) c.Int
- func (bn *BIGNUM) SignedBn2lebin(to *byte, tolen c.Int) c.Int
- func (bn *BIGNUM) SignedBn2native(to *byte, tolen c.Int) c.Int
- func (*BIGNUM) Sqr(r, a *BIGNUM, ctx *BN_CTX) c.Int
- func (*BIGNUM) Sub(a, b *BIGNUM) c.Int
- func (*BIGNUM) SubWord(w BN_ULONG) c.Int
- func (*BIGNUM) Swap(b *BIGNUM)
- func (*BIGNUM) Uadd(a, b *BIGNUM) c.Int
- func (*BIGNUM) Ucmp(b *BIGNUM) c.Int
- func (*BIGNUM) Usub(a, b *BIGNUM) c.Int
- type BIO
- type BN_CTX
- type BN_GENCB
- type BN_ULONG
- type EVP_MD
- type Errno
- func ERRGetError() Errno
- func ERRGetErrorAll(file **c.Char, line *c.Int, function **c.Char, data **c.Char, flags *c.Int) Errno
- func ERRPeekError() Errno
- func ERRPeekErrorAll(file **c.Char, line *c.Int, function **c.Char, data **c.Char, flags *c.Int) Errno
- func ERRPeekLastError() Errno
- func ERRPeekLastErrorAll(file **c.Char, line *c.Int, function **c.Char, data **c.Char, flags *c.Int) Errno
- type HMAC_CTX
- func (ctx *HMAC_CTX) Copy(sctx *HMAC_CTX) c.Int
- func (ctx *HMAC_CTX) Final(md *byte, len *c.Uint) c.Int
- func (ctx *HMAC_CTX) Free()
- func (ctx *HMAC_CTX) Init(key unsafe.Pointer, len c.Int, md *EVP_MD) c.Int
- func (ctx *HMAC_CTX) InitBytes(key []byte, md *EVP_MD) c.Int
- func (ctx *HMAC_CTX) InitEx(key unsafe.Pointer, len c.Int, md *EVP_MD, impl unsafe.Pointer) c.Int
- func (ctx *HMAC_CTX) InitString(key string, md *EVP_MD) c.Int
- func (ctx *HMAC_CTX) Reset() c.Int
- func (ctx *HMAC_CTX) SetFlags(flags c.Ulong)
- func (ctx *HMAC_CTX) Size() uintptr
- func (ctx *HMAC_CTX) Update(data unsafe.Pointer, len uintptr) c.Int
- func (ctx *HMAC_CTX) UpdateBytes(data []byte) c.Int
- func (ctx *HMAC_CTX) UpdateString(data string) c.Int
- type MD5_CTX
- type MD5_LONG
- type PemPasswordCb
- type RSA
- func (*RSA) Bits() c.Int
- func (*RSA) ClearFlags(flags c.Int)
- func (*RSA) Flags() c.Int
- func (*RSA) Free()
- func (*RSA) GenerateKeyEx(bits c.Int, e *BIGNUM, cb *BN_GENCB) c.Int
- func (*RSA) GenerateMultiPrimeKey(bits, primes c.Int, e *BIGNUM, cb *BN_GENCB) c.Int
- func (*RSA) GetExData(idx c.Int) unsafe.Pointer
- func (*RSA) GetVersion() c.Int
- func (*RSA) SecurityBits() c.Int
- func (*RSA) SetExData(idx c.Int, arg unsafe.Pointer) c.Int
- func (*RSA) SetFlags(flags c.Int)
- func (*RSA) SetMethod(meth *RSA_METHOD) c.Int
- func (*RSA) Size() c.Int
- func (*RSA) TestFlags(flags c.Int) c.Int
- func (*RSA) UpRef() c.Int
- type RSA_METHOD
- func (*RSA_METHOD) Free()
- func (*RSA_METHOD) SetFinish(finish func(rsa *RSA) c.Int) c.Int
- func (*RSA_METHOD) SetInit(init func(rsa *RSA) c.Int) c.Int
- func (*RSA_METHOD) SetModExp(modExp func(r0 *BIGNUM, i *BIGNUM, rsa *RSA, ctx *BN_CTX) c.Int) c.Int
- func (*RSA_METHOD) SetPrivDec(privDec func(flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int) c.Int
- func (*RSA_METHOD) SetPrivEnc(privEnc func(flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int) c.Int
- func (*RSA_METHOD) SetPubDec(pubDec func(flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int) c.Int
- func (*RSA_METHOD) SetPubEnc(pubEnc func(flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int) c.Int
- func (*RSA_METHOD) SetSign(...) c.Int
- func (*RSA_METHOD) SetVerify(...) c.Int
- type SHA224_CTX
- type SHA256_CTX
- type SHA384_CTX
- type SHA512_CTX
- type SHA_CTX
- type SHA_LONG
- type SHA_LONG64
Constants ¶
const ( MD5_CBLOCK = 64 MD5_LBLOCK = MD5_CBLOCK / 4 )
const ( LLGoFiles = "$(pkg-config --cflags openssl): _wrap/openssl.c" LLGoPackage = "link: $(pkg-config --libs openssl); -lssl -lcrypto" )
const ( SHA_DIGEST_LENGTH = 20 SHA_LBLOCK = 16 SHA_CBLOCK = (SHA_LBLOCK * 4) SHA_LAST_BLOCK = (SHA_CBLOCK - 8) SHA256_CBLOCK = (SHA_LBLOCK * 4) SHA256_192_DIGEST_LENGTH = 24 SHA224_DIGEST_LENGTH = 28 SHA256_DIGEST_LENGTH = 32 SHA384_DIGEST_LENGTH = 48 SHA512_DIGEST_LENGTH = 64 SHA512_CBLOCK = (SHA_LBLOCK * 8) )
const (
EVP_MAX_MD_SIZE = 64 /* longest known is SHA512 */
)
Variables ¶
This section is empty.
Functions ¶
func ERRErrorString ¶
ERR_error_string() generates a human-readable string representing the error code e, and places it at buf. buf must be at least 256 bytes long.
char *ERR_error_string(unsigned long e, char *buf);
func ERRLibErrorString ¶
ERR_lib_error_string() and ERR_reason_error_string() return the library name and reason string respectively.
const char *ERR_lib_error_string(unsigned long e);
func ERRPrintErrorsCb ¶
void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u), void *u);
[pid]:error:[error code]:[library name]:[function name]:[reason string]:[filename]:[line]:[optional text message]
func ERRReasonErrorString ¶
const char *ERR_reason_error_string(unsigned long e);
func MD5 ¶
OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);
func RANDBufferWithLen ¶
int RAND_bytes(unsigned char *buf, int num);
func RANDFileName ¶
const char *RAND_file_name(char *file, size_t num);
func RANDKeepRandomDevicesOpen ¶
void RAND_keep_random_devices_open(int keep);
func RANDLoadFile ¶
int RAND_load_file(const char *file, long max_bytes);
func RANDPrivBufferWithLen ¶
int RAND_priv_bytes(unsigned char *buf, int num);
func RANDPrivBytes ¶
func RSAPrivateDecrypt ¶
func RSAPrivateEncrypt ¶
func RSAPublicDecrypt ¶
func RSAPublicEncrypt ¶
// next 4 return -1 on error
OSSL_DEPRECATEDIN_3_0 int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to,
RSA *rsa, int padding);
OSSL_DEPRECATEDIN_3_0 int RSA_private_encrypt(int flen, const unsigned char *from, unsigned char *to,
RSA *rsa, int padding);
OSSL_DEPRECATEDIN_3_0 int RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to,
RSA *rsa, int padding);
OSSL_DEPRECATEDIN_3_0 int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to,
RSA *rsa, int padding);
func RSASign ¶
OSSL_DEPRECATEDIN_3_0 int RSA_sign( int type, const unsigned char *m, unsigned int m_length, unsigned char *sigret, unsigned int *siglen, RSA *rsa);
func SHA1String ¶
func SHA224Bytes ¶
func SHA224String ¶
func SHA256Bytes ¶
func SHA256String ¶
func SHA384Bytes ¶
func SHA384String ¶
func SHA512Bytes ¶
func SHA512String ¶
Types ¶
type BIGNUM ¶
type BIGNUM struct {
Unused [0]byte
}
func BNLebin2bn ¶
BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
func BNNative2bn ¶
BIGNUM *BN_native2bn(const unsigned char *s, int len, BIGNUM *ret);
func BNSignedBin2bn ¶
BIGNUM *BN_signed_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
func BNSignedLebin2bn ¶
BIGNUM *BN_signed_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
func BNSignedNative2bn ¶
BIGNUM *BN_signed_native2bn(const unsigned char *s, int len, BIGNUM *ret);
func (*BIGNUM) AbsIsWord ¶
int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w);
llgo:link (*BIGNUM).AbsIsWord C.BN_abs_is_word
func (*BIGNUM) Add ¶
int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
llgo:link (*BIGNUM).Add C.BN_add
func (*BIGNUM) AddWord ¶
int BN_add_word(BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).AddWord C.BN_add_word
func (*BIGNUM) AreCoprime ¶
int BN_are_coprime(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
llgo:link (*BIGNUM).AreCoprime C.BN_are_coprime
func (*BIGNUM) Bn2bin ¶
int BN_bn2bin(const BIGNUM *a, unsigned char *to);
llgo:link (*BIGNUM).Bn2bin C.BN_bn2bin
func (*BIGNUM) Bn2binpad ¶
int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).Bn2binpad C.BN_bn2binpad
func (*BIGNUM) Bn2lebinpad ¶
int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).Bn2lebinpad C.BN_bn2lebinpad
func (*BIGNUM) Bn2mpi ¶
int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
llgo:link (*BIGNUM).Bn2mpi C.BN_bn2mpi
func (*BIGNUM) Bn2nativepad ¶
int BN_bn2nativepad(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).Bn2nativepad C.BN_bn2nativepad
func (*BIGNUM) Clear ¶
func (*BIGNUM) Clear()
void BN_clear(BIGNUM *a);
llgo:link (*BIGNUM).Clear C.BN_clear
func (*BIGNUM) ClearBit ¶
int BN_clear_bit(BIGNUM *a, int n);
llgo:link (*BIGNUM).ClearBit C.BN_clear_bit
func (*BIGNUM) ClearFree ¶
func (*BIGNUM) ClearFree()
void BN_clear_free(BIGNUM *a);
llgo:link (*BIGNUM).ClearFree C.BN_clear_free
func (*BIGNUM) Copy ¶
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
llgo:link (*BIGNUM).Copy C.BN_copy
func (*BIGNUM) Div ¶
int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
llgo:link (*BIGNUM).Div C.BN_div
func (*BIGNUM) DivWord ¶
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).DivWord C.BN_div_word
func (*BIGNUM) Exp ¶
int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
llgo:link (*BIGNUM).Exp C.BN_exp
func (*BIGNUM) Free ¶
func (*BIGNUM) Free()
void BN_free(BIGNUM *a);
llgo:link (*BIGNUM).Free C.BN_free
func (*BIGNUM) Gcd ¶
int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
llgo:link (*BIGNUM).Gcd C.BN_gcd
func (*BIGNUM) GetWord ¶
BN_ULONG BN_get_word(const BIGNUM *a);
llgo:link (*BIGNUM).GetWord C.BN_get_word
func (*BIGNUM) IsBitSet ¶
int BN_is_bit_set(const BIGNUM *a, int n);
llgo:link (*BIGNUM).IsBitSet C.BN_is_bit_set
func (*BIGNUM) IsNegative ¶
* BN_is_negative returns 1 if the BIGNUM is negative
- \param b pointer to the BIGNUM object
- \return 1 if a < 0 and 0 otherwise
int BN_is_negative(const BIGNUM *b);
llgo:link (*BIGNUM).IsNegative C.BN_is_negative
func (*BIGNUM) IsWord ¶
int BN_is_word(const BIGNUM *a, const BN_ULONG w);
llgo:link (*BIGNUM).IsWord C.BN_is_word
func (*BIGNUM) Lshift ¶
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
llgo:link (*BIGNUM).Lshift C.BN_lshift
func (*BIGNUM) Lshift1 ¶
int BN_lshift1(BIGNUM *r, const BIGNUM *a);
llgo:link (*BIGNUM).Lshift1 C.BN_lshift1
func (*BIGNUM) ModExp ¶
int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx);
llgo:link (*BIGNUM).ModExp C.BN_mod_exp
func (*BIGNUM) ModWord ¶
BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).ModWord C.BN_mod_word
func (*BIGNUM) Mul ¶
int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
llgo:link (*BIGNUM).Mul C.BN_mul
func (*BIGNUM) MulWord ¶
int BN_mul_word(BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).MulWord C.BN_mul_word
func (*BIGNUM) Nnmod ¶
int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
llgo:link (*BIGNUM).Nnmod C.BN_nnmod
func (*BIGNUM) Rshift ¶
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
llgo:link (*BIGNUM).Rshift C.BN_rshift
func (*BIGNUM) Rshift1 ¶
int BN_rshift1(BIGNUM *r, const BIGNUM *a);
llgo:link (*BIGNUM).Rshift1 C.BN_rshift1
func (*BIGNUM) SetNegative ¶
* BN_set_negative sets sign of a BIGNUM
- \param b pointer to the BIGNUM object
- \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise
void BN_set_negative(BIGNUM *b, int n);
llgo:link (*BIGNUM).SetNegative C.BN_set_negative
func (*BIGNUM) SetWord ¶
int BN_set_word(BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).SetWord C.BN_set_word
func (*BIGNUM) SetZero ¶
func (*BIGNUM) SetZero()
void BN_zero_ex(BIGNUM *a);
llgo:link (*BIGNUM).SetZero C.BN_zero_ex
func (*BIGNUM) SignedBn2bin ¶
int BN_signed_bn2bin(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).SignedBn2bin C.BN_signed_bn2bin
func (*BIGNUM) SignedBn2lebin ¶
int BN_signed_bn2lebin(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).SignedBn2lebin C.BN_signed_bn2lebin
func (*BIGNUM) SignedBn2native ¶
int BN_signed_bn2native(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).SignedBn2native C.BN_signed_bn2native
func (*BIGNUM) Sqr ¶
int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
llgo:link (*BIGNUM).Sqr C.BN_sqr
func (*BIGNUM) Sub ¶
int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
llgo:link (*BIGNUM).Sub C.BN_sub
func (*BIGNUM) SubWord ¶
int BN_sub_word(BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).SubWord C.BN_sub_word
func (*BIGNUM) Uadd ¶
int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
llgo:link (*BIGNUM).Uadd C.BN_uadd
type BIO ¶
type BIO struct {
Unused [0]byte
}
func BIONewMemBuf ¶
BIO *BIO_new_mem_buf(const void *buf, int len);
func (*BIO) ReadEx ¶
int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *readbytes);
llgo:link (*BIO).ReadEx C.BIO_read_ex
type BN_CTX ¶
type BN_CTX struct {
Unused [0]byte
}
func (*BN_CTX) End ¶
func (*BN_CTX) End()
void BN_CTX_end(BN_CTX *ctx);
llgo:link (*BN_CTX).End C.BN_CTX_end
func (*BN_CTX) Free ¶
func (*BN_CTX) Free()
void BN_CTX_free(BN_CTX *c);
llgo:link (*BN_CTX).Free C.BN_CTX_free
type Errno ¶
-
- The error code packs differently depending on if it records a system
- error or an OpenSSL error. *
- A system error packs like this (we follow POSIX and only allow positive
- numbers that fit in an |int|): *
- +-+-------------------------------------------------------------+
- |1| system error number |
- +-+-------------------------------------------------------------+ *
- An OpenSSL error packs like this: *
- <---------------------------- 32 bits -------------------------->
- <--- 8 bits ---><------------------ 23 bits ----------------->
- +-+---------------+---------------------------------------------+
- |0| library | reason |
- +-+---------------+---------------------------------------------+ *
- A few of the reason bits are reserved as flags with special meaning: *
- <5 bits-<>--------- 19 bits ----------------->
- +-------+-+-----------------------------------+
- | rflags| | reason |
- +-------+-+-----------------------------------+
- ^
- |
- ERR_RFLAG_FATAL = ERR_R_FATAL *
- The reason flags are part of the overall reason code for practical
- reasons, as they provide an easy way to place different types of
- reason codes in different numeric ranges. *
- The currently known reason flags are: *
- ERR_RFLAG_FATAL Flags that the reason code is considered fatal.
- For backward compatibility reasons, this flag
- is also the code for ERR_R_FATAL (that reason
- code served the dual purpose of flag and reason
- code in one in pre-3.0 OpenSSL).
- ERR_RFLAG_COMMON Flags that the reason code is common to all
- libraries. All ERR_R_ macros must use this flag,
- and no other _R_ macro is allowed to use it.
func ERRGetError ¶
func ERRGetError() Errno
ERR_get_error returns the earliest error code from the thread's error queue and removes the entry. This function can be called repeatedly until there are no more error codes to return.
unsigned long ERR_get_error(void);
func ERRGetErrorAll ¶
func ERRGetErrorAll( file **c.Char, line *c.Int, function **c.Char, data **c.Char, flags *c.Int) Errno
ERR_get_error_all() is the same as ERR_get_error(), but on success it additionally stores the filename, line number and function where the error occurred in *file, *line and *func, and also extra text and flags in *data, *flags. If any of those parameters are NULL, it will not be changed.
unsigned long ERR_get_error_all( const char **file, int *line, const char **func, const char **data, int *flags);
type HMAC_CTX ¶
type HMAC_CTX struct {
Unused [0]byte
}
func (*HMAC_CTX) Copy ¶
OSSL_DEPRECATEDIN_3_0 __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
llgo:link (*HMAC_CTX).Copy C.HMAC_CTX_copy
func (*HMAC_CTX) Final ¶
OSSL_DEPRECATEDIN_3_0 int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
llgo:link (*HMAC_CTX).Final C.HMAC_Final
func (*HMAC_CTX) Free ¶
func (ctx *HMAC_CTX) Free()
OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_free(HMAC_CTX *ctx);
llgo:link (*HMAC_CTX).Free C.HMAC_CTX_free
func (*HMAC_CTX) Init ¶
OSSL_DEPRECATEDIN_1_1_0 __owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md);
llgo:link (*HMAC_CTX).Init C.HMAC_Init
func (*HMAC_CTX) InitEx ¶
OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, ENGINE *impl);
llgo:link (*HMAC_CTX).InitEx C.HMAC_Init_ex
func (*HMAC_CTX) Reset ¶
OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx);
llgo:link (*HMAC_CTX).Reset C.HMAC_CTX_reset
func (*HMAC_CTX) SetFlags ¶
OSSL_DEPRECATEDIN_3_0 void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
llgo:link (*HMAC_CTX).SetFlags C.HMAC_CTX_set_flags
func (*HMAC_CTX) Size ¶
OSSL_DEPRECATEDIN_3_0 size_t HMAC_size(const HMAC_CTX *e);
llgo:link (*HMAC_CTX).Size C.HMAC_size
type MD5_CTX ¶
func (*MD5_CTX) Init ¶
OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
llgo:link (*MD5_CTX).Init C.MD5_Init
type PemPasswordCb ¶
typedef int (*pem_password_cb)(char *buf, int size, int rwflag, void *userdata);
llgo:type C
type RSA ¶
type RSA struct {
Unused [0]byte
}
func PEMReadBioRSAPrivateKey ¶
RSA *PEM_read_bio_RSAPrivateKey(BIO *bp, RSA **x, pem_password_cb *cb, void *u);
func (*RSA) Bits ¶
OSSL_DEPRECATEDIN_3_0 int RSA_bits(const RSA *rsa);
llgo:link (*RSA).Bits C.RSA_bits
func (*RSA) ClearFlags ¶
OSSL_DEPRECATEDIN_3_0 void RSA_clear_flags(RSA *r, int flags);
llgo:link (*RSA).ClearFlags C.RSA_clear_flags
func (*RSA) Flags ¶
OSSL_DEPRECATEDIN_3_0 int RSA_flags(const RSA *r);
llgo:link (*RSA).Flags C.RSA_flags
func (*RSA) Free ¶
func (*RSA) Free()
OSSL_DEPRECATEDIN_3_0 void RSA_free(RSA *r);
llgo:link (*RSA).Free C.RSA_free
func (*RSA) GenerateKeyEx ¶
OSSL_DEPRECATEDIN_3_0 int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
llgo:link (*RSA).GenerateKeyEx C.RSA_generate_key_ex
func (*RSA) GenerateMultiPrimeKey ¶
OSSL_DEPRECATEDIN_3_0 int RSA_generate_multi_prime_key(RSA *rsa, int bits, int primes, BIGNUM *e, BN_GENCB *cb);
llgo:link (*RSA).GenerateMultiPrimeKey C.RSA_generate_multi_prime_key
func (*RSA) GetExData ¶
OSSL_DEPRECATEDIN_3_0 void *RSA_get_ex_data(const RSA *r, int idx);
llgo:link (*RSA).GetExData C.RSA_get_ex_data
func (*RSA) GetVersion ¶
OSSL_DEPRECATEDIN_3_0 int RSA_get_version(RSA *r);
llgo:link (*RSA).GetVersion C.RSA_get_version
func (*RSA) SecurityBits ¶
OSSL_DEPRECATEDIN_3_0 int RSA_security_bits(const RSA *rsa);
llgo:link (*RSA).SecurityBits C.RSA_security_bits
func (*RSA) SetExData ¶
OSSL_DEPRECATEDIN_3_0 int RSA_set_ex_data(RSA *r, int idx, void *arg);
llgo:link (*RSA).SetExData C.RSA_set_ex_data
func (*RSA) SetFlags ¶
OSSL_DEPRECATEDIN_3_0 void RSA_set_flags(RSA *r, int flags);
llgo:link (*RSA).SetFlags C.RSA_set_flags
func (*RSA) SetMethod ¶
func (*RSA) SetMethod(meth *RSA_METHOD) c.Int
OSSL_DEPRECATEDIN_3_0 int RSA_set_method(RSA *rsa, const RSA_METHOD *meth);
llgo:link (*RSA).SetMethod C.RSA_set_method
func (*RSA) Size ¶
OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa);
llgo:link (*RSA).Size C.RSA_size
type RSA_METHOD ¶
type RSA_METHOD struct {
Unused [0]byte
}
func RSAMethNew ¶
func RSAMethNew(name *byte, flags c.Int) *RSA_METHOD
OSSL_DEPRECATEDIN_3_0 RSA_METHOD *RSA_meth_new(const char *name, int flags);
func (*RSA_METHOD) Free ¶
func (*RSA_METHOD) Free()
OSSL_DEPRECATEDIN_3_0 void RSA_meth_free(RSA_METHOD *meth);
llgo:link (*RSA_METHOD).Free C.RSA_meth_free
func (*RSA_METHOD) SetFinish ¶
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_finish(RSA_METHOD *rsa, int (*finish) (RSA *rsa));
llgo:link (*RSA_METHOD).SetFinish C.RSA_meth_set_finish
func (*RSA_METHOD) SetInit ¶
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_init(RSA_METHOD *rsa, int (*init) (RSA *rsa));
llgo:link (*RSA_METHOD).SetInit C.RSA_meth_set_init
func (*RSA_METHOD) SetModExp ¶
func (*RSA_METHOD) SetModExp(modExp func( r0 *BIGNUM, i *BIGNUM, rsa *RSA, ctx *BN_CTX) c.Int) c.Int
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_mod_exp(RSA_METHOD *rsa,
int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx));
llgo:link (*RSA_METHOD).SetModExp C.RSA_meth_set_mod_exp
func (*RSA_METHOD) SetPrivDec ¶
func (*RSA_METHOD) SetPrivDec(privDec func( flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int) c.Int
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_priv_dec(RSA_METHOD *rsa,
int (*priv_dec) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding));
llgo:link (*RSA_METHOD).SetPrivDec C.RSA_meth_set_priv_dec
func (*RSA_METHOD) SetPrivEnc ¶
func (*RSA_METHOD) SetPrivEnc(privEnc func( flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int) c.Int
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_priv_enc(RSA_METHOD *rsa,
int (*priv_enc) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding));
llgo:link (*RSA_METHOD).SetPrivEnc C.RSA_meth_set_priv_enc
func (*RSA_METHOD) SetPubDec ¶
func (*RSA_METHOD) SetPubDec(pubDec func( flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int) c.Int
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_pub_dec(RSA_METHOD *rsa,
int (*pub_dec) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding));
llgo:link (*RSA_METHOD).SetPubDec C.RSA_meth_set_pub_dec
func (*RSA_METHOD) SetPubEnc ¶
func (*RSA_METHOD) SetPubEnc(pubEnc func( flen c.Int, from *byte, to *byte, rsa *RSA, padding c.Int) c.Int) c.Int
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_pub_enc(RSA_METHOD *rsa,
int (*pub_enc) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding));
llgo:link (*RSA_METHOD).SetPubEnc C.RSA_meth_set_pub_enc
func (*RSA_METHOD) SetSign ¶
func (*RSA_METHOD) SetSign(sign func( typ c.Int, msg *byte, mlen c.Uint, sigret *byte, siglen *c.Uint, rsa *RSA) c.Int) c.Int
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_sign(RSA_METHOD *rsa,
int (*sign) (int type, const unsigned char *m, unsigned int m_length, unsigned char *sigret, unsigned int *siglen, const RSA *rsa));
llgo:link (*RSA_METHOD).SetSign C.RSA_meth_set_sign
func (*RSA_METHOD) SetVerify ¶
func (*RSA_METHOD) SetVerify(verify func( dtype c.Int, msg *byte, mlen c.Uint, sigbuf *byte, siglen c.Uint, rsa *RSA) c.Int) c.Int
OSSL_DEPRECATEDIN_3_0 int RSA_meth_set_verify(RSA_METHOD *rsa,
int (*verify) (int dtype, const unsigned char *m, unsigned int m_length, const unsigned char *sigbuf, unsigned int siglen, const RSA *rsa));
llgo:link (*RSA_METHOD).SetVerify C.RSA_meth_set_verify
type SHA224_CTX ¶
type SHA224_CTX SHA256_CTX
func (*SHA224_CTX) Init ¶
func (c *SHA224_CTX) Init() c.Int
OSSL_DEPRECATEDIN_3_0 int SHA224_Init(SHA256_CTX *c);
llgo:link (*SHA224_CTX).Init C.SHA224_Init
func (*SHA224_CTX) Update ¶
OSSL_DEPRECATEDIN_3_0 int SHA224_Update(SHA256_CTX *c, const void *data, size_t len);
llgo:link (*SHA224_CTX).Update C.SHA224_Update
func (*SHA224_CTX) UpdateBytes ¶
func (c *SHA224_CTX) UpdateBytes(data []byte) c.Int
func (*SHA224_CTX) UpdateString ¶
func (c *SHA224_CTX) UpdateString(data string) c.Int
type SHA256_CTX ¶
type SHA256_CTX struct { H [8]SHA_LONG Nl, Nh SHA_LONG Data [SHA_LBLOCK]SHA_LONG Num, MdLen c.Uint }
func (*SHA256_CTX) Init ¶
func (c *SHA256_CTX) Init() c.Int
OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c);
llgo:link (*SHA256_CTX).Init C.SHA256_Init
func (*SHA256_CTX) Transform ¶
func (c *SHA256_CTX) Transform(data *byte)
OSSL_DEPRECATEDIN_3_0 void SHA256_Transform(SHA256_CTX *c, const unsigned char *data);
llgo:link (*SHA256_CTX).Transform C.SHA256_Transform
func (*SHA256_CTX) Update ¶
OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c, const void *data, size_t len);
llgo:link (*SHA256_CTX).Update C.SHA256_Update
func (*SHA256_CTX) UpdateBytes ¶
func (c *SHA256_CTX) UpdateBytes(data []byte) c.Int
func (*SHA256_CTX) UpdateString ¶
func (c *SHA256_CTX) UpdateString(data string) c.Int
type SHA384_CTX ¶
type SHA384_CTX SHA512_CTX
func (*SHA384_CTX) Init ¶
func (c *SHA384_CTX) Init() c.Int
OSSL_DEPRECATEDIN_3_0 int SHA384_Init(SHA512_CTX *c);
llgo:link (*SHA384_CTX).Init C.SHA384_Init
func (*SHA384_CTX) Update ¶
OSSL_DEPRECATEDIN_3_0 int SHA384_Update(SHA512_CTX *c, const void *data, size_t len);
llgo:link (*SHA384_CTX).Update C.SHA384_Update
func (*SHA384_CTX) UpdateBytes ¶
func (c *SHA384_CTX) UpdateBytes(data []byte) c.Int
func (*SHA384_CTX) UpdateString ¶
func (c *SHA384_CTX) UpdateString(data string) c.Int
type SHA512_CTX ¶
type SHA512_CTX struct { H [8]SHA_LONG64 N1, Nh SHA_LONG64 D [SHA_LBLOCK]SHA_LONG64 Num, MdLen c.Uint }
func (*SHA512_CTX) Init ¶
func (c *SHA512_CTX) Init() c.Int
OSSL_DEPRECATEDIN_3_0 int SHA512_Init(SHA512_CTX *c);
llgo:link (*SHA512_CTX).Init C.SHA512_Init
func (*SHA512_CTX) Transform ¶
func (c *SHA512_CTX) Transform(data *byte)
OSSL_DEPRECATEDIN_3_0 void SHA512_Transform(SHA512_CTX *c, const unsigned char *data);
llgo:link (*SHA512_CTX).Transform C.SHA512_Transform
func (*SHA512_CTX) Update ¶
OSSL_DEPRECATEDIN_3_0 int SHA512_Update(SHA512_CTX *c, const void *data, size_t len);
llgo:link (*SHA512_CTX).Update C.SHA512_Update
func (*SHA512_CTX) UpdateBytes ¶
func (c *SHA512_CTX) UpdateBytes(data []byte) c.Int
func (*SHA512_CTX) UpdateString ¶
func (c *SHA512_CTX) UpdateString(data string) c.Int
type SHA_CTX ¶
type SHA_CTX struct {
H0, H1, H2, H3, H4 SHA_LONG
Nl, Nh SHA_LONG
Data [SHA_LBLOCK]SHA_LONG
Num c.Uint
}
func (*SHA_CTX) Init ¶
OSSL_DEPRECATEDIN_3_0 int SHA1_Init(SHA_CTX *c);
llgo:link (*SHA_CTX).Init C.SHA1_Init
func (*SHA_CTX) Transform ¶
OSSL_DEPRECATEDIN_3_0 void SHA1_Transform(SHA_CTX *c, const unsigned char *data);
llgo:link (*SHA_CTX).Transform C.SHA1_Transform