Added SILC Thread Queue API
[silc.git] / lib / silccrypt / dsa.h
1 /*
2
3   dsa.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2007 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19
20 #ifndef DSA_H
21 #define DSA_H
22
23 /* DSA Public key */
24 typedef struct {
25   SilcMPInt g;                  /* generator */
26   SilcMPInt p;                  /* prime */
27   SilcMPInt q;                  /* prime */
28   SilcMPInt y;                  /* public key */
29   SilcUInt16 bits;              /* bits in key */
30   SilcUInt16 group_order;       /* group order (size) */
31 } DsaPublicKey;
32
33 /* DSA Private key */
34 typedef struct {
35   SilcMPInt g;                  /* generator */
36   SilcMPInt p;                  /* prime */
37   SilcMPInt q;                  /* prime */
38   SilcMPInt y;                  /* public key */
39   SilcMPInt x;                  /* private key */
40   SilcUInt16 bits;              /* bits in key */
41   SilcUInt16 group_order;       /* group order (size) */
42 } DsaPrivateKey;
43
44 SILC_PKCS_ALG_GENERATE_KEY(silc_dsa_generate_key);
45 SILC_PKCS_ALG_IMPORT_PUBLIC_KEY(silc_dsa_import_public_key);
46 SILC_PKCS_ALG_EXPORT_PUBLIC_KEY(silc_dsa_export_public_key);
47 SILC_PKCS_ALG_PUBLIC_KEY_BITLEN(silc_dsa_public_key_bitlen);
48 SILC_PKCS_ALG_PUBLIC_KEY_COPY(silc_dsa_public_key_copy);
49 SILC_PKCS_ALG_PUBLIC_KEY_COMPARE(silc_dsa_public_key_compare);
50 SILC_PKCS_ALG_PUBLIC_KEY_FREE(silc_dsa_public_key_free);
51 SILC_PKCS_ALG_IMPORT_PRIVATE_KEY(silc_dsa_import_private_key);
52 SILC_PKCS_ALG_EXPORT_PRIVATE_KEY(silc_dsa_export_private_key);
53 SILC_PKCS_ALG_PRIVATE_KEY_BITLEN(silc_dsa_private_key_bitlen);
54 SILC_PKCS_ALG_PRIVATE_KEY_FREE(silc_dsa_private_key_free);
55 SILC_PKCS_ALG_ENCRYPT(silc_dsa_encrypt);
56 SILC_PKCS_ALG_DECRYPT(silc_dsa_decrypt);
57 SILC_PKCS_ALG_SIGN(silc_dsa_sign);
58 SILC_PKCS_ALG_VERIFY(silc_dsa_verify);
59
60 #endif /* DSA_H */