diff options
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa.h')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa.h | 67 |
1 files changed, 13 insertions, 54 deletions
diff --git a/src/lib/libcrypto/rsa/rsa.h b/src/lib/libcrypto/rsa/rsa.h index 0b639cd37f..fc3bb5f86d 100644 --- a/src/lib/libcrypto/rsa/rsa.h +++ b/src/lib/libcrypto/rsa/rsa.h | |||
@@ -157,41 +157,33 @@ struct rsa_st | |||
157 | #define RSA_3 0x3L | 157 | #define RSA_3 0x3L |
158 | #define RSA_F4 0x10001L | 158 | #define RSA_F4 0x10001L |
159 | 159 | ||
160 | #define RSA_METHOD_FLAG_NO_CHECK 0x0001 /* don't check pub/private match */ | 160 | #define RSA_METHOD_FLAG_NO_CHECK 0x01 /* don't check pub/private match */ |
161 | 161 | ||
162 | #define RSA_FLAG_CACHE_PUBLIC 0x0002 | 162 | #define RSA_FLAG_CACHE_PUBLIC 0x02 |
163 | #define RSA_FLAG_CACHE_PRIVATE 0x0004 | 163 | #define RSA_FLAG_CACHE_PRIVATE 0x04 |
164 | #define RSA_FLAG_BLINDING 0x0008 | 164 | #define RSA_FLAG_BLINDING 0x08 |
165 | #define RSA_FLAG_THREAD_SAFE 0x0010 | 165 | #define RSA_FLAG_THREAD_SAFE 0x10 |
166 | /* This flag means the private key operations will be handled by rsa_mod_exp | 166 | /* This flag means the private key operations will be handled by rsa_mod_exp |
167 | * and that they do not depend on the private key components being present: | 167 | * and that they do not depend on the private key components being present: |
168 | * for example a key stored in external hardware. Without this flag bn_mod_exp | 168 | * for example a key stored in external hardware. Without this flag bn_mod_exp |
169 | * gets called when private key components are absent. | 169 | * gets called when private key components are absent. |
170 | */ | 170 | */ |
171 | #define RSA_FLAG_EXT_PKEY 0x0020 | 171 | #define RSA_FLAG_EXT_PKEY 0x20 |
172 | 172 | ||
173 | /* This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify functions. | 173 | /* This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify functions. |
174 | */ | 174 | */ |
175 | #define RSA_FLAG_SIGN_VER 0x0040 | 175 | #define RSA_FLAG_SIGN_VER 0x40 |
176 | 176 | ||
177 | #define RSA_FLAG_NO_BLINDING 0x0080 /* new with 0.9.6j and 0.9.7b; the built-in | 177 | #define RSA_FLAG_NO_BLINDING 0x80 /* new with 0.9.6j and 0.9.7b; the built-in |
178 | * RSA implementation now uses blinding by | 178 | * RSA implementation now uses blinding by |
179 | * default (ignoring RSA_FLAG_BLINDING), | 179 | * default (ignoring RSA_FLAG_BLINDING), |
180 | * but other engines might not need it | 180 | * but other engines might not need it |
181 | */ | 181 | */ |
182 | #define RSA_FLAG_NO_EXP_CONSTTIME 0x0100 /* new with 0.9.7h; the built-in RSA | ||
183 | * implementation now uses constant time | ||
184 | * modular exponentiation for secret exponents | ||
185 | * by default. This flag causes the | ||
186 | * faster variable sliding window method to | ||
187 | * be used for all exponents. | ||
188 | */ | ||
189 | 182 | ||
190 | #define RSA_PKCS1_PADDING 1 | 183 | #define RSA_PKCS1_PADDING 1 |
191 | #define RSA_SSLV23_PADDING 2 | 184 | #define RSA_SSLV23_PADDING 2 |
192 | #define RSA_NO_PADDING 3 | 185 | #define RSA_NO_PADDING 3 |
193 | #define RSA_PKCS1_OAEP_PADDING 4 | 186 | #define RSA_PKCS1_OAEP_PADDING 4 |
194 | #define RSA_X931_PADDING 5 | ||
195 | 187 | ||
196 | #define RSA_PKCS1_PADDING_SIZE 11 | 188 | #define RSA_PKCS1_PADDING_SIZE 11 |
197 | 189 | ||
@@ -204,15 +196,6 @@ int RSA_size(const RSA *); | |||
204 | RSA * RSA_generate_key(int bits, unsigned long e,void | 196 | RSA * RSA_generate_key(int bits, unsigned long e,void |
205 | (*callback)(int,int,void *),void *cb_arg); | 197 | (*callback)(int,int,void *),void *cb_arg); |
206 | int RSA_check_key(const RSA *); | 198 | int RSA_check_key(const RSA *); |
207 | #ifdef OPENSSL_FIPS | ||
208 | int RSA_X931_derive(RSA *rsa, BIGNUM *p1, BIGNUM *p2, BIGNUM *q1, BIGNUM *q2, | ||
209 | void (*cb)(int, int, void *), void *cb_arg, | ||
210 | const BIGNUM *Xp1, const BIGNUM *Xp2, const BIGNUM *Xp, | ||
211 | const BIGNUM *Xq1, const BIGNUM *Xq2, const BIGNUM *Xq, | ||
212 | const BIGNUM *e); | ||
213 | RSA *RSA_X931_generate_key(int bits, const BIGNUM *e, | ||
214 | void (*cb)(int,int,void *), void *cb_arg); | ||
215 | #endif | ||
216 | /* next 4 return -1 on error */ | 199 | /* next 4 return -1 on error */ |
217 | int RSA_public_encrypt(int flen, const unsigned char *from, | 200 | int RSA_public_encrypt(int flen, const unsigned char *from, |
218 | unsigned char *to, RSA *rsa,int padding); | 201 | unsigned char *to, RSA *rsa,int padding); |
@@ -285,8 +268,6 @@ int RSA_padding_add_PKCS1_type_2(unsigned char *to,int tlen, | |||
285 | const unsigned char *f,int fl); | 268 | const unsigned char *f,int fl); |
286 | int RSA_padding_check_PKCS1_type_2(unsigned char *to,int tlen, | 269 | int RSA_padding_check_PKCS1_type_2(unsigned char *to,int tlen, |
287 | const unsigned char *f,int fl,int rsa_len); | 270 | const unsigned char *f,int fl,int rsa_len); |
288 | int PKCS1_MGF1(unsigned char *mask, long len, | ||
289 | const unsigned char *seed, long seedlen, const EVP_MD *dgst); | ||
290 | int RSA_padding_add_PKCS1_OAEP(unsigned char *to,int tlen, | 271 | int RSA_padding_add_PKCS1_OAEP(unsigned char *to,int tlen, |
291 | const unsigned char *f,int fl, | 272 | const unsigned char *f,int fl, |
292 | const unsigned char *p,int pl); | 273 | const unsigned char *p,int pl); |
@@ -301,17 +282,6 @@ int RSA_padding_add_none(unsigned char *to,int tlen, | |||
301 | const unsigned char *f,int fl); | 282 | const unsigned char *f,int fl); |
302 | int RSA_padding_check_none(unsigned char *to,int tlen, | 283 | int RSA_padding_check_none(unsigned char *to,int tlen, |
303 | const unsigned char *f,int fl,int rsa_len); | 284 | const unsigned char *f,int fl,int rsa_len); |
304 | int RSA_padding_add_X931(unsigned char *to,int tlen, | ||
305 | const unsigned char *f,int fl); | ||
306 | int RSA_padding_check_X931(unsigned char *to,int tlen, | ||
307 | const unsigned char *f,int fl,int rsa_len); | ||
308 | int RSA_X931_hash_id(int nid); | ||
309 | |||
310 | int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash, | ||
311 | const EVP_MD *Hash, const unsigned char *EM, int sLen); | ||
312 | int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, | ||
313 | const unsigned char *mHash, | ||
314 | const EVP_MD *Hash, int sLen); | ||
315 | 285 | ||
316 | int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 286 | int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
317 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | 287 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
@@ -341,24 +311,20 @@ void ERR_load_RSA_strings(void); | |||
341 | #define RSA_F_RSA_NULL 124 | 311 | #define RSA_F_RSA_NULL 124 |
342 | #define RSA_F_RSA_PADDING_ADD_NONE 107 | 312 | #define RSA_F_RSA_PADDING_ADD_NONE 107 |
343 | #define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 | 313 | #define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 |
344 | #define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125 | ||
345 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 | 314 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 |
346 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 | 315 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 |
347 | #define RSA_F_RSA_PADDING_ADD_SSLV23 110 | 316 | #define RSA_F_RSA_PADDING_ADD_SSLV23 110 |
348 | #define RSA_F_RSA_PADDING_ADD_X931 127 | ||
349 | #define RSA_F_RSA_PADDING_CHECK_NONE 111 | 317 | #define RSA_F_RSA_PADDING_CHECK_NONE 111 |
350 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122 | 318 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122 |
351 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112 | 319 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112 |
352 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113 | 320 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113 |
353 | #define RSA_F_RSA_PADDING_CHECK_SSLV23 114 | 321 | #define RSA_F_RSA_PADDING_CHECK_SSLV23 114 |
354 | #define RSA_F_RSA_PADDING_CHECK_X931 128 | ||
355 | #define RSA_F_RSA_PRINT 115 | 322 | #define RSA_F_RSA_PRINT 115 |
356 | #define RSA_F_RSA_PRINT_FP 116 | 323 | #define RSA_F_RSA_PRINT_FP 116 |
357 | #define RSA_F_RSA_SIGN 117 | 324 | #define RSA_F_RSA_SIGN 117 |
358 | #define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118 | 325 | #define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118 |
359 | #define RSA_F_RSA_VERIFY 119 | 326 | #define RSA_F_RSA_VERIFY 119 |
360 | #define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 | 327 | #define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 |
361 | #define RSA_F_RSA_VERIFY_PKCS1_PSS 126 | ||
362 | 328 | ||
363 | /* Reason codes. */ | 329 | /* Reason codes. */ |
364 | #define RSA_R_ALGORITHM_MISMATCH 100 | 330 | #define RSA_R_ALGORITHM_MISMATCH 100 |
@@ -378,14 +344,9 @@ void ERR_load_RSA_strings(void); | |||
378 | #define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124 | 344 | #define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124 |
379 | #define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125 | 345 | #define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125 |
380 | #define RSA_R_D_E_NOT_CONGRUENT_TO_1 123 | 346 | #define RSA_R_D_E_NOT_CONGRUENT_TO_1 123 |
381 | #define RSA_R_FIRST_OCTET_INVALID 133 | ||
382 | #define RSA_R_INVALID_HEADER 137 | ||
383 | #define RSA_R_INVALID_MESSAGE_LENGTH 131 | 347 | #define RSA_R_INVALID_MESSAGE_LENGTH 131 |
384 | #define RSA_R_INVALID_PADDING 138 | ||
385 | #define RSA_R_INVALID_TRAILER 139 | ||
386 | #define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 | 348 | #define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 |
387 | #define RSA_R_KEY_SIZE_TOO_SMALL 120 | 349 | #define RSA_R_KEY_SIZE_TOO_SMALL 120 |
388 | #define RSA_R_LAST_OCTET_INVALID 134 | ||
389 | #define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 | 350 | #define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 |
390 | #define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 | 351 | #define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 |
391 | #define RSA_R_OAEP_DECODING_ERROR 121 | 352 | #define RSA_R_OAEP_DECODING_ERROR 121 |
@@ -393,8 +354,6 @@ void ERR_load_RSA_strings(void); | |||
393 | #define RSA_R_P_NOT_PRIME 128 | 354 | #define RSA_R_P_NOT_PRIME 128 |
394 | #define RSA_R_Q_NOT_PRIME 129 | 355 | #define RSA_R_Q_NOT_PRIME 129 |
395 | #define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130 | 356 | #define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130 |
396 | #define RSA_R_SLEN_CHECK_FAILED 136 | ||
397 | #define RSA_R_SLEN_RECOVERY_FAILED 135 | ||
398 | #define RSA_R_SSLV3_ROLLBACK_ATTACK 115 | 357 | #define RSA_R_SSLV3_ROLLBACK_ATTACK 115 |
399 | #define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 | 358 | #define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 |
400 | #define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 | 359 | #define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 |