* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
+ * Portions Copyright (c) 2009 Apple Inc. All rights reserved.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
#include <string.h>
#include <assert.h>
+#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
#include <CommonCrypto/CommonDigest.h>
+#endif
#include <CommonCrypto/CommonCryptor.h>
#include <evp.h>
const EVP_MD *
EVP_cc_md2(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
static const struct hc_evp_md md2 = {
CC_MD2_DIGEST_LENGTH,
CC_MD2_BLOCK_BYTES,
(hc_evp_md_cleanup)NULL
};
return &md2;
+#else
+ return NULL;
+#endif
}
/**
const EVP_MD *
EVP_cc_md4(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
static const struct hc_evp_md md4 = {
CC_MD4_DIGEST_LENGTH,
CC_MD4_BLOCK_BYTES,
(hc_evp_md_cleanup)NULL
};
return &md4;
+#else
+ return NULL;
+#endif
}
/**
const EVP_MD *
EVP_cc_md5(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
static const struct hc_evp_md md5 = {
CC_MD5_DIGEST_LENGTH,
CC_MD5_BLOCK_BYTES,
(hc_evp_md_cleanup)NULL
};
return &md5;
+#else
+ return NULL;
+#endif
}
/**
const EVP_MD *
EVP_cc_sha1(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
static const struct hc_evp_md sha1 = {
CC_SHA1_DIGEST_LENGTH,
CC_SHA1_BLOCK_BYTES,
(hc_evp_md_cleanup)NULL
};
return &sha1;
+#else
+ return NULL;
+#endif
}
/**
const EVP_MD *
EVP_cc_sha256(void)
{
+#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H
static const struct hc_evp_md sha256 = {
CC_SHA256_DIGEST_LENGTH,
CC_SHA256_BLOCK_BYTES,
(hc_evp_md_cleanup)NULL
};
return &sha256;
+#else
+ return NULL;
+#endif
}
/**