#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
#include <CommonCrypto/CommonDigest.h>
#endif
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
#include <CommonCrypto/CommonCryptor.h>
+#endif
#include <evp.h>
#include <evp-cc.h>
*
*/
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
+
struct cc_key {
CCCryptorRef href;
};
return init_cc_key(encp, kCCAlgorithm3DES, 0, key, kCCKeySize3DES, iv, &cc->href);
}
+#endif /* HAVE_COMMONCRYPTO_COMMONCRYPTOR_H */
+
/**
* The tripple DES cipher type (Apple CommonCrypto provider)
*
const EVP_CIPHER *
EVP_cc_des_ede3_cbc(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
static const EVP_CIPHER des_ede3_cbc = {
0,
8,
NULL
};
return &des_ede3_cbc;
+#else
+ return NULL;
+#endif
}
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
/*
*
*/
struct cc_key *cc = ctx->cipher_data;
return init_cc_key(encp, kCCAlgorithmDES, 0, key, kCCBlockSizeDES, iv, &cc->href);
}
+#endif
/**
* The DES cipher type (Apple CommonCrypto provider)
const EVP_CIPHER *
EVP_cc_des_cbc(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
static const EVP_CIPHER des_ede3_cbc = {
0,
kCCBlockSizeDES,
NULL
};
return &des_ede3_cbc;
+#else
+ return NULL;
+#endif
}
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
/*
*
*/
struct cc_key *cc = ctx->cipher_data;
return init_cc_key(encp, kCCAlgorithmAES128, 0, key, ctx->cipher->key_len, iv, &cc->href);
}
+#endif
/**
* The AES-128 cipher type (Apple CommonCrypto provider)
const EVP_CIPHER *
EVP_cc_aes_128_cbc(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
static const EVP_CIPHER c = {
0,
kCCBlockSizeAES128,
NULL
};
return &c;
+#else
+ return NULL;
+#endif
}
/**
const EVP_CIPHER *
EVP_cc_aes_192_cbc(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
static const EVP_CIPHER c = {
0,
kCCBlockSizeAES128,
NULL
};
return &c;
+#else
+ return NULL;
+#endif
}
/**
const EVP_CIPHER *
EVP_cc_aes_256_cbc(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
static const EVP_CIPHER c = {
0,
kCCBlockSizeAES128,
NULL
};
return &c;
+#else
+ return NULL;
+#endif
}
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
/*
*
*/
return init_cc_key(1, kCCAlgorithmAES128, kCCOptionECBMode,
key, ctx->cipher->key_len, NULL, &cc->href);
}
+#endif
/**
* The AES-128 CFB8 cipher type (Apple CommonCrypto provider)
const EVP_CIPHER *
EVP_cc_aes_128_cfb8(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
static const EVP_CIPHER c = {
0,
1,
NULL
};
return &c;
+#else
+ return NULL;
+#endif
}
/**
const EVP_CIPHER *
EVP_cc_aes_192_cfb8(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
static const EVP_CIPHER c = {
0,
1,
NULL
};
return &c;
+#else
+ return NULL;
+#endif
}
/**
const EVP_CIPHER *
EVP_cc_aes_256_cfb8(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
static const EVP_CIPHER c = {
0,
kCCBlockSizeAES128,
NULL
};
return &c;
+#else
+ return NULL;
+#endif
}
/*
return NULL;
}
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
+
/*
*
*/
return init_cc_key(encp, kCCAlgorithmRC4, 0, key, ctx->key_len, iv, &cc->href);
}
+#endif
+
/**
+
* The RC4 cipher type (Apple CommonCrypto provider)
*
* @return the RC4 EVP_CIPHER pointer.
const EVP_CIPHER *
EVP_cc_rc4(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
static const EVP_CIPHER rc4 = {
0,
1,
NULL
};
return &rc4;
+#else
+ return NULL;
+#endif
}
const EVP_CIPHER *
EVP_cc_rc4_40(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONCRYPTOR_H
static const EVP_CIPHER rc4_40 = {
0,
1,
NULL
};
return &rc4_40;
+#else
+ return NULL;
+#endif
}
#endif /* __APPLE__ */