Fix types.
This commit is contained in:
parent
80eb5a99b9
commit
ab0adb28da
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue