Go to the documentation of this file.
8 #ifndef _CONSTS_DEFINED
10 #define _CONSTS_DEFINED
21 #define MAX_INTLENGTH_DELTA 8192
23 #define MAX_INTLENGTH_DELTA 1048576
25 #define MAX_INTLENGTH ( INT_MAX - MAX_INTLENGTH_DELTA )
26 #define MAX_INTLENGTH_SHORT 16384
32 #define PGP_KEYID_SIZE 8
40 #define MIN_PRIVATE_KEYSIZE 18
41 #define MAX_PRIVATE_KEYSIZE ( ( CRYPT_MAX_PKCSIZE * 8 ) + 256 )
56 #define MIN_KEYSIZE bitsToBytes( 64 )
57 #define MAX_WORKING_KEYSIZE bitsToBytes( 256 )
65 #define MIN_PKCSIZE ( bitsToBytes( 1024 ) - 1 )
66 #define MIN_PKCSIZE_ECC ( bitsToBytes( 192 ) - 1 )
78 #define MIN_PKCSIZE_THRESHOLD ( bitsToBytes( 504 ) )
79 #define MIN_PKCSIZE_ECC_THRESHOLD ( bitsToBytes( 120 ) )
85 #define MIN_PKCSIZE_ECCPOINT ( 1 + ( MIN_PKCSIZE_ECC * 2 ) )
86 #define MIN_PKCSIZE_ECCPOINT_THRESHOLD \
87 ( 1 + ( MIN_PKCSIZE_ECC_THRESHOLD * 2 ) )
88 #define MAX_PKCSIZE_ECCPOINT ( 1 + ( CRYPT_MAX_PKCSIZE_ECC * 2 ) )
95 #define MAX_PKCENCRYPTED_SIZE ( 16 + ( CRYPT_MAX_PKCSIZE * 2 ) )
97 #define MAX_PKCENCRYPTED_SIZE CRYPT_MAX_PKCSIZE
106 #define MAX_PKC_OBJECTSIZE ( CRYPT_MAX_PKCSIZE * 2 )
115 #define MIN_CRYPT_OBJECTSIZE 64
122 #define MIN_CERTSIZE 256
129 #define MAX_ATTRIBUTE_SIZE 1024
135 #define MIN_BUFFER_SIZE 8192
144 #define MIN_NAME_LENGTH ( 2 * sizeof( wchar_t ) )
146 #define MIN_NAME_LENGTH 2
157 #define MIN_TIME_VALUE ( ( 2007 - 1970 ) * 365 * 86400L )
158 #define CURRENT_TIME_VALUE ( ( 2009 - 1970 ) * 365 * 86400L )
159 #define MIN_STORED_TIME_VALUE ( ( 1995 - 1970 ) * 365 * 86400L )
169 #define MIN_PORT_NUMBER 21
170 #define MAX_PORT_NUMBER 49151L
176 #define MAX_ERRMSG_SIZE 512
182 #define MAX_KEYSETUP_ITERATIONS 20000
186 #if defined( USE_CERTLEVEL_PKIX_FULL )
187 #define MAX_COMPLIANCE_LEVEL CRYPT_COMPLIANCELEVEL_PKIX_FULL
188 #elif defined( USE_CERTLEVEL_PKIX_PARTIAL )
189 #define MAX_COMPLIANCE_LEVEL CRYPT_COMPLIANCELEVEL_PKIX_PARTIAL
191 #define MAX_COMPLIANCE_LEVEL CRYPT_COMPLIANCELEVEL_STANDARD
230 #define FAILSAFE_ITERATIONS_SMALL 10
231 #define FAILSAFE_ITERATIONS_MED 50
232 #define FAILSAFE_ITERATIONS_LARGE 1000
234 #define FAILSAFE_ITERATIONS_MAX 10000
236 #define FAILSAFE_ITERATIONS_MAX 100000
244 #define FAILSAFE_ARRAYSIZE( array, elementType ) \
245 ( ( sizeof( array ) / sizeof( elementType ) ) - 1 )
250 #define MIN_DNS_SIZE 4
251 #define MAX_DNS_SIZE 255
252 #define MIN_RFC822_SIZE 7
253 #define MAX_RFC822_SIZE 255
254 #define MIN_URL_SIZE 12
255 #define MAX_URL_SIZE MAX_DNS_SIZE
263 #define HMAC_IPAD 0x36
264 #define HMAC_OPAD 0x5C
268 #define CRYPT_ERROR -1
279 #define DUMMY_INIT_PTR NULL
280 #define DUMMY_INIT_STRUCT { 0 }
290 #define OK_SPECIAL ( -4321 )
302 #define CRYPT_ARGERROR_OBJECT ( -1000 )
303 #define CRYPT_ARGERROR_VALUE ( -1001 )
304 #define CRYPT_ARGERROR_STR1 ( -1002 )
305 #define CRYPT_ARGERROR_STR2 ( -1003 )
306 #define CRYPT_ARGERROR_NUM1 ( -1004 )
307 #define CRYPT_ARGERROR_NUM2 ( -1005 )
309 #define cryptArgError( status ) \
310 ( ( status ) >= CRYPT_ARGERROR_NUM2 && ( status ) <= CRYPT_ARGERROR_OBJECT )
311 #define cryptStandardError( status ) \
312 ( ( status ) >= CRYPT_ENVELOPE_RESOURCE && ( status ) <= CRYPT_OK )
347 #define KEYUSAGE_SIGN ( CRYPT_KEYUSAGE_DIGITALSIGNATURE | \
348 CRYPT_KEYUSAGE_NONREPUDIATION )
349 #define KEYUSAGE_CA ( CRYPT_KEYUSAGE_KEYCERTSIGN | \
350 CRYPT_KEYUSAGE_CRLSIGN )
351 #define KEYUSAGE_CRYPT ( CRYPT_KEYUSAGE_KEYENCIPHERMENT )
352 #define KEYUSAGE_KEYAGREEMENT ( CRYPT_KEYUSAGE_KEYAGREEMENT | \
353 CRYPT_KEYUSAGE_ENCIPHERONLY | \
354 CRYPT_KEYUSAGE_DECIPHERONLY )