Warning, file /include/nettle/dsa-compat.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #ifndef NETTLE_DSA_COMPAT_H_INCLUDED
0035 #define NETTLE_DSA_COMPAT_H_INCLUDED
0036
0037 #include "dsa.h"
0038
0039 #include "sha1.h"
0040 #include "sha2.h"
0041
0042
0043 #define dsa_public_key_init nettle_dsa_public_key_init
0044 #define dsa_public_key_clear nettle_dsa_public_key_clear
0045 #define dsa_private_key_init nettle_dsa_private_key_init
0046 #define dsa_private_key_clear nettle_dsa_private_key_clear
0047 #define dsa_sha1_sign nettle_dsa_sha1_sign
0048 #define dsa_sha1_verify nettle_dsa_sha1_verify
0049 #define dsa_sha256_sign nettle_dsa_sha256_sign
0050 #define dsa_sha256_verify nettle_dsa_sha256_verify
0051 #define dsa_sha1_sign_digest nettle_dsa_sha1_sign_digest
0052 #define dsa_sha1_verify_digest nettle_dsa_sha1_verify_digest
0053 #define dsa_sha256_sign_digest nettle_dsa_sha256_sign_digest
0054 #define dsa_sha256_verify_digest nettle_dsa_sha256_verify_digest
0055 #define dsa_compat_generate_keypair nettle_dsa_compat_generate_keypair
0056
0057
0058 #undef dsa_generate_keypair
0059 #define dsa_generate_keypair nettle_dsa_compat_generate_keypair
0060
0061 #ifdef __cplusplus
0062 extern "C" {
0063 #endif
0064
0065 struct dsa_public_key
0066 {
0067
0068
0069
0070
0071 mpz_t p;
0072 mpz_t q;
0073 mpz_t g;
0074
0075
0076 mpz_t y;
0077 };
0078
0079 struct dsa_private_key
0080 {
0081
0082
0083 mpz_t x;
0084 };
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107 void
0108 dsa_public_key_init(struct dsa_public_key *key);
0109
0110
0111 void
0112 dsa_public_key_clear(struct dsa_public_key *key);
0113
0114
0115
0116 void
0117 dsa_private_key_init(struct dsa_private_key *key);
0118
0119
0120 void
0121 dsa_private_key_clear(struct dsa_private_key *key);
0122
0123 int
0124 dsa_sha1_sign(const struct dsa_public_key *pub,
0125 const struct dsa_private_key *key,
0126 void *random_ctx, nettle_random_func *random,
0127 struct sha1_ctx *hash,
0128 struct dsa_signature *signature);
0129
0130 int
0131 dsa_sha256_sign(const struct dsa_public_key *pub,
0132 const struct dsa_private_key *key,
0133 void *random_ctx, nettle_random_func *random,
0134 struct sha256_ctx *hash,
0135 struct dsa_signature *signature);
0136
0137 int
0138 dsa_sha1_verify(const struct dsa_public_key *key,
0139 struct sha1_ctx *hash,
0140 const struct dsa_signature *signature);
0141
0142 int
0143 dsa_sha256_verify(const struct dsa_public_key *key,
0144 struct sha256_ctx *hash,
0145 const struct dsa_signature *signature);
0146
0147 int
0148 dsa_sha1_sign_digest(const struct dsa_public_key *pub,
0149 const struct dsa_private_key *key,
0150 void *random_ctx, nettle_random_func *random,
0151 const uint8_t *digest,
0152 struct dsa_signature *signature);
0153 int
0154 dsa_sha256_sign_digest(const struct dsa_public_key *pub,
0155 const struct dsa_private_key *key,
0156 void *random_ctx, nettle_random_func *random,
0157 const uint8_t *digest,
0158 struct dsa_signature *signature);
0159
0160 int
0161 dsa_sha1_verify_digest(const struct dsa_public_key *key,
0162 const uint8_t *digest,
0163 const struct dsa_signature *signature);
0164
0165 int
0166 dsa_sha256_verify_digest(const struct dsa_public_key *key,
0167 const uint8_t *digest,
0168 const struct dsa_signature *signature);
0169
0170
0171 int
0172 dsa_generate_keypair(struct dsa_public_key *pub,
0173 struct dsa_private_key *key,
0174
0175 void *random_ctx, nettle_random_func *random,
0176 void *progress_ctx, nettle_progress_func *progress,
0177 unsigned p_bits, unsigned q_bits);
0178
0179 #ifdef __cplusplus
0180 }
0181 #endif
0182
0183 #endif