Home | History | Annotate | Download | only in testprof

Lines Matching full:len

81    unsigned long len;
87 len = sizeof(buf);
88 DO(rsa_export(buf, &len, PK_PRIVATE, &key));
89 if (len != sizeof(openssl_private_rsa) || memcmp(buf, openssl_private_rsa, len)) {
90 fprintf(stderr, "RSA private export failed to match OpenSSL output, %lu, %lu\n", len, (unsigned long)sizeof(openssl_private_rsa));
94 len = sizeof(buf);
95 DO(rsa_export(buf, &len, PK_PUBLIC, &key));
96 if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) {
104 len = sizeof(buf);
105 DO(rsa_export(buf, &len, PK_PUBLIC, &key));
106 if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) {
114 len = sizeof(buf);
115 DO(rsa_export(buf, &len, PK_PUBLIC, &key));
116 if (len != sizeof(openssl_public_rsa_stripped) || memcmp(buf, openssl_public_rsa_stripped, len)) {
130 unsigned long rsa_msgsize, len, len2, cnt;
150 len = mp_unsigned_bin_size(key.N);
153 for (cnt = 0; cnt < len; ) {
158 len = mp_unsigned_bin_size(key.p);
161 for (cnt = 0; cnt < len; ) {
166 len = mp_unsigned_bin_size(key.q);
169 for (cnt = 0; cnt < len; ) {
189 len = sizeof(out);
192 DO(rsa_encrypt_key(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, hash_idx, &key));
195 DO(rsa_decrypt_key(out, len, tmp, &len2, NULL, 0, hash_idx, &stat2, &key));
199 fprintf(stderr, "\nrsa_decrypt_key mismatch len %lu (first decrypt)", len2);
204 DO(rsa_decrypt_key(out, len, tmp, &len2, NULL, 0, hash_idx, &stat, &key));
211 fprintf(stderr, "\nrsa_decrypt_key mismatch, len %lu (second decrypt)\n", len2);
235 len = sizeof(out);
237 DO(rsa_encrypt_key(in, rsa_msgsize, out, &len, lparam, sizeof(lparam), &yarrow_prng, prng_idx, hash_idx, &key));
240 DO(rsa_decrypt_key(out, len, tmp, &len2, lparam, sizeof(lparam), hash_idx, &stat2, &key));
242 fprintf(stderr, "\nrsa_decrypt_key mismatch len %lu (first decrypt)", len2);
249 DO(rsa_decrypt_key(out, len, tmp, &len2, lparam, sizeof(lparam), hash_idx, &stat, &key));
255 fprintf(stderr, "rsa_decrypt_key mismatch len %lu", len2);
262 len = sizeof(out);
264 DO(rsa_encrypt_key_ex(in, rsa_msgsize, out, &len, NULL, 0, &yarrow_prng, prng_idx, 0, LTC_PKCS_1_V1_5, &key));
267 DO(rsa_decrypt_key_ex(out, len, tmp, &len2, NULL, 0, 0, LTC_PKCS_1_V1_5, &stat, &key));
273 fprintf(stderr, "rsa_decrypt_key_ex mismatch len %lu", len2);
279 len = sizeof(out);
280 DO(rsa_sign_hash(in, 20, out, &len, &yarrow_prng, prng_idx, hash_idx, 0, &key));
291 DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat, &key));
294 DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat2, &key));
307 DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat, &privKey));
310 DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat2, &privKey));
323 DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat, &pubKey));
326 DO(rsa_verify_hash(out, len, in, 20, hash_idx, 0, &stat2, &pubKey));
337 len = sizeof(out);
338 DO(rsa_sign_hash(in, 20, out, &len, &yarrow_prng, prng_idx, hash_idx, 8, &privKey));
339 DO(rsa_verify_hash(out, len, in, 20, hash_idx, 8, &stat, &pubKey));
342 DO(rsa_verify_hash(out, len, in, 20, hash_idx, 8, &stat2, &pubKey));
353 len = sizeof(out);
354 DO(rsa_sign_hash_ex(in, 20, out, &len, LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey));
355 DO(rsa_verify_hash_ex(out, len, in, 20, LTC_PKCS_1_V1_5, hash_idx, 8, &stat, &pubKey));
358 DO(rsa_verify_hash_ex(out, len, in, 20, LTC_PKCS_1_V1_5, hash_idx, 8, &stat2, &pubKey));