From 10fd98a804097002f9331e48fc6f84f3f3d8f3e2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 23 Aug 2019 19:32:15 -0700 Subject: New: MD5 digest functions. * Makefile (OBJS): New object file, chksums/md5.o. * chksum.c (sha256_ensure_buf): Renamed to chksum_ensure_buf and made generic so MD5 code can borrow it. (sha256_stream, sha256): Call chksum_ensure_buf instead of sha256_ensure_buf, passing in new length and hash name parameters. (md5_stream_impl, md5_buf, md5_str): New static functions. (md5_stream, md5): New functions. (chksum_init): Register md5-stream and md5 intrinsics. * chksum.h (md5_stream, md5): Declared. * chksums/md5.c, chksums/md5.h: New files. --- chksum.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'chksum.h') diff --git a/chksum.h b/chksum.h index 6eb68588..089d784e 100644 --- a/chksum.h +++ b/chksum.h @@ -29,4 +29,6 @@ val sha256_stream(val stream, val nbytes, val buf); val sha256(val obj, val buf); val crc32_stream(val stream, val nbytes); val crc32(val obj); +val md5_stream(val stream, val nbytes, val buf); +val md5(val obj, val buf_in); void chksum_init(void); -- cgit v1.2.3