comparison src/headers/tomcrypt_pkcs.h @ 380:d5faf4814ddb libtomcrypt-orig libtomcrypt-1.16

Update to LibTomCrypt 1.16
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 02:22:00 +0000
parents 59400faa4b44
children
comparison
equal deleted inserted replaced
280:59400faa4b44 380:d5faf4814ddb
1 /* PKCS Header Info */ 1 /* PKCS Header Info */
2 2
3 /* ===> PKCS #1 -- RSA Cryptography <=== */ 3 /* ===> PKCS #1 -- RSA Cryptography <=== */
4 #ifdef PKCS_1 4 #ifdef PKCS_1
5 5
6 int pkcs_1_mgf1(const unsigned char *seed, unsigned long seedlen, 6 enum ltc_pkcs_1_v1_5_blocks
7 int hash_idx, 7 {
8 LTC_PKCS_1_EMSA = 1, /* Block type 1 (PKCS #1 v1.5 signature padding) */
9 LTC_PKCS_1_EME = 2 /* Block type 2 (PKCS #1 v1.5 encryption padding) */
10 };
11
12 enum ltc_pkcs_1_paddings
13 {
14 LTC_PKCS_1_V1_5 = 1, /* PKCS #1 v1.5 padding (\sa ltc_pkcs_1_v1_5_blocks) */
15 LTC_PKCS_1_OAEP = 2, /* PKCS #1 v2.0 encryption padding */
16 LTC_PKCS_1_PSS = 3 /* PKCS #1 v2.1 signature padding */
17 };
18
19 int pkcs_1_mgf1( int hash_idx,
20 const unsigned char *seed, unsigned long seedlen,
8 unsigned char *mask, unsigned long masklen); 21 unsigned char *mask, unsigned long masklen);
9 22
10 int pkcs_1_i2osp(mp_int *n, unsigned long modulus_len, unsigned char *out); 23 int pkcs_1_i2osp(void *n, unsigned long modulus_len, unsigned char *out);
11 int pkcs_1_os2ip(mp_int *n, unsigned char *in, unsigned long inlen); 24 int pkcs_1_os2ip(void *n, unsigned char *in, unsigned long inlen);
25
26 /* *** v1.5 padding */
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);
12 43
13 /* *** v2.1 padding */ 44 /* *** v2.1 padding */
14 int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen, 45 int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen,
15 const unsigned char *lparam, unsigned long lparamlen, 46 const unsigned char *lparam, unsigned long lparamlen,
16 unsigned long modulus_bitlen, prng_state *prng, 47 unsigned long modulus_bitlen, prng_state *prng,
52 unsigned char *out, unsigned long *outlen); 83 unsigned char *out, unsigned long *outlen);
53 84
54 #endif /* PKCS_5 */ 85 #endif /* PKCS_5 */
55 86
56 /* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_pkcs.h,v $ */ 87 /* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_pkcs.h,v $ */
57 /* $Revision: 1.3 $ */ 88 /* $Revision: 1.7 $ */
58 /* $Date: 2005/05/14 11:46:08 $ */ 89 /* $Date: 2006/11/15 12:44:59 $ */