9 #define SHA1_HASH_SIZE 20
11 extern const u8 empty_file_sha1sum[SHA1_HASH_SIZE];
13 static inline bool is_empty_file_hash(const u8 hash[SHA1_HASH_SIZE])
15 return memcmp(hash, empty_file_sha1sum, SHA1_HASH_SIZE) == 0;
18 /* Compute SHA1 message digest for bytes read from STREAM. The
19 resulting message digest number will be written into the 20 bytes
20 beginning at RESBLOCK. */
21 extern int sha1_stream(FILE * stream, void *resblock);
24 #include <openssl/sha.h>
25 static inline void *sha1_buffer(const char *buffer, size_t len, void *resblock)
27 return SHA1(buffer, len, resblock);
30 /* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The
31 result is always in little endian byte order, so that a byte-wise
32 output yields to the wanted ASCII representation of the message
34 extern void *sha1_buffer(const char *buffer, size_t len, void *resblock);
38 #endif /* _WIMLIB_SHA1_H */