Home
last modified time | relevance | path

Searched refs:bn (Results 1 – 25 of 271) sorted by relevance

1234567891011

/external/boringssl/src/crypto/bn/
Dbn.c69 BIGNUM *bn = OPENSSL_malloc(sizeof(BIGNUM)); in BN_new() local
71 if (bn == NULL) { in BN_new()
76 memset(bn, 0, sizeof(BIGNUM)); in BN_new()
77 bn->flags = BN_FLG_MALLOCED; in BN_new()
79 return bn; in BN_new()
82 void BN_init(BIGNUM *bn) { in BN_init() argument
83 memset(bn, 0, sizeof(BIGNUM)); in BN_init()
86 void BN_free(BIGNUM *bn) { in BN_free() argument
87 if (bn == NULL) { in BN_free()
91 if ((bn->flags & BN_FLG_STATIC_DATA) == 0) { in BN_free()
[all …]
Dcmp.c175 int BN_abs_is_word(const BIGNUM *bn, BN_ULONG w) { in BN_abs_is_word() argument
176 switch (bn->top) { in BN_abs_is_word()
178 return bn->d[0] == w; in BN_abs_is_word()
186 int BN_is_zero(const BIGNUM *bn) { in BN_is_zero() argument
187 return bn->top == 0; in BN_is_zero()
190 int BN_is_one(const BIGNUM *bn) { in BN_is_one() argument
191 return bn->neg == 0 && BN_abs_is_word(bn, 1); in BN_is_one()
194 int BN_is_word(const BIGNUM *bn, BN_ULONG w) { in BN_is_word() argument
195 return BN_abs_is_word(bn, w) && (w == 0 || bn->neg == 0); in BN_is_word()
198 int BN_is_odd(const BIGNUM *bn) { in BN_is_odd() argument
[all …]
Dconvert.c72 BIGNUM *bn = NULL; in BN_bin2bn() local
75 ret = bn = BN_new(); in BN_bin2bn()
90 if (bn) { in BN_bin2bn()
91 BN_free(bn); in BN_bin2bn()
194 char *BN_bn2hex(const BIGNUM *bn) { in BN_bn2hex() argument
199 buf = (char *)OPENSSL_malloc(bn->top * BN_BYTES * 2 + 2); in BN_bn2hex()
206 if (bn->neg) { in BN_bn2hex()
210 if (BN_is_zero(bn)) { in BN_bn2hex()
214 for (i = bn->top - 1; i >= 0; i--) { in BN_bn2hex()
217 v = ((int)(bn->d[i] >> (long)j)) & 0xff; in BN_bn2hex()
[all …]
Dbn_test.cc1452 ScopedBIGNUM bn; in test_dec2bn() local
1453 int ret = DecimalToBIGNUM(&bn, "0"); in test_dec2bn()
1454 if (ret != 1 || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) { in test_dec2bn()
1459 ret = DecimalToBIGNUM(&bn, "256"); in test_dec2bn()
1460 if (ret != 3 || !BN_is_word(bn.get(), 256) || BN_is_negative(bn.get())) { in test_dec2bn()
1465 ret = DecimalToBIGNUM(&bn, "-42"); in test_dec2bn()
1466 if (ret != 3 || !BN_abs_is_word(bn.get(), 42) || !BN_is_negative(bn.get())) { in test_dec2bn()
1471 ret = DecimalToBIGNUM(&bn, "-0"); in test_dec2bn()
1472 if (ret != 2 || !BN_is_zero(bn.get()) || BN_is_negative(bn.get())) { in test_dec2bn()
1477 ret = DecimalToBIGNUM(&bn, "42trailing garbage is ignored"); in test_dec2bn()
[all …]
DCMakeLists.txt20 bn-586.${ASM_EXT}
35 bn target
41 bn.c
64 perlasm(bn-586.${ASM_EXT} asm/bn-586.pl)
Dctx.c244 BIGNUM *bn = p->head->vals; in BN_POOL_finish() local
246 if (bn->d) { in BN_POOL_finish()
247 BN_clear_free(bn); in BN_POOL_finish()
249 bn++; in BN_POOL_finish()
260 BIGNUM *bn; in BN_POOL_get() local
268 bn = item->vals; in BN_POOL_get()
270 BN_init(bn++); in BN_POOL_get()
Dmul.c795 int BN_mul_word(BIGNUM *bn, BN_ULONG w) { in BN_mul_word() argument
799 if (!bn->top) { in BN_mul_word()
804 BN_zero(bn); in BN_mul_word()
808 ll = bn_mul_words(bn->d, bn->d, bn->top, w); in BN_mul_word()
810 if (bn_wexpand(bn, bn->top + 1) == NULL) { in BN_mul_word()
813 bn->d[bn->top++] = ll; in BN_mul_word()
/external/google-tv-pairing-protocol/cpp/src/polo/util/
Dpoloutil.cc25 BIGNUM* bn = BN_bin2bn(bytes, length, NULL); in BytesToHexString() local
26 char* hex = BN_bn2hex(bn); in BytesToHexString()
28 BN_free(bn); in BytesToHexString()
36 BIGNUM* bn = NULL; in HexStringToBytes() local
37 BN_hex2bn(&bn, hex_string.c_str()); in HexStringToBytes()
38 int length = BN_num_bytes(bn); in HexStringToBytes()
40 BN_bn2bin(bn, &bytes[0]); in HexStringToBytes()
41 BN_free(bn); in HexStringToBytes()
48 BIGNUM* bn = BN_new(); in IntToBigEndianBytes() local
49 BN_add_word(bn, value); in IntToBigEndianBytes()
[all …]
/external/boringssl/src/include/openssl/
Dbn.h171 OPENSSL_EXPORT void BN_init(BIGNUM *bn);
175 OPENSSL_EXPORT void BN_free(BIGNUM *bn);
179 OPENSSL_EXPORT void BN_clear_free(BIGNUM *bn);
189 OPENSSL_EXPORT void BN_clear(BIGNUM *bn);
206 OPENSSL_EXPORT unsigned BN_num_bits(const BIGNUM *bn);
210 OPENSSL_EXPORT unsigned BN_num_bytes(const BIGNUM *bn);
213 OPENSSL_EXPORT void BN_zero(BIGNUM *bn);
217 OPENSSL_EXPORT int BN_one(BIGNUM *bn);
221 OPENSSL_EXPORT int BN_set_word(BIGNUM *bn, BN_ULONG value);
224 OPENSSL_EXPORT void BN_set_negative(BIGNUM *bn, int sign);
[all …]
/external/boringssl/src/crypto/asn1/
Dx_bignum.c111 BIGNUM *bn; in bn_i2c() local
114 bn = (BIGNUM *)*pval; in bn_i2c()
116 if(BN_num_bits(bn) & 0x7) pad = 0; in bn_i2c()
120 BN_bn2bin(bn, cont); in bn_i2c()
122 return pad + BN_num_bytes(bn); in bn_i2c()
128 BIGNUM *bn; in bn_c2i() local
136 bn = (BIGNUM *)*pval; in bn_c2i()
137 if(!BN_bin2bn(cont, len, bn)) { in bn_c2i()
Da_enum.c139 ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai) in BN_to_ASN1_ENUMERATED() argument
153 if(BN_is_negative(bn)) ret->type = V_ASN1_NEG_ENUMERATED; in BN_to_ASN1_ENUMERATED()
155 j=BN_num_bits(bn); in BN_to_ASN1_ENUMERATED()
168 ret->length=BN_bn2bin(bn,ret->data); in BN_to_ASN1_ENUMERATED()
175 BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn) in ASN1_ENUMERATED_to_BN() argument
179 if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL) in ASN1_ENUMERATED_to_BN()
Da_int.c405 ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai) in BN_to_ASN1_INTEGER() argument
419 if (BN_is_negative(bn) && !BN_is_zero(bn)) in BN_to_ASN1_INTEGER()
422 j=BN_num_bits(bn); in BN_to_ASN1_INTEGER()
434 ret->length=BN_bn2bin(bn,ret->data); in BN_to_ASN1_INTEGER()
447 BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn) in ASN1_INTEGER_to_BN() argument
451 if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL) in ASN1_INTEGER_to_BN()
Dtasn_prn.c482 BIGNUM *bn = NULL; in asn1_print_integer_ctx() local
486 bn = ASN1_INTEGER_to_BN(str, NULL); in asn1_print_integer_ctx()
487 if (bn == NULL) { in asn1_print_integer_ctx()
490 s = BN_bn2dec(bn); in asn1_print_integer_ctx()
491 BN_free(bn); in asn1_print_integer_ctx()
/external/boringssl/
Dsources.mk70 src/crypto/bn/add.c\
71 src/crypto/bn/asm/x86_64-gcc.c\
72 src/crypto/bn/bn.c\
73 src/crypto/bn/cmp.c\
74 src/crypto/bn/convert.c\
75 src/crypto/bn/ctx.c\
76 src/crypto/bn/div.c\
77 src/crypto/bn/exponentiation.c\
78 src/crypto/bn/gcd.c\
79 src/crypto/bn/generic.c\
[all …]
Dandroid_compat_hacks.c31 BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn) { in get_rfc3526_prime_1536() argument
32 assert(bn == NULL); in get_rfc3526_prime_1536()
/external/ipsec-tools/src/racoon/
Dprsa_tok.l64 BIGNUM *bn = BN_new(); variable
65 BN_hex2bn(&bn, prsatext+2);
66 prsalval.bn = bn;
/external/icu/icu4c/source/data/locales/
Dse.txt136 one{"0 bn"}
137 other{"0 bn"}
138 two{"0 bn"}
141 one{"00 bn"}
142 other{"00 bn"}
143 two{"00 bn"}
146 one{"000 bn"}
147 other{"000 bn"}
148 two{"000 bn"}
Dfo.txt121 one{"0 bn"}
122 other{"0 bn"}
125 one{"00 bn"}
126 other{"00 bn"}
129 one{"000 bn"}
130 other{"000 bn"}
/external/icu/icu4c/source/data/coll/
Dbn.txt6 // * Source File: <path>/common/collation/bn.xml
9 bn{
/external/xmp_toolkit/XMPCore/src/com/adobe/xmp/impl/
DXMPNormalizer.java542 bn = baseNode.iterateChildren(); in compareAliasedSubtrees()
543 an.hasNext() && bn.hasNext();) in compareAliasedSubtrees()
546 XMPNode baseChild = (XMPNode) bn.next(); in compareAliasedSubtrees()
552 bn = baseNode.iterateQualifier(); in compareAliasedSubtrees()
553 an.hasNext() && bn.hasNext();) in compareAliasedSubtrees()
556 XMPNode baseQual = (XMPNode) bn.next(); in compareAliasedSubtrees()
/external/libvorbis/lib/
Dfloor1.c49 int bn; member
466 a->bn=nb; in accumulate_fit()
473 double xb=0,yb=0,x2b=0,y2b=0,xyb=0,bn=0; in fit_line() local
479 double weight = (a[i].bn+a[i].an)*info->twofitweight/(a[i].an+1)+1.; in fit_line()
486 bn+=a[i].bn + a[i].an * weight; in fit_line()
495 bn++; in fit_line()
504 bn++; in fit_line()
508 double denom=(bn*x2b-xb*xb); in fit_line()
512 double b=(bn*xyb-xb*yb)/denom; in fit_line()
/external/boringssl/src/crypto/x509v3/
Dv3_utl.c167 BIGNUM *bn = NULL; in s2i_ASN1_INTEGER() local
175 bn = BN_new(); in s2i_ASN1_INTEGER()
186 if (ishex) ret = BN_hex2bn(&bn, value); in s2i_ASN1_INTEGER()
187 else ret = BN_dec2bn(&bn, value); in s2i_ASN1_INTEGER()
190 BN_free(bn); in s2i_ASN1_INTEGER()
195 if (isneg && BN_is_zero(bn)) isneg = 0; in s2i_ASN1_INTEGER()
197 aint = BN_to_ASN1_INTEGER(bn, NULL); in s2i_ASN1_INTEGER()
198 BN_free(bn); in s2i_ASN1_INTEGER()
/external/icu/icu4c/source/data/region/
Dbn.txt6 // * Source File: <path>/common/main/bn.xml
9 bn{
/external/icu/icu4c/source/data/lang/
Dsw_CD.txt12 bn{"Kibangla"}
/external/wpa_supplicant_8/src/common/
Dsae.c119 struct crypto_bignum *bn = NULL; in sae_get_rand() local
131 bn = crypto_bignum_init_set(val, order_len); in sae_get_rand()
132 if (bn == NULL) in sae_get_rand()
134 if (crypto_bignum_is_zero(bn) || in sae_get_rand()
135 crypto_bignum_is_one(bn) || in sae_get_rand()
136 crypto_bignum_cmp(bn, sae->tmp->order) >= 0) { in sae_get_rand()
137 crypto_bignum_deinit(bn, 0); in sae_get_rand()
144 return bn; in sae_get_rand()

1234567891011