diff options
author | siddharth <s@ricketyspace.net> | 2021-10-05 20:36:51 -0400 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2021-10-05 20:36:51 -0400 |
commit | 7516fe8a2adc5dc64acb8beb15b956d9605ca443 (patch) | |
tree | 394c0d42aa94374466f11b5003c45c86ec780071 /lib | |
parent | df94df85159928d7b8a094673a0a796f4f23e0ff (diff) |
lib: Sha1MacVerify
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sha1.go | 6 |
1 files changed, 6 insertions, 0 deletions
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 +} |