Fix types.

This commit is contained in:
cheatfate 2018-03-20 13:16:45 +02:00
parent 80eb5a99b9
commit ab0adb28da
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ proc digest*[T](HashType: typedesc, data: openarray[T],
let eo = if ofinish == -1: uint(len(data)) else: uint(ofinish - so) let eo = if ofinish == -1: uint(len(data)) else: uint(ofinish - so)
ctx.init() ctx.init()
assert(uint(so) <= eo) assert(uint(so) <= eo)
assert(eo <= len(data)) assert(eo <= uint(len(data)))
if eo == 0: if eo == 0:
result = ctx.finish() result = ctx.finish()
else: else:

View File

@ -112,7 +112,7 @@ proc hmac*[A, B](HashType: typedesc, key: openarray[A],
let eo = if ofinish == -1: uint(len(data)) else: uint(ofinish - so) let eo = if ofinish == -1: uint(len(data)) else: uint(ofinish - so)
ctx.init(cast[ptr uint8](unsafeAddr key[0]), uint(sizeof(A) * len(key))) ctx.init(cast[ptr uint8](unsafeAddr key[0]), uint(sizeof(A) * len(key)))
assert(uint(so) <= eo) assert(uint(so) <= eo)
assert(eo <= len(data)) assert(eo <= uint(len(data)))
if eo == 0: if eo == 0:
result = ctx.finish() result = ctx.finish()
else: else: