Add Blake2 tests to nimble task.
Add Blake2 test to API test.
This commit is contained in:
parent
d3478f20f3
commit
a5a007090d
|
@ -13,6 +13,7 @@ task tests, "Runs the test suite":
|
|||
exec "nim c -f -r tests/testkeccak"
|
||||
exec "nim c -f -r tests/testsha2"
|
||||
exec "nim c -f -r tests/testripemd"
|
||||
exec "nim c -f -r tests/testblake2"
|
||||
exec "nim c -f -r tests/testhmac"
|
||||
exec "nim c -f -r tests/testrijndael"
|
||||
exec "nim c -f -r tests/testtwofish"
|
||||
|
@ -24,6 +25,7 @@ task tests, "Runs the test suite":
|
|||
exec "nim c -f -d:release -r tests/testkeccak"
|
||||
exec "nim c -f -d:release -r tests/testsha2"
|
||||
exec "nim c -f -d:release -r tests/testripemd"
|
||||
exec "nim c -f -d:release -r tests/testblake2"
|
||||
exec "nim c -f -d:release -r tests/testhmac"
|
||||
exec "nim c -f -d:release -r tests/testrijndael"
|
||||
exec "nim c -f -d:release -r tests/testtwofish"
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import
|
||||
nimcrypto/[hash, keccak, sha2, ripemd],
|
||||
unittest
|
||||
import unittest
|
||||
import nimcrypto/[hash, keccak, sha2, ripemd, blake2]
|
||||
|
||||
suite "test API":
|
||||
suite "Test API":
|
||||
|
||||
proc hashProc(T: typedesc, input: string, output: var openArray[byte]) =
|
||||
var ctx: T
|
||||
|
@ -11,8 +10,9 @@ suite "test API":
|
|||
ctx.finish(output)
|
||||
ctx.clear()
|
||||
|
||||
test "finish API":
|
||||
test "Finish API":
|
||||
var y: array[32, byte]
|
||||
hashProc(keccak256, "hello", y)
|
||||
hashProc(sha256, "hello", y)
|
||||
hashProc(ripemd256, "hello", y)
|
||||
hashProc(blake2_256, "hello", y)
|
||||
|
|
Loading…
Reference in New Issue