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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ERRPrintErrorsFp ¶ added in v0.9.5
void ERR_print_errors_fp(FILE *fp);
func ERRReasonErrorString ¶ added in v0.9.5
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 ¶ added in v0.9.5
int RAND_bytes(unsigned char *buf, int num);
func RANDFileName ¶ added in v0.9.5
const char *RAND_file_name(char *file, size_t num);
func RANDKeepRandomDevicesOpen ¶ added in v0.9.5
void RAND_keep_random_devices_open(int keep);
func RANDLoadFile ¶ added in v0.9.5
int RAND_load_file(const char *file, long max_bytes);
func RANDPrivBufferWithLen ¶ added in v0.9.5
int RAND_priv_bytes(unsigned char *buf, int num);
func RANDPrivBytes ¶ added in v0.9.5
func RANDWriteFile ¶ added in v0.9.5
int RAND_write_file(const char *file);
func RSAPrivateDecrypt ¶ added in v0.9.5
func RSAPrivateEncrypt ¶ added in v0.9.5
func RSAPublicDecrypt ¶ added in v0.9.5
func RSAPublicEncrypt ¶ added in v0.9.5
// 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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
type BIGNUM struct {
Unused [0]byte
}
func BNLebin2bn ¶ added in v0.9.6
BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
func BNNative2bn ¶ added in v0.9.6
BIGNUM *BN_native2bn(const unsigned char *s, int len, BIGNUM *ret);
func BNSignedBin2bn ¶ added in v0.9.6
BIGNUM *BN_signed_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
func BNSignedLebin2bn ¶ added in v0.9.6
BIGNUM *BN_signed_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
func BNSignedNative2bn ¶ added in v0.9.6
BIGNUM *BN_signed_native2bn(const unsigned char *s, int len, BIGNUM *ret);
func (*BIGNUM) AbsIsWord ¶ added in v0.9.5
int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w);
llgo:link (*BIGNUM).AbsIsWord C.BN_abs_is_word
func (*BIGNUM) Add ¶ added in v0.9.5
int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
llgo:link (*BIGNUM).Add C.BN_add
func (*BIGNUM) AddWord ¶ added in v0.9.5
int BN_add_word(BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).AddWord C.BN_add_word
func (*BIGNUM) AreCoprime ¶ added in v0.9.5
int BN_are_coprime(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
llgo:link (*BIGNUM).AreCoprime C.BN_are_coprime
func (*BIGNUM) Bn2bin ¶ added in v0.9.6
int BN_bn2bin(const BIGNUM *a, unsigned char *to);
llgo:link (*BIGNUM).Bn2bin C.BN_bn2bin
func (*BIGNUM) Bn2binpad ¶ added in v0.9.6
int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).Bn2binpad C.BN_bn2binpad
func (*BIGNUM) Bn2dec ¶ added in v0.9.5
char *BN_bn2dec(const BIGNUM *a);
llgo:link (*BIGNUM).Bn2dec C.BN_bn2dec
func (*BIGNUM) Bn2hex ¶ added in v0.9.5
char *BN_bn2hex(const BIGNUM *a);
llgo:link (*BIGNUM).Bn2hex C.BN_bn2hex
func (*BIGNUM) Bn2lebinpad ¶ added in v0.9.6
int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).Bn2lebinpad C.BN_bn2lebinpad
func (*BIGNUM) Bn2mpi ¶ added in v0.9.6
int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
llgo:link (*BIGNUM).Bn2mpi C.BN_bn2mpi
func (*BIGNUM) Bn2nativepad ¶ added in v0.9.6
int BN_bn2nativepad(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).Bn2nativepad C.BN_bn2nativepad
func (*BIGNUM) Clear ¶ added in v0.9.5
func (*BIGNUM) Clear()
void BN_clear(BIGNUM *a);
llgo:link (*BIGNUM).Clear C.BN_clear
func (*BIGNUM) ClearBit ¶ added in v0.9.5
int BN_clear_bit(BIGNUM *a, int n);
llgo:link (*BIGNUM).ClearBit C.BN_clear_bit
func (*BIGNUM) ClearFree ¶ added in v0.9.5
func (*BIGNUM) ClearFree()
void BN_clear_free(BIGNUM *a);
llgo:link (*BIGNUM).ClearFree C.BN_clear_free
func (*BIGNUM) Cmp ¶ added in v0.9.5
int BN_cmp(const BIGNUM *a, const BIGNUM *b);
llgo:link (*BIGNUM).Cmp C.BN_cmp
func (*BIGNUM) Copy ¶ added in v0.9.5
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
llgo:link (*BIGNUM).Copy C.BN_copy
func (*BIGNUM) Div ¶ added in v0.9.5
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 ¶ added in v0.9.5
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).DivWord C.BN_div_word
func (*BIGNUM) Dup ¶ added in v0.9.5
BIGNUM *BN_dup(const BIGNUM *a);
llgo:link (*BIGNUM).Dup C.BN_dup
func (*BIGNUM) Exp ¶ added in v0.9.5
int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
llgo:link (*BIGNUM).Exp C.BN_exp
func (*BIGNUM) Free ¶ added in v0.9.5
func (*BIGNUM) Free()
void BN_free(BIGNUM *a);
llgo:link (*BIGNUM).Free C.BN_free
func (*BIGNUM) Gcd ¶ added in v0.9.5
int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
llgo:link (*BIGNUM).Gcd C.BN_gcd
func (*BIGNUM) GetWord ¶ added in v0.9.5
BN_ULONG BN_get_word(const BIGNUM *a);
llgo:link (*BIGNUM).GetWord C.BN_get_word
func (*BIGNUM) IsBitSet ¶ added in v0.9.5
int BN_is_bit_set(const BIGNUM *a, int n);
llgo:link (*BIGNUM).IsBitSet C.BN_is_bit_set
func (*BIGNUM) IsNegative ¶ added in v0.9.5
* 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) IsOdd ¶ added in v0.9.5
int BN_is_odd(const BIGNUM *a);
llgo:link (*BIGNUM).IsOdd C.BN_is_odd
func (*BIGNUM) IsOne ¶ added in v0.9.5
int BN_is_one(const BIGNUM *a);
llgo:link (*BIGNUM).IsOne C.BN_is_one
func (*BIGNUM) IsWord ¶ added in v0.9.5
int BN_is_word(const BIGNUM *a, const BN_ULONG w);
llgo:link (*BIGNUM).IsWord C.BN_is_word
func (*BIGNUM) IsZero ¶ added in v0.9.5
int BN_is_zero(const BIGNUM *a);
llgo:link (*BIGNUM).IsZero C.BN_is_zero
func (*BIGNUM) Lshift ¶ added in v0.9.5
int BN_lshift(BIGNUM *r, const BIGNUM *a, int n);
llgo:link (*BIGNUM).Lshift C.BN_lshift
func (*BIGNUM) Lshift1 ¶ added in v0.9.5
int BN_lshift1(BIGNUM *r, const BIGNUM *a);
llgo:link (*BIGNUM).Lshift1 C.BN_lshift1
func (*BIGNUM) ModExp ¶ added in v0.9.5
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 ¶ added in v0.9.5
BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).ModWord C.BN_mod_word
func (*BIGNUM) Mul ¶ added in v0.9.5
int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
llgo:link (*BIGNUM).Mul C.BN_mul
func (*BIGNUM) MulWord ¶ added in v0.9.5
int BN_mul_word(BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).MulWord C.BN_mul_word
func (*BIGNUM) Nnmod ¶ added in v0.9.5
int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
llgo:link (*BIGNUM).Nnmod C.BN_nnmod
func (*BIGNUM) Rshift ¶ added in v0.9.5
int BN_rshift(BIGNUM *r, const BIGNUM *a, int n);
llgo:link (*BIGNUM).Rshift C.BN_rshift
func (*BIGNUM) Rshift1 ¶ added in v0.9.5
int BN_rshift1(BIGNUM *r, const BIGNUM *a);
llgo:link (*BIGNUM).Rshift1 C.BN_rshift1
func (*BIGNUM) SetBit ¶ added in v0.9.5
int BN_set_bit(BIGNUM *a, int n);
llgo:link (*BIGNUM).SetBit C.BN_set_bit
func (*BIGNUM) SetNegative ¶ added in v0.9.5
* 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 ¶ added in v0.9.5
int BN_set_word(BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).SetWord C.BN_set_word
func (*BIGNUM) SetZero ¶ added in v0.9.5
func (*BIGNUM) SetZero()
void BN_zero_ex(BIGNUM *a);
llgo:link (*BIGNUM).SetZero C.BN_zero_ex
func (*BIGNUM) SignedBn2bin ¶ added in v0.9.6
int BN_signed_bn2bin(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).SignedBn2bin C.BN_signed_bn2bin
func (*BIGNUM) SignedBn2lebin ¶ added in v0.9.6
int BN_signed_bn2lebin(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).SignedBn2lebin C.BN_signed_bn2lebin
func (*BIGNUM) SignedBn2native ¶ added in v0.9.6
int BN_signed_bn2native(const BIGNUM *a, unsigned char *to, int tolen);
llgo:link (*BIGNUM).SignedBn2native C.BN_signed_bn2native
func (*BIGNUM) Sqr ¶ added in v0.9.5
int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);
llgo:link (*BIGNUM).Sqr C.BN_sqr
func (*BIGNUM) Sub ¶ added in v0.9.5
int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
llgo:link (*BIGNUM).Sub C.BN_sub
func (*BIGNUM) SubWord ¶ added in v0.9.5
int BN_sub_word(BIGNUM *a, BN_ULONG w);
llgo:link (*BIGNUM).SubWord C.BN_sub_word
func (*BIGNUM) Swap ¶ added in v0.9.5
void BN_swap(BIGNUM *a, BIGNUM *b);
llgo:link (*BIGNUM).Swap C.BN_swap
func (*BIGNUM) Uadd ¶ added in v0.9.5
int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
llgo:link (*BIGNUM).Uadd C.BN_uadd
type BIO ¶ added in v0.9.5
type BIO struct {
Unused [0]byte
}
func BIONewMemBuf ¶ added in v0.9.5
BIO *BIO_new_mem_buf(const void *buf, int len);
func (*BIO) ReadEx ¶ added in v0.9.5
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 ¶ added in v0.9.5
type BN_CTX struct {
Unused [0]byte
}
func BN_CTXSecureNew ¶ added in v0.9.5
func BN_CTXSecureNew() *BN_CTX
BN_CTX *BN_CTX_secure_new(void);
func (*BN_CTX) End ¶ added in v0.9.6
func (*BN_CTX) End()
void BN_CTX_end(BN_CTX *ctx);
llgo:link (*BN_CTX).End C.BN_CTX_end
func (*BN_CTX) Free ¶ added in v0.9.5
func (*BN_CTX) Free()
void BN_CTX_free(BN_CTX *c);
llgo:link (*BN_CTX).Free C.BN_CTX_free
type EVP_MD ¶ added in v0.9.5
type EVP_MD struct {
Unused [0]byte
}
func EVP_sha512_224 ¶ added in v0.9.5
func EVP_sha512_224() *EVP_MD
const EVP_MD *EVP_sha512_224(void)
func EVP_sha512_256 ¶ added in v0.9.5
func EVP_sha512_256() *EVP_MD
const EVP_MD *EVP_sha512_256(void)
type Errno ¶ added in v0.9.5
-
- 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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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);
func ERRPeekErrorAll ¶ added in v0.9.5
func ERRPeekErrorAll( file **c.Char, line *c.Int, function **c.Char, data **c.Char, flags *c.Int) Errno
unsigned long ERR_peek_error_all( const char **file, int *line, const char **func, const char **data, int *flags);
func ERRPeekLastError ¶ added in v0.9.5
func ERRPeekLastError() Errno
unsigned long ERR_peek_last_error(void);
type HMAC_CTX ¶ added in v0.9.5
type HMAC_CTX struct {
Unused [0]byte
}
func NewHMAC_CTX ¶ added in v0.9.5
func NewHMAC_CTX() *HMAC_CTX
OSSL_DEPRECATEDIN_3_0 HMAC_CTX *HMAC_CTX_new(void);
func (*HMAC_CTX) Copy ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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) InitString ¶ added in v0.9.5
func (*HMAC_CTX) Reset ¶ added in v0.9.5
OSSL_DEPRECATEDIN_3_0 int HMAC_CTX_reset(HMAC_CTX *ctx);
llgo:link (*HMAC_CTX).Reset C.HMAC_CTX_reset
func (*HMAC_CTX) SetFlags ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
typedef int (*pem_password_cb)(char *buf, int size, int rwflag, void *userdata);
llgo:type C
type RSA ¶ added in v0.9.5
type RSA struct {
Unused [0]byte
}
func PEMReadBioRSAPrivateKey ¶ added in v0.9.5
RSA *PEM_read_bio_RSAPrivateKey(BIO *bp, RSA **x, pem_password_cb *cb, void *u);
func (*RSA) Bits ¶ added in v0.9.5
OSSL_DEPRECATEDIN_3_0 int RSA_bits(const RSA *rsa);
llgo:link (*RSA).Bits C.RSA_bits
func (*RSA) ClearFlags ¶ added in v0.9.5
OSSL_DEPRECATEDIN_3_0 void RSA_clear_flags(RSA *r, int flags);
llgo:link (*RSA).ClearFlags C.RSA_clear_flags
func (*RSA) Flags ¶ added in v0.9.5
OSSL_DEPRECATEDIN_3_0 int RSA_flags(const RSA *r);
llgo:link (*RSA).Flags C.RSA_flags
func (*RSA) Free ¶ added in v0.9.5
func (*RSA) Free()
OSSL_DEPRECATEDIN_3_0 void RSA_free(RSA *r);
llgo:link (*RSA).Free C.RSA_free
func (*RSA) GenerateKeyEx ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
OSSL_DEPRECATEDIN_3_0 int RSA_get_version(RSA *r);
llgo:link (*RSA).GetVersion C.RSA_get_version
func (*RSA) SecurityBits ¶ added in v0.9.5
OSSL_DEPRECATEDIN_3_0 int RSA_security_bits(const RSA *rsa);
llgo:link (*RSA).SecurityBits C.RSA_security_bits
func (*RSA) SetExData ¶ added in v0.9.5
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 ¶ added in v0.9.5
OSSL_DEPRECATEDIN_3_0 void RSA_set_flags(RSA *r, int flags);
llgo:link (*RSA).SetFlags C.RSA_set_flags
func (*RSA) SetMethod ¶ added in v0.9.5
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 ¶ added in v0.9.5
OSSL_DEPRECATEDIN_3_0 int RSA_size(const RSA *rsa);
llgo:link (*RSA).Size C.RSA_size
type RSA_METHOD ¶ added in v0.9.5
type RSA_METHOD struct {
Unused [0]byte
}
func RSAMethNew ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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 ¶ added in v0.9.5
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