proper fix for the HMAC.sizeDigest problem

This commit is contained in:
Zahary Karadjov 2018-03-30 12:10:20 +03:00
parent d6e1975554
commit 4e08730f2f
1 changed files with 3 additions and 3 deletions

View File

@ -46,9 +46,9 @@ template sizeBlock*(h: HMAC[KeccakContext]): uint =
else: else:
{.fatal: "Choosen hash primitive is not yet supported!".} {.fatal: "Choosen hash primitive is not yet supported!".}
template sizeDigest*(h: HMAC[Sha2Context]): uint = uint(h.bits) template sizeDigest*(h: HMAC[Sha2Context]): uint = uint(h.mdctx.bits)
template sizeDigest*(h: HMAC[RipemdContext]): uint = uint(h.bits) template sizeDigest*(h: HMAC[RipemdContext]): uint = uint(h.mdctx.bits)
template sizeDigest*(h: HMAC[KeccakContext]): uint = uint(h.bits) template sizeDigest*(h: HMAC[KeccakContext]): uint = uint(h.mdctx.bits)
proc init*[T](hmctx: var HMAC[T], key: ptr byte, ulen: uint) = proc init*[T](hmctx: var HMAC[T], key: ptr byte, ulen: uint) =
mixin init, update, finish mixin init, update, finish