Add crypt.[ch] and update md5sum and sha1sum
Factor out the code from md5sum and sha1sum into a util function. Use FILE * instead of a file descriptor. This will make it a bit easier/more consistent when we implement support for the -c option.
This commit is contained in:
10
crypt.h
Normal file
10
crypt.h
Normal file
@@ -0,0 +1,10 @@
|
||||
struct crypt_ops {
|
||||
void (*init)(void *);
|
||||
void (*update)(void *, const void *, unsigned long);
|
||||
void (*sum)(void *, uint8_t *);
|
||||
void *s;
|
||||
};
|
||||
|
||||
int cryptsum(struct crypt_ops *ops, FILE *fp, const char *f,
|
||||
uint8_t *md);
|
||||
void mdprint(const uint8_t *md, const char *f, size_t len);
|
Reference in New Issue
Block a user