~ubuntu-branches/ubuntu/utopic/dropbear/utopic-proposed

« back to all changes in this revision

Viewing changes to libtomcrypt/src/headers/tomcrypt_pkcs.h

  • Committer: Bazaar Package Importer
  • Author(s): Matt Johnston
  • Date: 2005-12-08 19:20:21 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051208192021-nyp9rwnt77nsg6ty
Tags: 0.47-1
* New upstream release.
* SECURITY: Fix incorrect buffer sizing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* PKCS Header Info */
 
2
 
 
3
/* ===> PKCS #1 -- RSA Cryptography <=== */
 
4
#ifdef PKCS_1
 
5
 
 
6
int pkcs_1_mgf1(const unsigned char *seed, unsigned long seedlen,
 
7
                      int            hash_idx,
 
8
                      unsigned char *mask, unsigned long masklen);
 
9
 
 
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);
 
12
 
 
13
/* *** v2.1 padding */
 
14
int pkcs_1_oaep_encode(const unsigned char *msg,    unsigned long msglen,
 
15
                       const unsigned char *lparam, unsigned long lparamlen,
 
16
                             unsigned long modulus_bitlen, prng_state *prng,
 
17
                             int           prng_idx,         int  hash_idx,
 
18
                             unsigned char *out,    unsigned long *outlen);
 
19
 
 
20
int pkcs_1_oaep_decode(const unsigned char *msg,    unsigned long msglen,
 
21
                       const unsigned char *lparam, unsigned long lparamlen,
 
22
                             unsigned long modulus_bitlen, int hash_idx,
 
23
                             unsigned char *out,    unsigned long *outlen,
 
24
                             int           *res);
 
25
 
 
26
int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen,
 
27
                            unsigned long saltlen,  prng_state   *prng,     
 
28
                            int           prng_idx, int           hash_idx,
 
29
                            unsigned long modulus_bitlen,
 
30
                            unsigned char *out,     unsigned long *outlen);
 
31
 
 
32
int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen,
 
33
                      const unsigned char *sig,     unsigned long siglen,
 
34
                            unsigned long saltlen,  int           hash_idx,
 
35
                            unsigned long modulus_bitlen, int    *res);
 
36
 
 
37
#endif /* PKCS_1 */
 
38
 
 
39
/* ===> PKCS #5 -- Password Based Cryptography <=== */
 
40
#ifdef PKCS_5
 
41
 
 
42
/* Algorithm #1 (old) */
 
43
int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, 
 
44
                const unsigned char *salt, 
 
45
                int iteration_count,  int hash_idx,
 
46
                unsigned char *out,   unsigned long *outlen);
 
47
 
 
48
/* Algorithm #2 (new) */
 
49
int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, 
 
50
                const unsigned char *salt,     unsigned long salt_len,
 
51
                int iteration_count,           int hash_idx,
 
52
                unsigned char *out,            unsigned long *outlen);
 
53
 
 
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 $ */