]> git.cameronkatri.com Git - trustcache.git/blob - machoparse/cdhash.h
append: Allow specifying cdhash directly
[trustcache.git] / machoparse / cdhash.h
1 #ifndef BLANKET__AMFID__CDHASH_H_
2 #define BLANKET__AMFID__CDHASH_H_
3
4 #include <stdbool.h>
5 #include <stdlib.h>
6 #include "cs_blobs.h"
7
8 struct hashes {
9 uint32_t hash_type;
10 uint8_t cdhash[20];
11 };
12
13 struct cdhashes {
14 int count;
15 struct hashes *h;
16 };
17
18 /*
19 * compute_cdhash
20 *
21 * Description:
22 * Compute the cdhash of a Mach-O file.
23 *
24 * Parameters:
25 * file The contents of the Mach-O file.
26 * size The size of the Mach-O file.
27 * cdhash out On return, contains the cdhash of the file. Must be
28 * CS_CDHASH_LEN bytes.
29 */
30 //bool compute_cdhash(const void *file, size_t size, struct cdhash *cdhash);
31
32 int find_cdhash(const char *path, const struct stat *sb, struct cdhashes *h);
33
34 #endif