comparison src/headers/tomcrypt_pkcs.h @ 209:39d5d58461d6 libtomcrypt-orig LTC_1.05

Import of libtomcrypt 1.05
author Matt Johnston <matt@ucc.asn.au>
date Wed, 06 Jul 2005 03:53:40 +0000
parents 1c15b283127b
children
comparison
equal deleted inserted replaced
191:1c15b283127b 209:39d5d58461d6
8 unsigned char *mask, unsigned long masklen); 8 unsigned char *mask, unsigned long masklen);
9 9
10 int pkcs_1_i2osp(mp_int *n, unsigned long modulus_len, unsigned char *out); 10 int pkcs_1_i2osp(mp_int *n, unsigned long modulus_len, unsigned char *out);
11 int pkcs_1_os2ip(mp_int *n, unsigned char *in, unsigned long inlen); 11 int pkcs_1_os2ip(mp_int *n, unsigned char *in, unsigned long inlen);
12 12
13 /* *** v2.0 padding */ 13 /* *** v2.1 padding */
14 int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen, 14 int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen,
15 const unsigned char *lparam, unsigned long lparamlen, 15 const unsigned char *lparam, unsigned long lparamlen,
16 unsigned long modulus_bitlen, prng_state *prng, 16 unsigned long modulus_bitlen, prng_state *prng,
17 int prng_idx, int hash_idx, 17 int prng_idx, int hash_idx,
18 unsigned char *out, unsigned long *outlen); 18 unsigned char *out, unsigned long *outlen);
32 int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, 32 int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen,
33 const unsigned char *sig, unsigned long siglen, 33 const unsigned char *sig, unsigned long siglen,
34 unsigned long saltlen, int hash_idx, 34 unsigned long saltlen, int hash_idx,
35 unsigned long modulus_bitlen, int *res); 35 unsigned long modulus_bitlen, int *res);
36 36
37 /* *** v1.5 padding */
38 /* encryption padding */
39 int pkcs_1_v15_es_encode(const unsigned char *msg, unsigned long msglen,
40 unsigned long modulus_bitlen,
41 prng_state *prng, int prng_idx,
42 unsigned char *out, unsigned long *outlen);
43
44 /* note "outlen" is fixed, you have to tell this decoder how big
45 * the original message was. Unlike the OAEP decoder it cannot auto-detect it.
46 */
47 int pkcs_1_v15_es_decode(const unsigned char *msg, unsigned long msglen,
48 unsigned long modulus_bitlen,
49 unsigned char *out, unsigned long outlen,
50 int *res);
51
52 /* signature padding */
53 int pkcs_1_v15_sa_encode(const unsigned char *msghash, unsigned long msghashlen,
54 int hash_idx, unsigned long modulus_bitlen,
55 unsigned char *out, unsigned long *outlen);
56
57 int pkcs_1_v15_sa_decode(const unsigned char *msghash, unsigned long msghashlen,
58 const unsigned char *sig, unsigned long siglen,
59 int hash_idx, unsigned long modulus_bitlen,
60 int *res);
61
62
63 #endif /* PKCS_1 */ 37 #endif /* PKCS_1 */
64 38
65 /* ===> PKCS #5 -- Password Based Cryptography <=== */ 39 /* ===> PKCS #5 -- Password Based Cryptography <=== */
66 #ifdef PKCS_5 40 #ifdef PKCS_5
67 41
76 const unsigned char *salt, unsigned long salt_len, 50 const unsigned char *salt, unsigned long salt_len,
77 int iteration_count, int hash_idx, 51 int iteration_count, int hash_idx,
78 unsigned char *out, unsigned long *outlen); 52 unsigned char *out, unsigned long *outlen);
79 53
80 #endif /* PKCS_5 */ 54 #endif /* PKCS_5 */
55
56 /* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_pkcs.h,v $ */
57 /* $Revision: 1.3 $ */
58 /* $Date: 2005/05/14 11:46:08 $ */