From fbd414fd2f1f4f2c12d575565eb5dc2bf855462b Mon Sep 17 00:00:00 2001 From: joe-conigliaro Date: Sat, 28 Sep 2019 21:02:57 +1000 Subject: [PATCH] crypto.md5: fix u64 modulus operation --- vlib/crypto/md5/md5.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/crypto/md5/md5.v b/vlib/crypto/md5/md5.v index 7b233d840f..2bd9bc87d2 100644 --- a/vlib/crypto/md5/md5.v +++ b/vlib/crypto/md5/md5.v @@ -106,7 +106,7 @@ pub fn (d mut Digest) checksum() []byte { // tmp := [1 + 63 + 8]byte{0x80} mut tmp := [byte(0)].repeat(1 + 63 + 8) tmp[0] = 0x80 - pad := (55 - int(d.len)) % 64 // calculate number of padding bytes + pad := int((55 - int(d.len)) % u64(64)) // calculate number of padding bytes binary.little_endian_put_u64(mut tmp.right(1+pad), d.len<