Mercurial > dropbear
comparison libtomcrypt/testprof/pkcs_1_test.c @ 1435:f849a5ca2efc
update to libtomcrypt 1.17 (with Dropbear changes)
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 24 Jun 2017 17:50:50 +0800 |
parents | 0cbe8f6dbf9e |
children |
comparison
equal
deleted
inserted
replaced
1434:27b9ddb06b09 | 1435:f849a5ca2efc |
---|---|
1 #include <tomcrypt_test.h> | 1 #include <tomcrypt_test.h> |
2 | 2 |
3 #ifdef PKCS_1 | 3 #ifdef LTC_PKCS_1 |
4 | 4 |
5 int pkcs_1_test(void) | 5 int pkcs_1_test(void) |
6 { | 6 { |
7 unsigned char buf[3][128]; | 7 unsigned char buf[3][128]; |
8 int res1, res2, res3, prng_idx, hash_idx, err; | 8 int res1, res2, res3, prng_idx, hash_idx, err; |
31 lparamlen = abs(rand()) % 17; | 31 lparamlen = abs(rand()) % 17; |
32 | 32 |
33 /* pick a random saltlen 0..16 */ | 33 /* pick a random saltlen 0..16 */ |
34 saltlen = abs(rand()) % 17; | 34 saltlen = abs(rand()) % 17; |
35 | 35 |
36 /* PKCS #1 v2.0 supports modlens not multiple of 8 */ | 36 /* LTC_PKCS #1 v2.0 supports modlens not multiple of 8 */ |
37 modlen = 800 + (abs(rand()) % 224); | 37 modlen = 800 + (abs(rand()) % 224); |
38 | 38 |
39 /* encode it */ | 39 /* encode it */ |
40 l1 = sizeof(buf[1]); | 40 l1 = sizeof(buf[1]); |
41 DO(pkcs_1_oaep_encode(buf[0], l3, lparam, lparamlen, modlen, &yarrow_prng, prng_idx, hash_idx, buf[1], &l1)); | 41 DO(pkcs_1_oaep_encode(buf[0], l3, lparam, lparamlen, modlen, &yarrow_prng, prng_idx, hash_idx, buf[1], &l1)); |
86 } | 86 } |
87 | 87 |
88 #endif | 88 #endif |
89 | 89 |
90 | 90 |
91 /* $Source: /cvs/libtom/libtomcrypt/testprof/pkcs_1_test.c,v $ */ | 91 /* $Source$ */ |
92 /* $Revision: 1.7 $ */ | 92 /* $Revision$ */ |
93 /* $Date: 2006/11/30 03:30:45 $ */ | 93 /* $Date$ */ |