2 * Copyright (c) 2007-2012, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
8 #ifndef LIBSOLV_CHKSUM_H
9 #define LIBSOLV_CHKSUM_H
18 typedef struct s_Chksum Chksum;
20 Chksum *solv_chksum_create(Id type);
21 Chksum *solv_chksum_create_clone(Chksum *chk);
22 Chksum *solv_chksum_create_from_bin(Id type, const unsigned char *buf);
23 void solv_chksum_add(Chksum *chk, const void *data, int len);
24 Id solv_chksum_get_type(Chksum *chk);
25 int solv_chksum_isfinished(Chksum *chk);
26 const unsigned char *solv_chksum_get(Chksum *chk, int *lenp);
27 void *solv_chksum_free(Chksum *chk, unsigned char *cp);
28 const char *solv_chksum_type2str(Id type);
29 Id solv_chksum_str2type(const char *str);
30 int solv_chksum_len(Id type);
31 int solv_chksum_cmp(Chksum *chk, Chksum *chk2);
33 #ifdef LIBSOLV_INTERNAL
35 #define case_CHKSUM_TYPES \
36 case REPOKEY_TYPE_MD5: \
37 case REPOKEY_TYPE_SHA1: \
38 case REPOKEY_TYPE_SHA224: \
39 case REPOKEY_TYPE_SHA256: \
40 case REPOKEY_TYPE_SHA384: \
41 case REPOKEY_TYPE_SHA512
49 #endif /* LIBSOLV_CHKSUM_H */