File: sha2cc.h

package info (click to toggle)
ruby3.3 3.3.8-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 153,620 kB
  • sloc: ruby: 1,244,308; ansic: 836,474; yacc: 28,074; pascal: 6,748; sh: 3,913; python: 1,719; cpp: 1,158; makefile: 742; asm: 712; javascript: 394; lisp: 97; perl: 62; awk: 36; sed: 23; xml: 4
file content (31 lines) | stat: -rw-r--r-- 932 bytes parent folder | download | duplicates (5)
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
28
29
30
31
#define COMMON_DIGEST_FOR_OPENSSL 1
#include <CommonCrypto/CommonDigest.h>

#define SHA256_BLOCK_LENGTH	CC_SHA256_BLOCK_BYTES
#define SHA384_BLOCK_LENGTH	CC_SHA384_BLOCK_BYTES
#define SHA512_BLOCK_LENGTH	CC_SHA512_BLOCK_BYTES

#define SHA384_CTX		CC_SHA512_CTX

static DEFINE_UPDATE_FUNC_FOR_UINT(SHA256)
static DEFINE_FINISH_FUNC_FROM_FINAL(SHA256)
static DEFINE_UPDATE_FUNC_FOR_UINT(SHA384)
static DEFINE_FINISH_FUNC_FROM_FINAL(SHA384)
static DEFINE_UPDATE_FUNC_FOR_UINT(SHA512)
static DEFINE_FINISH_FUNC_FROM_FINAL(SHA512)


#undef SHA256_Update
#undef SHA256_Finish
#define SHA256_Update rb_digest_SHA256_update
#define SHA256_Finish rb_digest_SHA256_finish

#undef SHA384_Update
#undef SHA384_Finish
#define SHA384_Update rb_digest_SHA384_update
#define SHA384_Finish rb_digest_SHA384_finish

#undef SHA512_Update
#undef SHA512_Finish
#define SHA512_Update rb_digest_SHA512_update
#define SHA512_Finish rb_digest_SHA512_finish