~ubuntu-branches/ubuntu/vivid/nettle/vivid-proposed

« back to all changes in this revision

Viewing changes to pkcs1.h

  • Committer: Package Import Robot
  • Author(s): Magnus Holmgren
  • Date: 2013-05-04 19:50:28 UTC
  • mfrom: (1.4.6) (3.1.11 experimental)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20130504195028-fp6c9fw1tsm5scwa
Tags: 2.7-1
* New upstream release (Closes: #706081).
* Include watch file improvements from Bart Martens <bartm@debian.org>
  via the QA system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
/* nettle, low-level cryptographics library
7
7
 *
8
 
 * Copyright (C) 2003 Niels M�ller
 
8
 * Copyright (C) 2003 Niels Möller
9
9
 *  
10
10
 * The nettle library is free software; you can redistribute it and/or modify
11
11
 * it under the terms of the GNU Lesser General Public License as published by
19
19
 * 
20
20
 * You should have received a copy of the GNU Lesser General Public License
21
21
 * along with the nettle library; see the file COPYING.LIB.  If not, write to
22
 
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23
 
 * MA 02111-1307, USA.
 
22
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
23
 * MA 02111-1301, USA.
24
24
 */
25
25
 
26
26
#ifndef NETTLE_PKCS1_H_INCLUDED
34
34
#endif
35
35
 
36
36
/* Name mangling */
37
 
#define pkcs1_signature_prefix nettle_pkcs1_signature_prefix
 
37
#define _pkcs1_signature_prefix _nettle_pkcs1_signature_prefix
 
38
#define pkcs1_rsa_digest_encode nettle_pkcs1_rsa_digest_encode
38
39
#define pkcs1_rsa_md5_encode nettle_pkcs1_rsa_md5_encode
39
40
#define pkcs1_rsa_md5_encode_digest nettle_pkcs1_rsa_md5_encode_digest
40
41
#define pkcs1_rsa_sha1_encode nettle_pkcs1_rsa_sha1_encode
43
44
#define pkcs1_rsa_sha256_encode_digest nettle_pkcs1_rsa_sha256_encode_digest
44
45
#define pkcs1_rsa_sha512_encode nettle_pkcs1_rsa_sha512_encode
45
46
#define pkcs1_rsa_sha512_encode_digest nettle_pkcs1_rsa_sha512_encode_digest
 
47
#define pkcs1_encrypt nettle_pkcs1_encrypt
 
48
#define pkcs1_decrypt nettle_pkcs1_decrypt
46
49
 
47
50
struct md5_ctx;
48
51
struct sha1_ctx;
49
52
struct sha256_ctx;
50
53
struct sha512_ctx;
51
54
 
52
 
int
53
 
pkcs1_signature_prefix(unsigned size,
54
 
                       uint8_t *buffer,
55
 
                       unsigned id_size,
56
 
                       const uint8_t *id,
57
 
                       unsigned digest_size);
 
55
uint8_t *
 
56
_pkcs1_signature_prefix(unsigned key_size,
 
57
                        uint8_t *buffer,
 
58
                        unsigned id_size,
 
59
                        const uint8_t *id,
 
60
                        unsigned digest_size);
 
61
 
 
62
int
 
63
pkcs1_encrypt (unsigned key_size,
 
64
               /* For padding */
 
65
               void *random_ctx, nettle_random_func *random,
 
66
               unsigned length, const uint8_t *message,
 
67
               mpz_t m);
 
68
 
 
69
int
 
70
pkcs1_decrypt (unsigned key_size,
 
71
               const mpz_t m,
 
72
               unsigned *length, uint8_t *message);
 
73
 
 
74
int
 
75
pkcs1_rsa_digest_encode(mpz_t m, unsigned key_size,
 
76
                        unsigned di_length, const uint8_t *digest_info);
58
77
 
59
78
int
60
79
pkcs1_rsa_md5_encode(mpz_t m, unsigned length, struct md5_ctx *hash);