Ruby: ext/digest/sha2/sha2cc.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

sha2cc.h
Go to the documentation of this file.
1#define COMMON_DIGEST_FOR_OPENSSL 1
2#include <CommonCrypto/CommonDigest.h>
3
4#define SHA256_BLOCK_LENGTH CC_SHA256_BLOCK_BYTES
5#define SHA384_BLOCK_LENGTH CC_SHA384_BLOCK_BYTES
6#define SHA512_BLOCK_LENGTH CC_SHA512_BLOCK_BYTES
7
8#define SHA384_CTX CC_SHA512_CTX
9
10static DEFINE_UPDATE_FUNC_FOR_UINT(SHA256)
11static DEFINE_FINISH_FUNC_FROM_FINAL(SHA256)
12static DEFINE_UPDATE_FUNC_FOR_UINT(SHA384)
13static DEFINE_FINISH_FUNC_FROM_FINAL(SHA384)
14static DEFINE_UPDATE_FUNC_FOR_UINT(SHA512)
15static DEFINE_FINISH_FUNC_FROM_FINAL(SHA512)
16
17
18#undef SHA256_Update
19#undef SHA256_Finish
20#define SHA256_Update rb_digest_SHA256_update
21#define SHA256_Finish rb_digest_SHA256_finish
22
23#undef SHA384_Update
24#undef SHA384_Finish
25#define SHA384_Update rb_digest_SHA384_update
26#define SHA384_Finish rb_digest_SHA384_finish
27
28#undef SHA512_Update
29#undef SHA512_Finish
30#define SHA512_Update rb_digest_SHA512_update
31#define SHA512_Finish rb_digest_SHA512_finish
DEFINE_FINISH_FUNC_FROM_FINAL
#define DEFINE_FINISH_FUNC_FROM_FINAL(name)
Definition: digest.h:46
DEFINE_UPDATE_FUNC_FOR_UINT
#define DEFINE_UPDATE_FUNC_FOR_UINT(name)
Definition: digest.h:34