enable --gc:orc testing (#49)
This commit is contained in:
parent
a065c17418
commit
b602bd469b
|
@ -8,7 +8,7 @@
|
|||
#
|
||||
|
||||
## This is example of usage ``CFB[T]`` encryption/decryption.
|
||||
##
|
||||
##
|
||||
## In this sample we are using CFB[AES256], but you can use any block
|
||||
## cipher from nimcrypto library.
|
||||
import nimcrypto
|
||||
|
@ -117,7 +117,7 @@ block:
|
|||
var ectx, dctx: CFB[aes256]
|
||||
var key = newString(aes256.sizeKey)
|
||||
var iv = newString(aes256.sizeBlock)
|
||||
var plainText = aliceData
|
||||
var plainText = newString(len(aliceData))
|
||||
var encText = newString(len(aliceData))
|
||||
var decText = newString(len(aliceData))
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#
|
||||
|
||||
## This is example of usage ``CTR[T]`` encryption/decryption.
|
||||
##
|
||||
##
|
||||
## In this sample we are using CTR[AES256], but you can use any block
|
||||
## cipher from nimcrypto library.
|
||||
import nimcrypto
|
||||
|
@ -123,7 +123,10 @@ block:
|
|||
var key = newString(aes256.sizeKey)
|
||||
var iv = newString(aes256.sizeBlock)
|
||||
# We do not need to pad data, `CTR` mode works byte by byte.
|
||||
var plainText = aliceData
|
||||
var plainText = newString(len(aliceData))
|
||||
|
||||
copyMem(addr plainText[0], addr aliceData[0], len(aliceData))
|
||||
|
||||
var encText = newString(len(aliceData))
|
||||
var decText = newString(len(aliceData))
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#
|
||||
|
||||
## This is example of usage ``OFB[T]`` encryption/decryption.
|
||||
##
|
||||
##
|
||||
## In this sample we are using OFB[AES256], but you can use any block
|
||||
## cipher from nimcrypto library.
|
||||
import nimcrypto
|
||||
|
@ -117,7 +117,7 @@ block:
|
|||
var ectx, dctx: OFB[aes256]
|
||||
var key = newString(aes256.sizeKey)
|
||||
var iv = newString(aes256.sizeBlock)
|
||||
var plainText = aliceData
|
||||
var plainText = newString(len(aliceData))
|
||||
var encText = newString(len(aliceData))
|
||||
var decText = newString(len(aliceData))
|
||||
|
||||
|
|
|
@ -13,18 +13,25 @@ requires "nim > 0.18.0"
|
|||
# Tests
|
||||
|
||||
task test, "Runs the test suite":
|
||||
let testCommands = @[
|
||||
var testCommands = @[
|
||||
"nim c -f -r tests/",
|
||||
"nim c -f -d:danger -r tests/",
|
||||
"nim c -f -d:danger --threads:on -r tests/",
|
||||
]
|
||||
|
||||
when (NimMajor, NimMinor) >= (1, 5):
|
||||
testCommands.add "nim c -f --gc:orc --threads:on -r tests/"
|
||||
|
||||
let exampleFiles = @[
|
||||
"ecb", "cbc", "ofb", "cfb", "ctr", "gcm"
|
||||
]
|
||||
let exampleCommands = @[
|
||||
var exampleCommands = @[
|
||||
"nim c -f -r --threads:on examples/",
|
||||
]
|
||||
|
||||
when (NimMajor, NimMinor) >= (1, 5):
|
||||
exampleCommands.add "nim c -f --gc:orc --threads:on -r examples/"
|
||||
|
||||
for cmd in testCommands:
|
||||
echo "\n" & cmd & "testall"
|
||||
exec cmd & "testall"
|
||||
|
|
Loading…
Reference in New Issue