2 #ifndef _COMMON_CRYPTO_H_
3 #define _COMMON_CRYPTO_H_
5 #include <CommonCrypto/CommonDigestSPI.h>
9 extern const int kSHA256NullTerminatedBuffLen
;
11 #define MD5File(f, b) Digest_File(kCCDigestMD5, f, b)
12 #define SHA1_File(f, b) Digest_File(kCCDigestSHA1, f, b)
13 #define RIPEMD160_File(f, b) Digest_File(kCCDigestRMD160, f, b)
14 #define SHA256_File(f, b) Digest_File(kCCDigestSHA256, f, b)
18 uint64_t xdstream_priv_id
;
24 } __attribute__((aligned
, packed
));
26 typedef struct attrbuf attrbuf_t
;
28 char *Digest_File(CCDigestAlg algorithm
, const char *filename
, char *buf
);
30 xattr_info
*calculate_SHA256_XATTRs(char *path
, char *buf
);
31 xattr_info
*SHA256_Path_XATTRs(char *path
, char *buf
);
32 xattr_info
*get_xdstream_privateid(char *path
, char *buf
);
33 char *SHA256_Path_ACL(char *path
, char *buf
);
34 uint64_t get_sibling_id(const char *path
);
36 #endif /* _COMMON_CRYPTO_H_ */