Added environment config for test.sh

Fortune for chacha20's current commit: Blessing − 吉
master
Avril 1 year ago
parent 03b33e6472
commit 2e679167c7
Signed by: flanchan
GPG Key ID: 284488987C31F630

2
Cargo.lock generated

@ -34,7 +34,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chacha20"
version = "2.0.0"
version = "2.0.1"
dependencies = [
"base64",
"getrandom",

@ -1,7 +1,7 @@
[package]
name = "chacha20"
description = "chacha20_poly1305 encryption tool"
version = "2.0.0"
version = "2.0.1"
authors = ["Avril <flanchan@cumallover.me>"]
edition = "2021"
license = "gpl-3.0-or-later"

@ -8,6 +8,7 @@ mkdir -p test || exit -1
cd test || exit -1
PROG=../target/${1:-release}/chacha20
TEST_ENV="${TEST_ENV:-""}"
if [[ ! -f $PROG ]]; then
echo "Couldn't find executable \"$PROG\""
@ -27,9 +28,9 @@ KEYS=$($PROG k)
echo "$KEYS"
echo ">>> Encrypting"
time $PROG e $KEYS < test.txt > test.cc20 || exit 1
time $TEST_ENV $PROG e $KEYS < test.txt > test.cc20 || exit 1
echo ">>> Decrypting"
time $PROG d $KEYS < test.cc20 > test.out.txt || exit 2
time $TEST_ENV $PROG d $KEYS < test.cc20 > test.out.txt || exit 2
echo ">>> Comparing"
echo "Input (SHA256 sum): $(sha256sum test.txt)"

Loading…
Cancel
Save