/external/dropbear/libtomcrypt/src/pk/ecc/ |
D | ltc_ecc_projective_add_point.c | 35 int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp) in ltc_ecc_projective_add_point() argument 43 LTC_ARGCHK(modulus != NULL); in ltc_ecc_projective_add_point() 51 if ((err = mp_sub(modulus, Q->y, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 57 return ltc_ecc_projective_dbl_point(P, R, modulus, mp); in ltc_ecc_projective_add_point() 68 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 71 if ((err = mp_montgomery_reduce(x, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 74 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 77 if ((err = mp_montgomery_reduce(y, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 82 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() 85 if ((err = mp_montgomery_reduce(t2, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_add_point() [all …]
|
D | ltc_ecc_projective_dbl_point.c | 34 int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void *mp) in ltc_ecc_projective_dbl_point() argument 41 LTC_ARGCHK(modulus != NULL); in ltc_ecc_projective_dbl_point() 56 if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 59 if ((err = mp_montgomery_reduce(R->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 62 if (mp_cmp(R->z, modulus) != LTC_MP_LT) { in ltc_ecc_projective_dbl_point() 63 if ((err = mp_sub(R->z, modulus, R->z)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 69 if ((err = mp_add(t2, modulus, t2)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 73 if (mp_cmp(t1, modulus) != LTC_MP_LT) { in ltc_ecc_projective_dbl_point() 74 if ((err = mp_sub(t1, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() 78 if ((err = mp_montgomery_reduce(t2, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_projective_dbl_point() [all …]
|
D | ltc_ecc_mul2add.c | 40 void *modulus) in ltc_ecc_mul2add() argument 54 LTC_ARGCHK(modulus != NULL); in ltc_ecc_mul2add() 97 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { in ltc_ecc_mul2add() 103 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { in ltc_ecc_mul2add() 108 …if ((err = mp_mulmod(A->x, mu, modulus, precomp[1]->x)) != CRYPT_OK) … in ltc_ecc_mul2add() 109 …if ((err = mp_mulmod(A->y, mu, modulus, precomp[1]->y)) != CRYPT_OK) … in ltc_ecc_mul2add() 110 …if ((err = mp_mulmod(A->z, mu, modulus, precomp[1]->z)) != CRYPT_OK) … in ltc_ecc_mul2add() 112 …if ((err = mp_mulmod(B->x, mu, modulus, precomp[1<<2]->x)) != CRYPT_OK) … in ltc_ecc_mul2add() 113 …if ((err = mp_mulmod(B->y, mu, modulus, precomp[1<<2]->y)) != CRYPT_OK) … in ltc_ecc_mul2add() 114 …if ((err = mp_mulmod(B->z, mu, modulus, precomp[1<<2]->z)) != CRYPT_OK) … in ltc_ecc_mul2add() [all …]
|
D | ltc_ecc_mulmod.c | 39 int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) in ltc_ecc_mulmod() argument 50 LTC_ARGCHK(modulus != NULL); in ltc_ecc_mulmod() 53 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { in ltc_ecc_mulmod() 60 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { in ltc_ecc_mulmod() 89 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 90 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 91 if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 98 if ((err = ltc_mp.ecc_ptdbl(tG, M[0], modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 99 if ((err = ltc_mp.ecc_ptdbl(M[0], M[0], modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 100 if ((err = ltc_mp.ecc_ptdbl(M[0], M[0], modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() [all …]
|
D | ltc_ecc_mulmod_timing.c | 37 int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) in ltc_ecc_mulmod() argument 48 LTC_ARGCHK(modulus != NULL); in ltc_ecc_mulmod() 51 if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { in ltc_ecc_mulmod() 58 if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { in ltc_ecc_mulmod() 82 if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 83 if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 84 if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 94 if ((err = ltc_mp.ecc_ptdbl(tG, M[1], modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 122 if ((err = ltc_mp.ecc_ptadd(M[0], M[1], M[2], modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() 123 if ((err = ltc_mp.ecc_ptdbl(M[1], M[2], modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_mulmod() [all …]
|
D | ltc_ecc_map.c | 33 int ltc_ecc_map(ecc_point *P, void *modulus, void *mp) in ltc_ecc_map() argument 39 LTC_ARGCHK(modulus != NULL); in ltc_ecc_map() 47 if ((err = mp_montgomery_reduce(P->z, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 50 if ((err = mp_invmod(P->z, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 54 if ((err = mp_mod(t2, modulus, t2)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 56 if ((err = mp_mod(t1, modulus, t1)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 60 if ((err = mp_montgomery_reduce(P->x, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map() 62 if ((err = mp_montgomery_reduce(P->y, modulus, mp)) != CRYPT_OK) { goto done; } in ltc_ecc_map()
|
D | ecc_test.c | 32 void *modulus, *order; in ecc_test() local 36 if ((err = mp_init_multi(&modulus, &order, NULL)) != CRYPT_OK) { in ecc_test() 43 mp_clear_multi(modulus, order, NULL); in ecc_test() 53 …if ((err = mp_read_radix(modulus, (char *)ltc_ecc_sets[i].prime, 16)) != CRYPT_OK) { goto done; } in ecc_test() 57 …if ((err = mp_prime_is_prime(modulus, 8, &primality)) != CRYPT_OK) { goto done; } in ecc_test() 76 …if ((err = ltc_mp.ecc_ptmul(order, G, GG, modulus, 1)) != CRYPT_OK) { goto done; } in ecc_test() 86 mp_clear_multi(order, modulus, NULL); in ecc_test()
|
/external/dropbear/libtomcrypt/src/math/ |
D | tfm_desc.c | 408 static int tfm_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void *Mp) in tfm_ecc_projective_dbl_point() argument 415 LTC_ARGCHK(modulus != NULL); in tfm_ecc_projective_dbl_point() 431 fp_montgomery_reduce(&t1, modulus, mp); in tfm_ecc_projective_dbl_point() 434 fp_montgomery_reduce(R->z, modulus, mp); in tfm_ecc_projective_dbl_point() 437 if (fp_cmp(R->z, modulus) != FP_LT) { in tfm_ecc_projective_dbl_point() 438 fp_sub(R->z, modulus, R->z); in tfm_ecc_projective_dbl_point() 444 fp_add(&t2, modulus, &t2); in tfm_ecc_projective_dbl_point() 448 if (fp_cmp(&t1, modulus) != FP_LT) { in tfm_ecc_projective_dbl_point() 449 fp_sub(&t1, modulus, &t1); in tfm_ecc_projective_dbl_point() 453 fp_montgomery_reduce(&t2, modulus, mp); in tfm_ecc_projective_dbl_point() [all …]
|
/external/dropbear/libtomcrypt/src/math/fp/ |
D | ltc_ecc_fp_mulmod.c | 672 static int build_lut(int idx, void *modulus, void *mp, void *mu) in build_lut() argument 686 bitlen = mp_unsigned_bin_size(modulus) << 3; in build_lut() 699 if ((mp_mulmod(fp_cache[idx].g->x, mu, modulus, fp_cache[idx].LUT[1]->x) != CRYPT_OK) || in build_lut() 700 (mp_mulmod(fp_cache[idx].g->y, mu, modulus, fp_cache[idx].LUT[1]->y) != CRYPT_OK) || in build_lut() 701 …(mp_mulmod(fp_cache[idx].g->z, mu, modulus, fp_cache[idx].LUT[1]->z) != CRYPT_OK)) { goto E… in build_lut() 711 …if ((err = ltc_mp.ecc_ptdbl(fp_cache[idx].LUT[1<<x], fp_cache[idx].LUT[1<<x], modulus, mp)) != CRY… in build_lut() 724 fp_cache[idx].LUT[y], modulus, mp)) != CRYPT_OK) { in build_lut() 734 …if ((err = mp_montgomery_reduce(fp_cache[idx].LUT[x]->z, modulus, mp)) != CRYPT_OK) … in build_lut() 737 …if ((err = mp_invmod(fp_cache[idx].LUT[x]->z, modulus, fp_cache[idx].LUT[x]->z)) != CRYPT_OK) … in build_lut() 740 …if ((err = mp_sqrmod(fp_cache[idx].LUT[x]->z, modulus, tmp)) != CRYPT_OK) … in build_lut() [all …]
|
/external/dropbear/libtommath/etc/ |
D | mont.c | 6 mp_int modulus, R, p, pp; in main() local 11 mp_init_multi(&modulus, &R, &p, &pp, NULL); in main() 18 mp_rand(&modulus, x); in main() 19 modulus.dp[0] |= 1; in main() 22 mp_montgomery_calc_normalization(&R, &modulus); in main() 23 mp_montgomery_setup(&modulus, &mp); in main() 29 mp_montgomery_reduce(&pp, &modulus, mp); in main()
|
/external/dropbear/libtomcrypt/testprof/ |
D | ecc_test.c | 35 void *modulus, *mp, *kA, *kB, *rA, *rB; in ecc_test_shamir() local 40 DO(mp_init_multi(&kA, &kB, &rA, &rB, &modulus, NULL)); in ecc_test_shamir() 58 DO(mp_read_radix(modulus, ltc_ecc_sets[z].prime, 16)); in ecc_test_shamir() 59 DO(mp_montgomery_setup(modulus, &mp)); in ecc_test_shamir() 70 DO(ltc_mp.ecc_ptmul(rA, G, A, modulus, 1)); in ecc_test_shamir() 73 DO(ltc_mp.ecc_ptmul(rB, G, B, modulus, 1)); in ecc_test_shamir() 82 DO(ltc_mp.ecc_ptmul(kA, A, C1, modulus, 0)); in ecc_test_shamir() 83 DO(ltc_mp.ecc_ptmul(kB, B, C2, modulus, 0)); in ecc_test_shamir() 84 DO(ltc_mp.ecc_ptadd(C1, C2, C1, modulus, mp)); in ecc_test_shamir() 85 DO(ltc_mp.ecc_map(C1, modulus, mp)); in ecc_test_shamir() [all …]
|
/external/dropbear/libtomcrypt/src/headers/ |
D | tomcrypt_math.h | 347 int (*ecc_ptmul)(void *k, ecc_point *G, ecc_point *R, void *modulus, int map); 357 int (*ecc_ptadd)(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp); 366 int (*ecc_ptdbl)(ecc_point *P, ecc_point *R, void *modulus, void *mp); 376 int (*ecc_map)(ecc_point *P, void *modulus, void *mp); 390 void *modulus);
|
D | tomcrypt_pk.h | 256 int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void *mp); 259 int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp); 263 int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map); 270 int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map); 277 void *modulus); 282 ecc_point *C, void *modulus); 289 int ltc_ecc_map(ecc_point *P, void *modulus, void *mp);
|
/external/openssl/apps/ |
D | dsa.c | 115 int modulus=0; in MAIN() local 181 modulus=1; in MAIN() 308 if (modulus) in MAIN()
|
D | rsa.c | 116 int modulus=0; in MAIN() local 185 modulus=1; in MAIN() 308 if (modulus) in MAIN()
|
D | req.c | 189 int modulus=0; in MAIN() local 420 modulus=1; in MAIN() 1054 if (noout && !text && !modulus && !subject && !pubkey) in MAIN() 1113 if (modulus) in MAIN()
|
D | x509.c | 186 int x509req=0,days=DEF_DAYS,modulus=0,pubkey=0; in MAIN() local 390 modulus= ++num; in MAIN() 777 if (modulus == i) in MAIN()
|
/external/ppp/pppd/ |
D | srp-entry.c | 129 mytce.modulus.data = (u_char *)wkmodulus; in main() 130 mytce.modulus.len = sizeof (wkmodulus); in main()
|
/external/dropbear/libtomcrypt/notes/ |
D | tech0006.txt | 28 p INTEGER , -- prime modulus 39 p INTEGER , -- prime modulus
|
/external/dropbear/libtomcrypt/demos/ |
D | tv_gen.c | 664 void *k, *order, *modulus; in ecc_gen() local 674 mp_init(&modulus); in ecc_gen() 681 mp_read_radix(modulus, (char *)ltc_ecc_sets[x].prime, 16); in ecc_gen() 687 ltc_mp.ecc_ptmul(k, G, R, modulus, 1); in ecc_gen() 694 mp_clear_multi(k, order, modulus, NULL); in ecc_gen()
|
/external/wpa_supplicant/ |
D | crypto.h | 410 const u8 *modulus, size_t modulus_len,
|
D | crypto_libtomcrypt.c | 704 const u8 *modulus, size_t modulus_len, in crypto_mod_exp() argument 714 mp_read_unsigned_bin(m, (u8 *) modulus, modulus_len) != CRYPT_OK) in crypto_mod_exp()
|
D | crypto_internal.c | 632 const u8 *modulus, size_t modulus_len, in crypto_mod_exp() argument 649 bignum_set_unsigned_bin(bn_modulus, modulus, modulus_len) < 0) in crypto_mod_exp()
|
/external/dropbear/libtomcrypt/ |
D | crypt.tex | 3082 … be set to \textbf{LTC\_PKCS\_1\_EMSA} to perform signature padding. The \textit{modulus\_bitlen} 3083 parameter indicates the length of the modulus in bits. The padded data is stored in \textit{out} w… 3084 longer than the modulus which helps allocate the correct output buffer size. 3133 OAEP encoding requires the length of the modulus in bits in order to calculate the size of the outp… 3134 \textit{modulus\_bitlen}. \textit{hash\_idx} is the index into the hash descriptor table of the ha… 3139 If $h$ is the length of the hash and $m$ the length of the modulus (both in octets) then the maximu… 3163 …g this function will not decode the packet. \textit{modulus\_bitlen} is the size of the RSA modul… 3195 Similar to OAEP encoding \textit{modulus\_bitlen} is the size of the RSA modulus (in bits). It lim… 3196 of the modulus $h$ the length of the hash output (in octets) then there can be $m - h - 2$ bytes of… 3265 …RNG descriptor array. The \textit{size} parameter is the size in bytes of the RSA modulus desired. [all …]
|
/external/dropbear/libtommath/ |
D | changes.txt | 105 -- Fixed mp_mod() so the sign of the result agrees with the sign of the modulus. 169 -- mp_jacobi() returns MP_VAL if the modulus is less than or equal to zero. 243 …-- mp_exptmod now also returns errors if the modulus is negative and will handle negative exponents 375 …-- fixed bugs in add/sub/mul/sqr_mod functions where if the modulus and dest were the same it woul…
|