]>
git.saurik.com Git - apple/security.git/blob - SecurityTests/cspxutils/utilLib/ssleayUtils.h
2 * ssleayUtils.h - common routines for CDSA/openssl compatibility testing
6 * Clients of this module do not need to know about or see anything from the
9 #ifndef _SSLEAY_UTILS_H_
10 #define _SSLEAY_UTILS_H_
11 #include <Security/cssmtype.h>
13 typedef void *EAY_KEY
;
16 * Create a symmetric key.
18 CSSM_RETURN
eayGenSymKey(
21 const CSSM_DATA
*keyData
,
22 EAY_KEY
*key
); // RETURNED
25 * Free a key created in eayGenSymKey
27 CSSM_RETURN
eayFreeKey(
33 CSSM_RETURN
eayEncryptDecrypt(
36 CSSM_ALGORITHMS encrAlg
,
37 CSSM_ENCRYPT_MODE mode
, // CSSM_ALGMODE_CBC ONLY!
38 const CSSM_DATA
*iv
, //ĂŠoptional per mode
39 const CSSM_DATA
*inData
,
40 CSSM_DATA_PTR outData
); // mallocd and RETURNED
42 /*** EVP-based encrypt/decrypt ***/
44 int evpEncryptDecrypt(
45 CSSM_ALGORITHMS alg
, // AES 128 only for now
47 const CSSM_DATA
*keyData
, // may be larger than the key size we use
48 unsigned keyLengthInBits
,
49 CSSM_ENCRYPT_MODE mode
, // CSSM_ALGMODE_CBC_IV8, ECB, always padding
50 const CSSM_DATA
*iv
, // optional per mode
51 const CSSM_DATA
*inData
,
52 CSSM_DATA_PTR outData
); // CSSM_MALLOCd and RETURNED
54 #endif /* _EAY_UTILS_H_ */