(b76ad15ed0da636161de0243c547ee1e6fc95681)
#include "ossl.h"
#include <ruby/ractor.h>
Go to the source code of this file.
◆ BIGNUM_1c
#define BIGNUM_1c |
( |
|
func | ) |
|
Value: static VALUE \
ossl_bn_##func(
VALUE self) \
{ \
BIGNUM *bn, *result; \
VALUE obj; \
GetBN(self, bn); \
if (!(result = BN_new())) { \
} \
BN_free(result); \
} \
SetBN(obj, result); \
return obj; \
}
Definition at line 467 of file ossl_bn.c.
◆ BIGNUM_2
Value: static VALUE \
{ \
BIGNUM *bn1, *bn2 =
GetBNPtr(other), *result; \
VALUE obj; \
GetBN(self, bn1); \
if (!(result = BN_new())) { \
} \
if (BN_##func(result, bn1, bn2) <= 0) { \
BN_free(result); \
} \
SetBN(obj, result); \
return obj; \
}
◆ BIGNUM_2c
#define BIGNUM_2c |
( |
|
func | ) |
|
Value: static VALUE \
{ \
BIGNUM *bn1, *bn2 =
GetBNPtr(other), *result; \
VALUE obj; \
GetBN(self, bn1); \
if (!(result = BN_new())) { \
} \
BN_free(result); \
} \
SetBN(obj, result); \
return obj; \
}
◆ BIGNUM_3c
#define BIGNUM_3c |
( |
|
func | ) |
|
Value: static VALUE \
{ \
BIGNUM *bn3 =
GetBNPtr(other2), *result; \
VALUE obj; \
GetBN(self, bn1); \
if (!(result = BN_new())) { \
} \
if (BN_##func(result, bn1, bn2, bn3,
ossl_bn_ctx) <= 0) { \
BN_free(result); \
} \
SetBN(obj, result); \
return obj; \
}
Definition at line 632 of file ossl_bn.c.
◆ BIGNUM_BIT
#define BIGNUM_BIT |
( |
|
func | ) |
|
Value: static VALUE \
{ \
BIGNUM *bn; \
GetBN(self, bn); \
if (BN_##func(bn,
NUM2INT(bit)) <= 0) { \
} \
return self; \
}
◆ BIGNUM_BOOL1
#define BIGNUM_BOOL1 |
( |
|
func | ) |
|
Value: static VALUE \
ossl_bn_##func(
VALUE self) \
{ \
BIGNUM *bn; \
GetBN(self, bn); \
if (BN_##func(bn)) { \
} \
}
Definition at line 419 of file ossl_bn.c.
◆ BIGNUM_CMP
#define BIGNUM_CMP |
( |
|
func | ) |
|
Value: static VALUE \
{ \
GetBN(self, bn1); \
return
INT2NUM(BN_##func(bn1, bn2)); \
}
Definition at line 1013 of file ossl_bn.c.
◆ BIGNUM_NUM
#define BIGNUM_NUM |
( |
|
func | ) |
|
Value: static VALUE \
ossl_bn_##func(
VALUE self) \
{ \
BIGNUM *bn; \
GetBN(self, bn); \
}
Definition at line 913 of file ossl_bn.c.
◆ BIGNUM_RAND
#define BIGNUM_RAND |
( |
|
func | ) |
|
Value: static VALUE \
{ \
BIGNUM *result; \
int bottom = 0,
top = 0, b; \
VALUE bits, fill, odd, obj; \
\
case 3: \
bottom = (odd ==
Qtrue) ? 1 : 0; \
\
case 2: \
} \
if (!(result = BN_new())) { \
} \
if (BN_##func(result, b,
top, bottom) <= 0) { \
BN_free(result); \
} \
SetBN(obj, result); \
return obj; \
}
Definition at line 795 of file ossl_bn.c.
◆ BIGNUM_RAND_RANGE
#define BIGNUM_RAND_RANGE |
( |
|
func | ) |
|
Value: static VALUE \
{ \
VALUE obj =
NewBN(klass); \
if (!(result = BN_new())) { \
} \
if (BN_##func##_range(result, bn) <= 0) { \
BN_free(result); \
} \
SetBN(obj, result); \
return obj; \
}
Definition at line 835 of file ossl_bn.c.
◆ BIGNUM_SELF_SHIFT
#define BIGNUM_SELF_SHIFT |
( |
|
func | ) |
|
Value: static VALUE \
{ \
BIGNUM *bn; \
int b; \
GetBN(self, bn); \
if (BN_##func(bn, bn, b) <= 0) \
return self; \
}
Definition at line 768 of file ossl_bn.c.
◆ BIGNUM_SHIFT
#define BIGNUM_SHIFT |
( |
|
func | ) |
|
Value: static VALUE \
{ \
BIGNUM *bn, *result; \
int b; \
VALUE obj; \
GetBN(self, bn); \
if (!(result = BN_new())) { \
} \
if (BN_##func(result, bn, b) <= 0) { \
BN_free(result); \
} \
SetBN(obj, result); \
return obj; \
}
Definition at line 733 of file ossl_bn.c.
◆ GetBN
#define GetBN |
( |
|
obj, |
|
|
|
bn |
|
) |
| |
Value: do { \
TypedData_Get_Struct((obj), BIGNUM, &ossl_bn_type, (bn)); \
if (!(bn)) { \
} \
} while (0)
Definition at line 26 of file ossl_bn.c.
◆ NewBN
◆ SetBN
#define SetBN |
( |
|
obj, |
|
|
|
bn |
|
) |
| |
Value: do { \
if (!(bn)) { \
} \
RTYPEDDATA_DATA(obj) = (bn); \
} while (0)
Definition at line 19 of file ossl_bn.c.
◆ BIGNUM_1c()
◆ BIGNUM_3c()
◆ Init_ossl_bn()
void Init_ossl_bn |
( |
void |
| ) |
|
Definition at line 1234 of file ossl_bn.c.
References cBN, eBNError, eOSSLError, mOSSL, ossl_bn_ctx_get(), ossl_bn_ctx_key, ossl_bn_ctx_key_type, rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_module(), rb_eStandardError, and rb_ractor_local_storage_ptr_newkey().
◆ ossl_bn_ctx_free()
void ossl_bn_ctx_free |
( |
void * |
ptr | ) |
|
◆ ossl_bn_ctx_get()
BN_CTX* ossl_bn_ctx_get |
( |
void |
| ) |
|
◆ ossl_bn_new()
◆ ossl_bn_value_ptr()
BIGNUM* ossl_bn_value_ptr |
( |
volatile VALUE * |
ptr | ) |
|
◆ cBN
◆ eBNError
◆ ossl_bn_ctx_key
◆ ossl_bn_ctx_key_type