From 7516fe8a2adc5dc64acb8beb15b956d9605ca443 Mon Sep 17 00:00:00 2001 From: siddharth Date: Tue, 5 Oct 2021 20:36:51 -0400 Subject: lib: Sha1MacVerify --- lib/sha1.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/sha1.go b/lib/sha1.go index f90bc53..bfe87b1 100644 --- a/lib/sha1.go +++ b/lib/sha1.go @@ -212,3 +212,9 @@ func Sha1Mac(secret, msg []byte) []byte { return Sha1(append(secret, msg...)) } +func Sha1MacVerify(secret, msg, mac []byte) bool { + if BytesEqual(Sha1(append(secret, msg...)), mac) { + return true + } + return false +} -- cgit v1.2.3