/openssl/test/ |
H A D | bntests.pl | 17 sub bn subroutine 34 my $a = bn($s{'A'}); 35 my $b = bn($s{'B'}); 40 my $a = bn($s{'A'}); 45 my $a = bn($s{'A'}); 46 my $n = bn($s{'N'}); 51 my $a = bn($s{'A'}); 52 my $n = bn($s{'N'}); 57 my $a = bn($s{'A'}); 81 $a = bn($s{'A'}); [all …]
|
H A D | bn_internal_test.c | 31 BIGNUM *bn = NULL; in test_is_prime_enhanced() local 33 ret = TEST_ptr(bn = BN_new()) in test_is_prime_enhanced() 35 && TEST_true(BN_set_word(bn, 11)) in test_is_prime_enhanced() 37 && TEST_true(ossl_bn_miller_rabin_is_prime(bn, 10, ctx, NULL, 1, in test_is_prime_enhanced() 40 BN_free(bn); in test_is_prime_enhanced() 52 BIGNUM *bn = NULL; in test_is_composite_enhanced() local 54 ret = TEST_ptr(bn = BN_new()) in test_is_composite_enhanced() 56 && TEST_true(BN_set_word(bn, composites[id])) in test_is_composite_enhanced() 57 && TEST_true(ossl_bn_miller_rabin_is_prime(bn, 10, ctx, NULL, 1, in test_is_composite_enhanced() 61 BN_free(bn); in test_is_composite_enhanced()
|
H A D | bntest.c | 342 return bn; in set_signed_bn() 2010 bn = NULL; in test_dec2bn() 2020 bn = NULL; in test_dec2bn() 2030 bn = NULL; in test_dec2bn() 2041 bn = NULL; in test_dec2bn() 2050 bn = NULL; in test_dec2bn() 2077 bn = NULL; in test_hex2bn() 2087 bn = NULL; in test_hex2bn() 2097 bn = NULL; in test_hex2bn() 2107 bn = NULL; in test_hex2bn() [all …]
|
/openssl/crypto/bn/ |
H A D | bn_const.c | 25 BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn) in BN_get_rfc2409_prime_768() argument 53 BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn) in BN_get_rfc2409_prime_1024() argument 85 BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn) in BN_get_rfc3526_prime_1536() argument 87 return COPY_BN(bn, ossl_bignum_modp_1536_p); in BN_get_rfc3526_prime_1536() 98 BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn) in BN_get_rfc3526_prime_2048() argument 100 return COPY_BN(bn, ossl_bignum_modp_2048_p); in BN_get_rfc3526_prime_2048() 111 BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn) in BN_get_rfc3526_prime_3072() argument 113 return COPY_BN(bn, ossl_bignum_modp_3072_p); in BN_get_rfc3526_prime_3072() 124 BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn) in BN_get_rfc3526_prime_4096() argument 137 BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn) in BN_get_rfc3526_prime_6144() argument [all …]
|
H A D | bn_conv.c | 141 if (bn == NULL) in BN_hex2bn() 145 if (*bn == NULL) { in BN_hex2bn() 149 ret = *bn; in BN_hex2bn() 184 *bn = ret; in BN_hex2bn() 191 if (*bn == NULL) in BN_hex2bn() 217 if (bn == NULL) in BN_dec2bn() 224 if (*bn == NULL) { in BN_dec2bn() 228 ret = *bn; in BN_dec2bn() 254 *bn = ret; in BN_dec2bn() 261 if (*bn == NULL) in BN_dec2bn() [all …]
|
H A D | bn_nist.c | 358 BN_ULONG bn[BN_NIST_192_TOP]; in BN_nist_mod_192() member 442 nist_set_192(t_d, buf.bn, 0, 3, 3); in BN_nist_mod_192() 444 nist_set_192(t_d, buf.bn, 4, 4, 0); in BN_nist_mod_192() 446 nist_set_192(t_d, buf.bn, 5, 5, 5) in BN_nist_mod_192() 494 BN_ULONG bn[BN_NIST_224_TOP]; in BN_nist_mod_224() member 532 nist_set_224(buf.bn, c_d, 14, 13, 12, 11, 10, 9, 8); in BN_nist_mod_224() 599 nist_set_224(t_d, buf.bn, 10, 9, 8, 7, 0, 0, 0); in BN_nist_mod_224() 601 nist_set_224(t_d, buf.bn, 0, 13, 12, 11, 0, 0, 0); in BN_nist_mod_224() 605 nist_set_224(t_d, buf.bn, 0, 0, 0, 0, 13, 12, 11); in BN_nist_mod_224() 666 BN_ULONG bn[BN_NIST_256_TOP]; in BN_nist_mod_256() member [all …]
|
H A D | bn_ctx.c | 299 BIGNUM *bn; in BN_POOL_finish() local 302 for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++) in BN_POOL_finish() 303 if (bn->d) in BN_POOL_finish() 304 BN_clear_free(bn); in BN_POOL_finish() 314 BIGNUM *bn; in BN_POOL_get() local 323 for (loop = 0, bn = item->vals; loop++ < BN_CTX_POOL_SIZE; bn++) { in BN_POOL_get() 324 bn_init(bn); in BN_POOL_get() 326 BN_set_flags(bn, BN_FLG_SECURE); in BN_POOL_get()
|
H A D | build.info | 19 $BNASM_x86=bn-586.S co-586.S x86-mont.S x86-gf2m.S 37 $BNASM_ia64=bn-ia64.s ia64-mont.s 53 $BNASM_mips32=bn-mips.S mips-mont.S 80 $BNASM_ppc32=bn_ppc.c bn-ppc.s ppc-mont.s 85 $BNASM_c64xplus=asm/bn-c64xplus.asm 125 GENERATE[bn-586.S]=asm/bn-586.pl 126 DEPEND[bn-586.S]=../perlasm/x86asm.pl 145 GENERATE[bn-mips.S]=asm/mips.pl 146 INCLUDE[bn-mips.o]=.. 162 GENERATE[bn-ia64.s]=asm/ia64.S [all …]
|
/openssl/crypto/ |
H A D | param_build_set.c | 73 return OSSL_PARAM_BLD_push_BN_pad(bld, key, bn, sz); in ossl_param_build_set_bn_pad() 81 return OSSL_PARAM_set_BN(p, bn); in ossl_param_build_set_bn_pad() 87 const char *key, const BIGNUM *bn) in ossl_param_build_set_bn() argument 90 return OSSL_PARAM_BLD_push_BN(bld, key, bn); in ossl_param_build_set_bn() 94 return OSSL_PARAM_set_BN(p, bn) > 0; in ossl_param_build_set_bn() 104 const BIGNUM *bn; in ossl_param_build_set_multi_key_bn() local 108 bn = sk_BIGNUM_const_value(stk, i); in ossl_param_build_set_multi_key_bn() 109 if (bn != NULL && !OSSL_PARAM_BLD_push_BN(bld, names[i], bn)) in ossl_param_build_set_multi_key_bn() 116 bn = sk_BIGNUM_const_value(stk, i); in ossl_param_build_set_multi_key_bn() 118 if (p != NULL && bn != NULL) { in ossl_param_build_set_multi_key_bn() [all …]
|
H A D | param_build.c | 30 const BIGNUM *bn; member 203 if (bn != NULL) { in push_BN() 210 n = BN_num_bytes(bn); in push_BN() 229 pd->bn = bn; in push_BN() 234 const BIGNUM *bn) in OSSL_PARAM_BLD_push_BN() argument 236 if (bn != NULL && BN_is_negative(bn)) in OSSL_PARAM_BLD_push_BN() 237 return push_BN(bld, key, bn, BN_num_bytes(bn) + 1, in OSSL_PARAM_BLD_push_BN() 239 return push_BN(bld, key, bn, bn == NULL ? 0 : BN_num_bytes(bn), in OSSL_PARAM_BLD_push_BN() 246 if (bn != NULL && BN_is_negative(bn)) in OSSL_PARAM_BLD_push_BN_pad() 247 return push_BN(bld, key, bn, BN_num_bytes(bn), in OSSL_PARAM_BLD_push_BN_pad() [all …]
|
H A D | params_from_text.c | 220 BIGNUM *bn; in OSSL_PARAM_print_to_bio() local 249 if (OSSL_PARAM_get_BN(p, &bn)) in OSSL_PARAM_print_to_bio() 250 ok = BN_print(bio, bn); in OSSL_PARAM_print_to_bio() 262 if (OSSL_PARAM_get_BN(p, &bn)) in OSSL_PARAM_print_to_bio() 263 ok = BN_print(bio, bn); in OSSL_PARAM_print_to_bio()
|
/openssl/apps/ |
H A D | prime.c | 62 BIGNUM *bn = NULL; in prime_main() local 119 bn = BN_new(); in prime_main() 120 if (bn == NULL) { in prime_main() 124 if (!BN_generate_prime_ex(bn, bits, safe, NULL, NULL, NULL)) { in prime_main() 128 s = hex ? BN_bn2hex(bn) : BN_bn2dec(bn); in prime_main() 140 r = hex ? BN_hex2bn(&bn, argv[0]) : BN_dec2bn(&bn, argv[0]); in prime_main() 147 BN_print(bio_out, bn); in prime_main() 148 r = BN_check_prime(bn, NULL, NULL); in prime_main() 161 BN_free(bn); in prime_main()
|
H A D | genrsa.c | 80 BIGNUM *bn = BN_new(); in genrsa_main() local 92 if (bn == NULL || cb == NULL) in genrsa_main() 194 if (!BN_set_word(bn, f4)) { in genrsa_main() 198 if (EVP_PKEY_CTX_set1_rsa_keygen_pubexp(ctx, bn) <= 0) { in genrsa_main() 239 BN_free(bn); in genrsa_main()
|
/openssl/crypto/asn1/ |
H A D | x_bignum.c | 97 BIGNUM *bn; in bn_i2c() local 101 bn = (BIGNUM *)*pval; in bn_i2c() 103 if (BN_num_bits(bn) & 0x7) in bn_i2c() 110 BN_bn2bin(bn, cont); in bn_i2c() 112 return pad + BN_num_bytes(bn); in bn_i2c() 118 BIGNUM *bn; in bn_c2i() local 122 bn = (BIGNUM *)*pval; in bn_c2i() 123 if (!BN_bin2bn(cont, len, bn)) { in bn_c2i() 134 BIGNUM *bn; in bn_secure_c2i() local 144 bn = (BIGNUM *)*pval; in bn_secure_c2i() [all …]
|
H A D | a_int.c | 477 if (BN_is_negative(bn) && !BN_is_zero(bn)) in bn_to_asn1_string() 480 len = BN_num_bytes(bn); in bn_to_asn1_string() 491 if (BN_is_zero(bn)) in bn_to_asn1_string() 494 len = BN_bn2bin(bn, ret->data); in bn_to_asn1_string() 503 static BIGNUM *asn1_string_to_bn(const ASN1_INTEGER *ai, BIGNUM *bn, in asn1_string_to_bn() argument 513 ret = BN_bin2bn(ai->data, ai->length, bn); in asn1_string_to_bn() 564 return bn_to_asn1_string(bn, ai, V_ASN1_INTEGER); in BN_to_ASN1_INTEGER() 567 BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn) in ASN1_INTEGER_to_BN() argument 569 return asn1_string_to_bn(ai, bn, V_ASN1_INTEGER); in ASN1_INTEGER_to_BN() 607 return bn_to_asn1_string(bn, ai, V_ASN1_ENUMERATED); in BN_to_ASN1_ENUMERATED() [all …]
|
/openssl/test/testutil/ |
H A D | format_output.c | 185 if (bn != NULL) in test_bignum_zero_null() 186 return BN_is_negative(bn) ? "-0" : "0"; in test_bignum_zero_null() 196 const char *v = test_bignum_zero_null(bn); in test_bignum_zero_print() 213 if (bn != NULL && !BN_is_zero(bn)) { in convert_bn_memory() 234 if (BN_is_negative(bn)) { in convert_bn_memory() 253 if (bn == NULL) in convert_bn_memory() 256 r = BN_is_negative(bn) ? "-0" : "0"; in convert_bn_memory() 381 test_fail_bignum_common(prefix, file, line, type, left, right, op, bn, bn); in test_fail_bignum_mono_message() 387 if (bn == NULL || BN_is_zero(bn)) { in test_output_bignum() 394 int n = BN_bn2bin(bn, buf); in test_output_bignum() [all …]
|
/openssl/providers/ |
H A D | fips.module.sources | 48 crypto/bn/asm/bn-586.pl 82 crypto/bn/bn_add.c 83 crypto/bn/bn_asm.c 87 crypto/bn/bn_ctx.c 88 crypto/bn/bn_dh.c 89 crypto/bn/bn_div.c 90 crypto/bn/bn_exp.c 92 crypto/bn/bn_gcd.c 96 crypto/bn/bn_lib.c 98 crypto/bn/bn_mod.c [all …]
|
H A D | fips-sources.checksums | 48 cb4ad7b7461fcb8e2a0d52881158d0211b79544842d4eae36fc566869a2d62c8 crypto/bn/asm/bn-586.pl 82 0ea8185a037a2951bb3d1e590bbbdeac305176d5e618f3e43a04c09733a9de34 crypto/bn/bn_add.c 83 964c7eecef99ef56997cbb90b6560d41e0e90bb1f87dcc5e2a1bf177851c005f crypto/bn/bn_asm.c 87 f53d3804456b787be45ace2b33b7a323e5e4fb6cfbe3aa3b6696e3ce0a640baa crypto/bn/bn_ctx.c 88 d94295953ab91469fe2b9da2a542b8ea11ac38551ecde8f8202b7f645c2dea16 crypto/bn/bn_dh.c 89 74b63a4515894592b7241fb30b91b21510beaa3d397809e3d74bc9a73e879d18 crypto/bn/bn_div.c 90 0b5da41b6e2d705898b949568d06920509bf16a9a74dd4de39c406b378cd61b2 crypto/bn/bn_exp.c 92 98b2c9a4ffa3063731a10d74318a9f0b808bfa0bb9a5e1c2faca4121a2390d76 crypto/bn/bn_gcd.c 96 b0b02639e782fe3a5ed41f2248ad485ccc2a2bc1132a1326b8fa204066c2aa12 crypto/bn/bn_lib.c 98 929c636ccc31899f366717c1adf691d69534c2329aa79bb3edc2ad1935204ecb crypto/bn/bn_mod.c [all …]
|
/openssl/doc/man3/ |
H A D | DH_get_1024_160.pod | 33 BIGNUM *BN_get_rfc2409_prime_768(BIGNUM *bn); 34 BIGNUM *BN_get_rfc2409_prime_1024(BIGNUM *bn); 35 BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *bn); 36 BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn); 37 BIGNUM *BN_get_rfc3526_prime_3072(BIGNUM *bn); 38 BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn); 39 BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn); 40 BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn); 70 return a BIGNUM for the specified size from IETF RFC 2409. If B<bn>
|
H A D | OSSL_PARAM_BLD.pod | 32 const BIGNUM *bn); 34 const BIGNUM *bn, size_t sz); 83 that holds the specified BIGNUM I<bn>. 84 When the I<bn> is zero or positive, its OSSL_PARAM type becomes 86 When the I<bn> is negative, its OSSL_PARAM type becomes B<OSSL_PARAM_INTEGER>. 87 If I<bn> is marked as being securely allocated, its OSSL_PARAM representation 89 The I<bn> argument is stored by reference and the underlying BIGNUM object 93 that holds the specified BIGNUM I<bn>. 96 When the I<bn> is zero or positive, its OSSL_PARAM type becomes 99 If I<bn> is marked as being securely allocated, its OSSL_PARAM representation [all …]
|
H A D | ASN1_INTEGER_get_int64.pod | 22 ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); 23 BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); 31 ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai); 32 BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn); 62 BN_to_ASN1_INTEGER() converts B<BIGNUM> I<bn> to an B<ASN1_INTEGER>. If I<ai> 66 ASN1_INTEGER_to_BN() converts ASN1_INTEGER I<ai> into a B<BIGNUM>. If I<bn> is 67 NULL a new B<BIGNUM> structure is returned. If I<bn> is not NULL then the
|
/openssl/include/internal/ |
H A D | param_build_set.h | 39 const char *key, const BIGNUM *bn); 41 const char *key, const BIGNUM *bn, size_t sz); 43 const char *key, const BIGNUM *bn); 45 const char *key, const BIGNUM *bn,
|
/openssl/crypto/ec/ |
H A D | ec_deprecated.c | 42 const BIGNUM *bn, EC_POINT *point, BN_CTX *ctx) in EC_POINT_bn2point() argument 48 if ((buf_len = BN_num_bytes(bn)) == 0) in EC_POINT_bn2point() 53 if (BN_bn2binpad(bn, buf, buf_len) < 0) { in EC_POINT_bn2point()
|
/openssl/crypto/x509/ |
H A D | v3_asid.c | 270 BIGNUM *bn = NULL; in ASIdentifierChoice_is_canonical() local 310 if ((bn == NULL && (bn = BN_new()) == NULL) || in ASIdentifierChoice_is_canonical() 311 ASN1_INTEGER_to_BN(a_max, bn) == NULL || in ASIdentifierChoice_is_canonical() 312 !BN_add_word(bn, 1)) { in ASIdentifierChoice_is_canonical() 318 BN_to_ASN1_INTEGER(bn, orig = a_max_plus_one)) == NULL) { in ASIdentifierChoice_is_canonical() 349 BN_free(bn); in ASIdentifierChoice_is_canonical() 370 BIGNUM *bn = NULL; in ASIdentifierChoice_canonize() local 431 if ((bn == NULL && (bn = BN_new()) == NULL) || in ASIdentifierChoice_canonize() 432 ASN1_INTEGER_to_BN(a_max, bn) == NULL || in ASIdentifierChoice_canonize() 433 !BN_add_word(bn, 1)) { in ASIdentifierChoice_canonize() [all …]
|
/openssl/crypto/evp/ |
H A D | ctrl_params_translate.c | 1727 if (bn == NULL) in get_payload_bn() 1731 ctx->p2 = (BIGNUM *)bn; in get_payload_bn() 1740 const BIGNUM *bn = NULL; in get_dh_dsa_payload_p() local 1765 const BIGNUM *bn = NULL; in get_dh_dsa_payload_q() local 1787 const BIGNUM *bn = NULL; in get_dh_dsa_payload_g() local 1847 const BIGNUM *bn = NULL; in get_rsa_payload_n() local 1861 const BIGNUM *bn = NULL; in get_rsa_payload_e() local 1875 const BIGNUM *bn = NULL; in get_rsa_payload_d() local 1891 const BIGNUM *bn = NULL; in get_rsa_payload_factor() local 1895 bn = RSA_get0_p(r); in get_rsa_payload_factor() [all …]
|