Home | History | Annotate | Download | only in bn

Lines Matching defs:bn

57 #include <openssl/bn.h>
71 BIGNUM *bn = NULL;
74 ret = bn = BN_new();
89 if (bn) {
90 BN_free(bn);
193 char *BN_bn2hex(const BIGNUM *bn) {
198 buf = (char *)OPENSSL_malloc(bn->top * BN_BYTES * 2 + 2);
200 OPENSSL_PUT_ERROR(BN, BN_bn2hex, ERR_R_MALLOC_FAILURE);
205 if (bn->neg) {
209 if (BN_is_zero(bn)) {
213 for (i = bn->top - 1; i >= 0; i--) {
216 v = ((int)(bn->d[i] >> (long)j)) & 0xff;
229 /* decode_hex decodes |i| bytes of hex data from |in| and updates |bn|. */
230 static void decode_hex(BIGNUM *bn, const char *in, int i) {
254 bn->d[h++] = l;
262 bn->top = h;
265 /* decode_dec decodes |i| bytes of decimal data from |in| and updates |bn|. */
266 static void decode_dec(BIGNUM *bn, const char *in, int i) {
280 BN_mul_word(bn, BN_DEC_CONV);
281 BN_add_word(bn, l);
288 typedef void (*decode_func) (BIGNUM *bn, const char *in, int i);
366 OPENSSL_PUT_ERROR(BN, BN_bn2dec, ERR_R_MALLOC_FAILURE);
494 BN_ULONG BN_get_word(const BIGNUM *bn) {
495 switch (bn->top) {
499 return bn->d[0];