summaryrefslogtreecommitdiff
path: root/ext/digest/md5/md5cc.h
blob: a002c17604da8b3de17f4da0f87c90cc17aeb4da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#define COMMON_DIGEST_FOR_OPENSSL 1
#include <CommonCrypto/CommonDigest.h>

#ifdef __GNUC__
RB_DIGEST_WARNING_IGNORED(-Wdeprecated-declarations)
/* Suppress deprecation warnings of MD5 from Xcode 11.1 */
/* Although we know MD5 is deprecated too, provide just for backward
 * compatibility, as well as Apple does. */
#endif

#define MD5_BLOCK_LENGTH	CC_MD5_BLOCK_BYTES

static DEFINE_UPDATE_FUNC_FOR_UINT(MD5)
static DEFINE_FINISH_FUNC_FROM_FINAL(MD5)

#undef MD5_Update
#undef MD5_Finish
#define MD5_Update rb_digest_MD5_update
#define MD5_Finish rb_digest_MD5_finish

/*
 * Pre-10.6 defines are with args, which don't match the argless use in
 * the function pointer inits.  Thus, we redefine MD5_Init as well.
 * This is a NOP on 10.6+.
 */
#undef MD5_Init
#define MD5_Init CC_MD5_Init