5 * Created on 11/14/2017
7 * Copyright (c) 2017 Apple Inc. All rights reserved.
11 #ifndef _CORECRYPTO_CC_ERROR_H_
12 #define _CORECRYPTO_CC_ERROR_H_
17 /* the default error code */
23 CCERR_INTERRUPTS
= -4,
24 CCERR_CRYPTO_CONFIG
= -5,
29 CCERR_OUT_OF_ENTROPY
= -10,
33 CCERR_MEMORY_ALLOC_FAIL
= -13,
35 CCEC_GENERATE_KEY_DEFAULT_ERR
= -14,
36 CCEC_GENERATE_KEY_TOO_MANY_TRIES
= -15,
37 CCEC_GENERATE_KEY_MULT_FAIL
= -16,
38 CCEC_GENERATE_KEY_AFF_FAIL
= -17,
39 CCEC_GENERATE_KEY_CONSISTENCY
= -18,
40 CCEC_GENERATE_NOT_ON_CURVE
= -19,
41 CCEC_GENERATE_NOT_ENOUGH_ENTROPY
= -20,
42 CCEC_GENERATE_NOT_SUPPORTED
= -21,
43 CCEC_GENERATE_INVALID_INPUT
= -22,
45 // Program error: buffer too small or encrypted message is too small
46 CCRSA_INVALID_INPUT
= -23,
47 // Invalid crypto configuration: Hash length versus RSA key size
48 CCRSA_INVALID_CONFIG
= -24,
49 CCRSA_ENCODING_ERROR
= -25,
50 CCRSA_DECODING_ERROR
= -26,
52 // The data is invalid (we won't say more for security)
53 CCRSA_PRIVATE_OP_ERROR
= -27,
54 CCRSA_KEY_ERROR
= -28,
56 // Key generation specific
57 CCRSA_KEYGEN_PRIME_NOT_FOUND
= -29,
58 CCRSA_KEYGEN_PRIME_NEED_NEW_SEED
= -30,
59 CCRSA_KEYGEN_PRIME_TOO_MANY_ITERATIONS
= -31,
60 CCRSA_KEYGEN_PRIME_SEED_GENERATION_ERROR
= -32,
61 CCRSA_KEYGEN_MODULUS_CRT_INV_ERROR
= -33,
62 CCRSA_KEYGEN_NEXT_PRIME_ERROR
= -34,
63 CCRSA_KEYGEN_SEED_X_ERROR
= -35,
64 CCRSA_KEYGEN_SEED_r_ERROR
= -36,
65 CCRSA_KEYGEN_KEYGEN_CONSISTENCY_FAIL
= -37,
66 CCRSA_KEYGEN_R1R2_SIZE_ERROR
= -38,
67 CCRSA_KEYGEN_PQ_DELTA_ERROR
= -39,
69 CCRSA_FIPS_KEYGEN_DISABLED
= -40,
72 CCZP_INV_NO_INVERSE
= -42,
73 CCZP_INV_INVALID_INPUT
= -43,
75 CCZ_INVALID_INPUT_ERROR
= -44,
76 CCZ_INVALID_RADIX_ERROR
= -45,
78 CCDH_ERROR_DEFAULT
= -46,
79 CCDH_GENERATE_KEY_TOO_MANY_TRIES
= -47,
80 CCDH_NOT_SUPPORTED_CONFIGURATION
= -48,
81 CCDH_SAFETY_CHECK
= -49,
82 CCDH_PUBLIC_KEY_MISSING
= -50,
83 CCDH_INVALID_DOMAIN_PARAMETER
= -51,
84 CCDH_INVALID_INPUT
= -52,
85 CCDH_DOMAIN_PARAMETER_MISMATCH
= -53,
86 CCDH_GENERATE_KEY_CONSISTENCY
= -54,
88 CCSRP_ERROR_DEFAULT
= -55,
89 CCSRP_GENERATE_KEY_TOO_MANY_TRIES
= -56,
90 CCSRP_NOT_SUPPORTED_CONFIGURATION
= -57,
91 CCSRP_SAFETY_CHECK
= -58,
92 CCSRP_PUBLIC_KEY_MISSING
= -59,
93 CCSRP_INVALID_DOMAIN_PARAMETER
= -60,
95 CCDRBG_STATUS_ERROR
= -61,
96 CCDRBG_STATUS_NEED_RESEED
= -62,
97 CCDRBG_STATUS_PARAM_ERROR
= -63,
98 // If this value is returned, the caller must abort or panic the process for
99 // security reasons. for example in the case of catastrophic error in
100 // http://csrc.nist.gov/publications/drafts/800-90/sp800_90a_r1_draft.pdf
101 // ccdrbg calls abort() or panic(), if they are available in the system.
102 CCDRBG_STATUS_ABORT
= -64,
104 CCKPRNG_NEED_ENTROPY
= -65,
107 CCMODE_INVALID_INPUT
= -67,
108 CCMODE_INVALID_CALL_SEQUENCE
= -68,
109 CCMODE_INTEGRITY_FAILURE
= -69,
110 CCMODE_NOT_SUPPORTED
= -70,
111 CCMODE_INTERNAL_ERROR
= -71,
113 // Configuration or unexpected issue
114 CCPOST_GENERIC_FAILURE
= -72,
115 CCPOST_LIBRARY_ERROR
= -73,
116 CCPOST_INTEGRITY_ERROR
= -74,
117 // Output of the algo is not as expected
118 CCPOST_KAT_FAILURE
= -75,
121 #define CCDRBG_STATUS_OK CCERR_OK
122 #define CCKPRNG_OK CCERR_OK
124 #endif /* _CORECRYPTO_CC_ERROR_H_ */