Home
last modified time | relevance | path

Searched refs:modulus_len (Results 1 – 15 of 15) sorted by relevance

/external/dropbear/libtomcrypt/src/pk/pkcs1/
Dpkcs_1_pss_encode.c40 unsigned long x, y, hLen, modulus_len; in pkcs_1_pss_encode() local
57 modulus_len = (modulus_bitlen>>3) + (modulus_bitlen & 7 ? 1 : 0); in pkcs_1_pss_encode()
60 if ((saltlen > modulus_len) || (modulus_len < hLen + saltlen + 2)) { in pkcs_1_pss_encode()
65 DB = XMALLOC(modulus_len); in pkcs_1_pss_encode()
66 mask = XMALLOC(modulus_len); in pkcs_1_pss_encode()
67 salt = XMALLOC(modulus_len); in pkcs_1_pss_encode()
68 hash = XMALLOC(modulus_len); in pkcs_1_pss_encode()
114 XMEMSET(DB + x, 0, modulus_len - saltlen - hLen - 2); in pkcs_1_pss_encode()
115 x += modulus_len - saltlen - hLen - 2; in pkcs_1_pss_encode()
121 if ((err = pkcs_1_mgf1(hash_idx, hash, hLen, mask, modulus_len - hLen - 1)) != CRYPT_OK) { in pkcs_1_pss_encode()
[all …]
Dpkcs_1_oaep_decode.c40 unsigned long hLen, x, y, modulus_len; in pkcs_1_oaep_decode() local
56 modulus_len = (modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0); in pkcs_1_oaep_decode()
59 if ((2*hLen >= (modulus_len - 2)) || (msglen != modulus_len)) { in pkcs_1_oaep_decode()
64 DB = XMALLOC(modulus_len); in pkcs_1_oaep_decode()
65 mask = XMALLOC(modulus_len); in pkcs_1_oaep_decode()
100 XMEMCPY(DB, msg + x, modulus_len - hLen - 1); in pkcs_1_oaep_decode()
101 x += modulus_len - hLen - 1; in pkcs_1_oaep_decode()
104 if ((err = pkcs_1_mgf1(hash_idx, DB, modulus_len - hLen - 1, mask, hLen)) != CRYPT_OK) { in pkcs_1_oaep_decode()
114 if ((err = pkcs_1_mgf1(hash_idx, seed, hLen, mask, modulus_len - hLen - 1)) != CRYPT_OK) { in pkcs_1_oaep_decode()
119 for (y = 0; y < (modulus_len - hLen - 1); y++) { in pkcs_1_oaep_decode()
[all …]
Dpkcs_1_pss_decode.c38 unsigned long x, y, hLen, modulus_len; in pkcs_1_pss_decode() local
54 modulus_len = (modulus_bitlen>>3) + (modulus_bitlen & 7 ? 1 : 0); in pkcs_1_pss_decode()
57 if ((saltlen > modulus_len) || in pkcs_1_pss_decode()
58 (modulus_len < hLen + saltlen + 2) || (siglen != modulus_len)) { in pkcs_1_pss_decode()
63 DB = XMALLOC(modulus_len); in pkcs_1_pss_decode()
64 mask = XMALLOC(modulus_len); in pkcs_1_pss_decode()
65 salt = XMALLOC(modulus_len); in pkcs_1_pss_decode()
66 hash = XMALLOC(modulus_len); in pkcs_1_pss_decode()
91 XMEMCPY(DB, sig + x, modulus_len - hLen - 1); in pkcs_1_pss_decode()
92 x += modulus_len - hLen - 1; in pkcs_1_pss_decode()
[all …]
Dpkcs_1_oaep_encode.c41 unsigned long hLen, x, y, modulus_len; in pkcs_1_oaep_encode() local
59 modulus_len = (modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0); in pkcs_1_oaep_encode()
62 if ((2*hLen >= (modulus_len - 2)) || (msglen > (modulus_len - 2*hLen - 2))) { in pkcs_1_oaep_encode()
67 DB = XMALLOC(modulus_len); in pkcs_1_oaep_encode()
68 mask = XMALLOC(modulus_len); in pkcs_1_oaep_encode()
85 x = modulus_len; in pkcs_1_oaep_encode()
99 y = modulus_len - msglen - 2*hLen - 2; in pkcs_1_oaep_encode()
117 if ((err = pkcs_1_mgf1(hash_idx, seed, hLen, mask, modulus_len - hLen - 1)) != CRYPT_OK) { in pkcs_1_oaep_encode()
122 for (y = 0; y < (modulus_len - hLen - 1); y++) { in pkcs_1_oaep_encode()
127 if ((err = pkcs_1_mgf1(hash_idx, DB, modulus_len - hLen - 1, mask, hLen)) != CRYPT_OK) { in pkcs_1_oaep_encode()
[all …]
Dpkcs_1_v1_5_decode.c40 unsigned long modulus_len, ps_len, i; in pkcs_1_v1_5_decode() local
46 modulus_len = (modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0); in pkcs_1_v1_5_decode()
50 if ((msglen > modulus_len) || (modulus_len < 11)) { in pkcs_1_v1_5_decode()
62 for (i = 2; i < modulus_len; i++) { in pkcs_1_v1_5_decode()
68 if ((i >= modulus_len) || (ps_len < 8)) { in pkcs_1_v1_5_decode()
76 for (i = 2; i < modulus_len - 1; i++) { in pkcs_1_v1_5_decode()
Dpkcs_1_v1_5_encode.c42 unsigned long modulus_len, ps_len, i; in pkcs_1_v1_5_encode() local
58 modulus_len = (modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0); in pkcs_1_v1_5_encode()
61 if ((msglen + 11) > modulus_len) { in pkcs_1_v1_5_encode()
65 if (*outlen < modulus_len) { in pkcs_1_v1_5_encode()
66 *outlen = modulus_len; in pkcs_1_v1_5_encode()
73 ps_len = modulus_len - msglen - 3; in pkcs_1_v1_5_encode()
100 *outlen = modulus_len; in pkcs_1_v1_5_encode()
Dpkcs_1_i2osp.c31 int pkcs_1_i2osp(void *n, unsigned long modulus_len, unsigned char *out) in pkcs_1_i2osp() argument
37 if (size > modulus_len) { in pkcs_1_i2osp()
42 zeromem(out, modulus_len); in pkcs_1_i2osp()
43 return mp_to_unsigned_bin(n, out+(modulus_len-size)); in pkcs_1_i2osp()
/external/wpa_supplicant_8/src/crypto/
Dcrypto_internal-modexp.c18 const u8 *modulus, size_t modulus_len, in crypto_mod_exp() argument
35 bignum_set_unsigned_bin(bn_modulus, modulus, modulus_len) < 0) in crypto_mod_exp()
Dcrypto_gnutls.c156 const u8 *modulus, size_t modulus_len, in crypto_mod_exp() argument
167 gcry_mpi_scan(&bn_modulus, GCRYMPI_FMT_USG, modulus, modulus_len, in crypto_mod_exp()
170 bn_result = gcry_mpi_new(modulus_len * 8); in crypto_mod_exp()
Dcrypto_nss.c172 const u8 *modulus, size_t modulus_len, in crypto_mod_exp() argument
Dcrypto_libtomcrypt.c698 const u8 *modulus, size_t modulus_len, in crypto_mod_exp() argument
708 mp_read_unsigned_bin(m, (u8 *) modulus, modulus_len) != CRYPT_OK) in crypto_mod_exp()
Dcrypto.h430 const u8 *modulus, size_t modulus_len,
Dcrypto_openssl.c314 const u8 *modulus, size_t modulus_len, in crypto_mod_exp() argument
327 bn_modulus = BN_bin2bn(modulus, modulus_len, NULL); in crypto_mod_exp()
Dcrypto_cryptoapi.c778 const u8 *modulus, size_t modulus_len, in crypto_mod_exp() argument
/external/dropbear/libtomcrypt/src/headers/
Dtomcrypt_pkcs.h23 int pkcs_1_i2osp(void *n, unsigned long modulus_len, unsigned char *out);