| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifdef LTC_PKCS_1 |
| 5 |
|
| 6 |
enum ltc_pkcs_1_v1_5_blocks |
| 7 |
{ |
| 8 |
LTC_LTC_PKCS_1_EMSA = 1, |
| 9 |
LTC_LTC_PKCS_1_EME = 2 |
| 10 |
}; |
| 11 |
|
| 12 |
enum ltc_pkcs_1_paddings |
| 13 |
{ |
| 14 |
LTC_LTC_PKCS_1_V1_5 = 1, |
| 15 |
LTC_LTC_PKCS_1_OAEP = 2, |
| 16 |
LTC_LTC_PKCS_1_PSS = 3 |
| 17 |
}; |
| 18 |
|
| 19 |
int pkcs_1_mgf1( int hash_idx, |
| 20 |
const unsigned char *seed, unsigned long seedlen, |
| 21 |
unsigned char *mask, unsigned long masklen); |
| 22 |
|
| 23 |
int pkcs_1_i2osp(void *n, unsigned long modulus_len, unsigned char *out); |
| 24 |
int pkcs_1_os2ip(void *n, unsigned char *in, unsigned long inlen); |
| 25 |
|
| 26 |
|
| 27 |
int pkcs_1_v1_5_encode(const unsigned char *msg, |
| 28 |
unsigned long msglen, |
| 29 |
int block_type, |
| 30 |
unsigned long modulus_bitlen, |
| 31 |
prng_state *prng, |
| 32 |
int prng_idx, |
| 33 |
unsigned char *out, |
| 34 |
unsigned long *outlen); |
| 35 |
|
| 36 |
int pkcs_1_v1_5_decode(const unsigned char *msg, |
| 37 |
unsigned long msglen, |
| 38 |
int block_type, |
| 39 |
unsigned long modulus_bitlen, |
| 40 |
unsigned char *out, |
| 41 |
unsigned long *outlen, |
| 42 |
int *is_valid); |
| 43 |
|
| 44 |
|
| 45 |
int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen, |
| 46 |
const unsigned char *lparam, unsigned long lparamlen, |
| 47 |
unsigned long modulus_bitlen, prng_state *prng, |
| 48 |
int prng_idx, int hash_idx, |
| 49 |
unsigned char *out, unsigned long *outlen); |
| 50 |
|
| 51 |
int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, |
| 52 |
const unsigned char *lparam, unsigned long lparamlen, |
| 53 |
unsigned long modulus_bitlen, int hash_idx, |
| 54 |
unsigned char *out, unsigned long *outlen, |
| 55 |
int *res); |
| 56 |
|
| 57 |
int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen, |
| 58 |
unsigned long saltlen, prng_state *prng, |
| 59 |
int prng_idx, int hash_idx, |
| 60 |
unsigned long modulus_bitlen, |
| 61 |
unsigned char *out, unsigned long *outlen); |
| 62 |
|
| 63 |
int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, |
| 64 |
const unsigned char *sig, unsigned long siglen, |
| 65 |
unsigned long saltlen, int hash_idx, |
| 66 |
unsigned long modulus_bitlen, int *res); |
| 67 |
|
| 68 |
#endif |
| 69 |
|
| 70 |
|
| 71 |
#ifdef LTC_PKCS_5 |
| 72 |
|
| 73 |
|
| 74 |
int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, |
| 75 |
const unsigned char *salt, |
| 76 |
int iteration_count, int hash_idx, |
| 77 |
unsigned char *out, unsigned long *outlen); |
| 78 |
|
| 79 |
|
| 80 |
int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, |
| 81 |
const unsigned char *salt, unsigned long salt_len, |
| 82 |
int iteration_count, int hash_idx, |
| 83 |
unsigned char *out, unsigned long *outlen); |
| 84 |
|
| 85 |
#endif |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|