Console Output

Branch indexing
Querying the current revision of branch master...
Current revision of branch master is c38dbae2f12bd3a2b95fb890c6267f183ef3d82b
Obtained .ci/Jenkinsfile from c38dbae2f12bd3a2b95fb890c6267f183ef3d82b
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] properties
[Pipeline] node
Still waiting to schedule task
Waiting for next available executor
Running on Jenkins in /var/lib/jenkins/workspace/moparisthebest_pegh_master
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout)
[Pipeline] echo
My branch is: master
[Pipeline] checkout
The recommended git tool is: NONE
using credential c6ea0d71-5fe1-48ba-ad49-f6dd0c20363a
Cloning the remote Git repository
Cloning repository https://code.moparisthebest.com/moparisthebest/pegh.git
 > git init /var/lib/jenkins/workspace/moparisthebest_pegh_master # timeout=10
Fetching upstream changes from https://code.moparisthebest.com/moparisthebest/pegh.git
 > git --version # timeout=10
 > git --version # 'git version 2.31.1'
using GIT_ASKPASS to set credentials jenkins @ code.moparisthebest.com
 > git fetch --tags --force --progress -- https://code.moparisthebest.com/moparisthebest/pegh.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://code.moparisthebest.com/moparisthebest/pegh.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision c38dbae2f12bd3a2b95fb890c6267f183ef3d82b (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f c38dbae2f12bd3a2b95fb890c6267f183ef3d82b # timeout=10
Commit message: "Abandon travis-ci for jenkins"
First time build. Skipping changelog.
[Gitea] Notifying branch build status: PENDING Build started...
[Gitea] Notified
[Pipeline] sh
+ set -euxo pipefail
+ git checkout master --
Switched to a new branch 'master'
Branch 'master' set up to track remote branch 'master' from 'origin'.
+ git reset --hard origin/master
HEAD is now at c38dbae Abandon travis-ci for jenkins
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build + Deploy)
[Pipeline] sh
+ curl --compressed -sL https://code.moparisthebest.com/moparisthebest/self-ci/raw/branch/master/build-ci.sh
+ bash
build-ci.sh: BUILD_LANG=c RELEASE_SCRIPT=.ci/release.sh BUILD_SCRIPT=.ci/build.sh remaining args:
+ mkdir -p bin
+ cd bin
+ curl --compressed -sL -O https://code.moparisthebest.com/moparisthebest/self-ci/raw/branch/master/ci-release-helper.sh -O https://code.moparisthebest.com/moparisthebest/self-ci/raw/branch/master/c/build.sh
+ chmod +x ci-release-helper.sh build.sh
+ cd ..
++ pwd
+ export PATH=/var/lib/jenkins/workspace/moparisthebest_pegh_master/bin:/usr/local/sbin:/usr/local/bin:/usr/bin
+ PATH=/var/lib/jenkins/workspace/moparisthebest_pegh_master/bin:/usr/local/sbin:/usr/local/bin:/usr/bin
+ export BRANCH_NAME=master
+ BRANCH_NAME=master
+ export BUILD_UID=971
+ BUILD_UID=971
++ id -g
+ export BUILD_GID=971
+ BUILD_GID=971
+ build.sh .ci/build.sh
+ BUILD_SCRIPT=.ci/build.sh
+ shift
+ '[' '' == .ci/build.sh ']'
+ '[' .ci/build.sh == docker-chown ']'
+ docker_build amd64 alpine .ci/build.sh
+ export ARCH=amd64
+ ARCH=amd64
+ shift
+ DOCKER_IMAGE=alpine
+ shift
++ id -g
++ pwd
++ id -g
+ docker run --rm -e ARCH -e BRANCH_NAME -e BUILD_UID=971 -e BUILD_GID=971 -v /var/lib/jenkins/workspace/moparisthebest_pegh_master:/tmp -w /tmp alpine sh -c 'umask a=rwx; "$@"; exit=$?; chown -R '\''971:971'\'' /tmp; exit $exit' -- .ci/build.sh
Unable to find image 'alpine:latest' locally
latest: Pulling from library/alpine
540db60ca938: Pulling fs layer
540db60ca938: Verifying Checksum
540db60ca938: Download complete
540db60ca938: Pull complete
Digest: sha256:69e70a79f2d41ab5d637de98c1e0b055206ba40a8145e7bddb55ccc04e13cf8f
Status: Downloaded newer image for alpine:latest
+ apk add build-base clang bash libsodium-dev libsodium-static openssl-dev openssl-libs-static
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
(1/36) Installing ncurses-terminfo-base (6.2_p20210109-r0)
(2/36) Installing ncurses-libs (6.2_p20210109-r0)
(3/36) Installing readline (8.1.0-r0)
(4/36) Installing bash (5.1.0-r0)
Executing bash-5.1.0-r0.post-install
(5/36) Installing libgcc (10.2.1_pre1-r3)
(6/36) Installing libstdc++ (10.2.1_pre1-r3)
(7/36) Installing binutils (2.35.2-r1)
(8/36) Installing libmagic (5.39-r0)
(9/36) Installing file (5.39-r0)
(10/36) Installing libgomp (10.2.1_pre1-r3)
(11/36) Installing libatomic (10.2.1_pre1-r3)
(12/36) Installing libgphobos (10.2.1_pre1-r3)
(13/36) Installing gmp (6.2.1-r0)
(14/36) Installing isl22 (0.22-r0)
(15/36) Installing mpfr4 (4.1.0-r0)
(16/36) Installing mpc1 (1.2.0-r0)
(17/36) Installing gcc (10.2.1_pre1-r3)
(18/36) Installing musl-dev (1.2.2-r0)
(19/36) Installing libc-dev (0.7.2-r3)
(20/36) Installing g++ (10.2.1_pre1-r3)
(21/36) Installing make (4.3-r0)
(22/36) Installing fortify-headers (1.1-r0)
(23/36) Installing patch (2.7.6-r6)
(24/36) Installing build-base (0.5-r2)
(25/36) Installing libffi (3.3-r2)
(26/36) Installing xz-libs (5.2.5-r0)
(27/36) Installing libxml2 (2.9.10-r6)
(28/36) Installing llvm10-libs (10.0.1-r1)
(29/36) Installing clang-libs (10.0.1-r0)
(30/36) Installing clang (10.0.1-r0)
(31/36) Installing libsodium (1.0.18-r0)
(32/36) Installing pkgconf (1.7.3-r0)
(33/36) Installing libsodium-dev (1.0.18-r0)
(34/36) Installing libsodium-static (1.0.18-r0)
(35/36) Installing openssl-dev (1.1.1k-r0)
(36/36) Installing openssl-libs-static (1.1.1k-r0)
Executing busybox-1.32.1-r6.trigger
OK: 363 MiB in 50 packages
+ make clean all 'PEGH_LIBSODIUM=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM  -static  pegh.c  -lsodium -o pegh
+ mv pegh pegh.static.libsodium
+ make clean all 'PEGH_OPENSSL=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL  -static  pegh.c  -lcrypto -o pegh
+ mv pegh pegh.static.openssl
+ make clean all 'PEGH_LIBSODIUM=1' 'PEGH_OPENSSL=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL  -static  pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl -h
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

+ ls -lah pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
-rwxrwxrwx    1 root     root      613.6K May 22 04:59 pegh.static.libsodium
-rwxrwxrwx    1 root     root        9.2M May 22 05:00 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        8.9M May 22 05:00 pegh.static.openssl
+ strip pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
+ ls -lah pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
-rwxrwxrwx    1 root     root      266.5K May 22 05:00 pegh.static.libsodium
-rwxrwxrwx    1 root     root        2.1M May 22 05:00 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        1.9M May 22 05:00 pegh.static.openssl
+ file pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
pegh.static.libsodium:         ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
pegh.static.libsodium-openssl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
pegh.static.openssl:           ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
+ ldd pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
/lib/ld-musl-x86_64.so.1: pegh.static.libsodium: Not a valid dynamic program
+ true
+ export 'TEST_BINS=./pegh.static.openssl ./pegh.openssl ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl ./pegh.static.libsodium ./pegh.libsodium'
+ '[' amd64 '==' aarch64 ]
+ ./test.sh
+ '[' -e /tmp/randombytes100 ']'
+ dd if=/dev/urandom bs=1M count=100 of=/tmp/randombytes100
100+0 records in
100+0 records out
++ tr -dc a-z0-9
++ head -c12
+ export key=hf0kp2y42r28
+ key=hf0kp2y42r28
+ echo 'key: hf0kp2y42r28'
key: hf0kp2y42r28
+ '[' -e /tmp/leading_zero_key ']'
++ dd if=/dev/zero bs=1M count=1
+ cat /dev/fd/63 /dev/fd/62
++ echo hf0kp2y42r28
1+0 records in
1+0 records out
+ '[' -e /tmp/leading_zero_key_a ']'
+ ++ echo -n a
cat /tmp/leading_zero_key /dev/fd/63
+ '[' -e /tmp/leading_zero_key_b ']'
+ cat /tmp/leading_zero_key /dev/fd/63
++ echo -n b
+ rm -f pegh
+ make PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL    pegh.c  -lcrypto -o pegh
+ mv pegh pegh.openssl
+ make PEGH_LIBSODIUM=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM    pegh.c  -lsodium -o pegh
+ mv pegh pegh.libsodium
+ make PEGH_LIBSODIUM=1 PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL    pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.libsodium-openssl
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ '[' '' '!=' 1 ']'
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.static.openssl hf0kp2y42r28
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl hf0kp2y42r28
++ echo a
++ ./pegh.static.openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -d hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ + ./pegh.static.openssl -e hf0kp2y42r28
cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
bad decryption bytes are never output, file should be 0 bytes
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.openssl hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m9.962s
user	0m5.149s
sys	0m3.304s
+ test ./pegh.static.openssl ./pegh.static.openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl + ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
-d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - + ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
/dev/fd/63
++ echo -n a
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.222s
user	0m5.167s
sys	0m3.274s
+ test ./pegh.static.openssl ./pegh.static.openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.static.openssl -v 1 hf0kp2y42r28
./pegh.static.openssl -v 1 hf0kp2y42r28
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl + -e -v 1 cmp -f - /tmp/leading_zero_key/tmp/randombytes100

encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ + ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f encrypting/decrypting with key in file where last byte is different should fail
/tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
+ ./pegh.static.openssl -v 1 hf0kp2y42r28
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.322s
user	0m4.608s
sys	0m3.373s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.openssl
+ bin=./pegh.static.openssl
+ shift
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl hf0kp2y42r28
++ ./pegh.static.openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ large values of N without enough memory should fail
echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl hf0kp2y42r28+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt

+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m7.967s
user	0m5.206s
sys	0m3.318s
+ test ./pegh.static.openssl ./pegh.openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
echo a
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
encrypting same data with same key should result in different ciphertext

real	0m9.541s
user	0m4.696s
sys	0m3.358s
+ test ./pegh.static.openssl ./pegh.openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.openssl -v 1 hf0kp2y42r28
++ ./pegh.static.openssl -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a+ cmp - /tmp/randombytes100

decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
cat - /dev/fd/63
+ ./pegh.static.openssl -v 1 hf0kp2y42r28
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.607s
user	0m4.510s
sys	0m3.305s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl hf0kp2y42r28
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl hf0kp2y42r28
++ echo a
++ ./pegh.static.openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl hf0kp2y42r28
+ cat - + /dev/fd/63
./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.454s
user	0m4.153s
sys	0m3.213s
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
+ echo a
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
+ + ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.964s
user	0m4.096s
sys	0m3.220s
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 hf0kp2y42r28
++ ./pegh.static.openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ + ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
./pegh.static.openssl ++ echo -n a
-v 1 hf0kp2y42r28
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.233s
user	0m4.131s
sys	0m3.029s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.libsodium-openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl hf0kp2y42r28
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo echo aa

++ ./pegh.static.openssl hf0kp2y42r28
++ ./pegh.static.openssl hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey+ ./pegh.static.openssl -e hf0kp2y42r28 -i /tmp/randombytes100

+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e + ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
-f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl hf0kp2y42r28
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.592s
user	0m4.118s
sys	0m3.020s
+ test ./pegh.static.openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
++ echo a
++ echo a
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.static.openssl -e -v 0 ./pegh.libsodium-openssl -d -f -f /tmp/leading_zero_key_a/tmp/leading_zero_key_b

+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.325s
user	0m4.180s
sys	0m3.090s
+ test ./pegh.static.openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp ++ echo a
/dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl -v 1 hf0kp2y42r28
++ ./pegh.static.openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 1 hf0kp2y42r28
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.025s
user	0m4.007s
sys	0m3.188s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.libsodium
+ bin=./pegh.static.openssl
+ shift
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl hf0kp2y42r28
+ ./pegh.static.libsodium -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl hf0kp2y42r28
++ ./pegh.static.openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl hf0kp2y42r28
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.544s
user	0m4.248s
sys	0m3.309s
+ test ./pegh.static.openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m9.390s
user	0m3.953s
sys	0m3.306s
+ test ./pegh.static.openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.static.openssl -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.static.openssl -v 1 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
-s bla.txt ']'
+ set -e

real	0m8.818s
user	0m4.051s
sys	0m3.232s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.libsodium
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.openssl hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.static.openssl hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl hf0kp2y42r28
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.191s
user	0m4.195s
sys	0m3.065s
+ test ./pegh.static.openssl ./pegh.libsodium -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
+ echo a
+ ./pegh.libsodium -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.static.openssl -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ + echo 'hopefully this doesnt make it to disk'
cat - /dev/fd/63
+ ./pegh.static.openssl -v 0 hf0kp2y42r28
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.457s
user	0m4.038s
sys	0m3.137s
+ test ./pegh.static.openssl ./pegh.libsodium -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.static.openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.static.openssl cmp -e -v - 1 /tmp/randombytes100-f 
/tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -v 1 hf0kp2y42r28
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.769s
user	0m4.138s
sys	0m2.991s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ ./pegh.openssl hf0kp2y42r28
+ + echo ./pegh.static.openssl a-d 
hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl hf0kp2y42r28
++ echo a
++ ./pegh.openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.openssl -e hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
140146352388936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl + ./pegh.openssl hf0kp2y42r28
-d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.165s
user	0m4.477s
sys	0m3.177s
+ test ./pegh.openssl ./pegh.static.openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -v 0 hf0kp2y42r28
+ echo a
+ ./pegh.static.openssl -d hf0kp2y42r28
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.openssl echo -v a0 
hf0kp2y42r28
++ ./pegh.openssl -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.openssl -e -v 0 hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
140038681590600:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 0 + ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
hf0kp2y42r28
+ + cat - /dev/fd/63
echo 'hopefully this doesnt make it to disk'++ echo -n a

decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.988s
user	0m4.485s
sys	0m3.162s
+ test ./pegh.openssl ./pegh.static.openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v ++ ./pegh.openssl -v 1 hf0kp2y42r28
1 hf0kp2y42r28
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 1 hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
140530262059848:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
large values of N without enough memory should fail
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 1 hf0kp2y42r28
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.424s
user	0m4.514s
sys	0m3.186s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.openssl hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ ++ echo a
cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl hf0kp2y42r28
++ echo a
++ ./pegh.openssl hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
139916561587016:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.openssl hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
+ echo ++ echo -n a
'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.091s
user	0m4.749s
sys	0m3.166s
+ test ./pegh.openssl ./pegh.openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -v 0 hf0kp2y42r28
+ echo a
+ ./pegh.openssl -d hf0kp2y42r28
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.openssl -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
140100482394952:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 0 hf0kp2y42r28
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.286s
user	0m4.484s
sys	0m3.425s
+ test ./pegh.openssl ./pegh.openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ ./pegh.openssl -v 1 hf0kp2y42r28
./pegh.openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 1 hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
139866518801224:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 1 hf0kp2y42r28
+ cat - /dev/fd/63
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
++ echo -n a
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.780s
user	0m4.310s
sys	0m3.446s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.openssl hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl hf0kp2y42r28
++ echo a
++ ./pegh.openssl hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
large values of N without enough memory should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
140097889413960:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
bad decryption bytes are never output, file should be 0 bytes
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.766s
user	0m4.076s
sys	0m3.363s
+ test ./pegh.openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.openssl -v 0 hf0kp2y42r28
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl -v 0 hf0kp2y42r28
++ ./pegh.openssl -v 0 hf0kp2y42r28
++ echo a
encrypting same data with same key should result in different ciphertext
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
139901991304008:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 0 hf0kp2y42r28
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -d + hf0kp2y42r28 -o cat bla.txt- 
/dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m8.332s
user	0m4.149s
sys	0m3.122s
+ test ./pegh.openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo ++ echo a
a
++ ./pegh.openssl -v 1 hf0kp2y42r28
++ ./pegh.openssl -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ + ./pegh.static.libsodium-openssl -d -f cmp /tmp/leading_zero_key- 
/tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
140238410197832:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.openssl -v 1 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m8.122s
user	0m4.024s
sys	0m3.155s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.libsodium-openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ echo a
+ ./pegh.openssl hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 ++ echo a
/dev/fd/62++ ./pegh.openssl hf0kp2y42r28

++ ./pegh.openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
140079856466760:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl hf0kp2y42r28
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.782s
user	0m4.236s
sys	0m3.086s
+ test ./pegh.openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.openssl -v 0 hf0kp2y42r28
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.openssl -v 0 hf0kp2y42r28
++ ./pegh.openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ ./pegh.openssl -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
139902480055112:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.openssl -v 0 hf0kp2y42r28
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.065s
user	0m4.361s
sys	0m3.066s
+ test ./pegh.openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl -v 1 hf0kp2y42r28
++ ./pegh.openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 1 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100
./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
139688477240136:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 1 hf0kp2y42r28
+ + cat - /dev/fd/63
./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
set -e

real	0m8.470s
user	0m3.853s
sys	0m3.355s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.libsodium
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.openssl hf0kp2y42r28
+ echo a
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
++ echo a
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ./pegh.openssl hf0kp2y42r28
++ echo a
++ ./pegh.openssl hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ ./pegh.openssl -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
140694520417096:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
+ ++ echo -n a
cat - /dev/fd/63
+ ./pegh.openssl hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.227s
user	0m4.069s
sys	0m3.288s
+ test ./pegh.openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -v 0 hf0kp2y42r28
+ echo a
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl -v 0 hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
139625342065480:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.openssl -v 0 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ + ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.392s
user	0m3.797s
sys	0m3.561s
+ test ./pegh.openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 ++ echo a
/dev/fd/62
++ ./pegh.openssl -v 1 hf0kp2y42r28
++ ./pegh.openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.static.libsodium -d -f /tmp/leading_zero_keycmp 
- /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
140691148999496:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 1 hf0kp2y42r28
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.001s
user	0m3.887s
sys	0m3.181s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.libsodium
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
+ ./pegh.libsodium -d hf0kp2y42r28
+ ./pegh.openssl hf0kp2y42r28
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl hf0kp2y42r28
++ ./pegh.openssl hf0kp2y42r28
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -d hf0kp2y42r28
+ ./pegh.openssl -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ + cmp - /tmp/randombytes100
./pegh.openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
139805134617416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl hf0kp2y42r28
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.889s
user	0m4.279s
sys	0m3.272s
+ test ./pegh.openssl ./pegh.libsodium -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -d hf0kp2y42r28
+ ./pegh.openssl -v 0 hf0kp2y42r28
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.openssl -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 0 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ + cmp ./pegh.openssl - -e /tmp/randombytes100-v 
0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
139663059016520:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ cat - /dev/fd/63
+ ./pegh.openssl -v 0 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.065s
user	0m4.089s
sys	0m3.278s
+ test ./pegh.openssl ./pegh.libsodium -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp ./pegh.openssl - -e /tmp/randombytes100-v 
1 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
140359469509448:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
cat - /dev/fd/63
+ ./pegh.openssl -v 1 hf0kp2y42r28
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.735s
user	0m4.007s
sys	0m3.122s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'encrypting/decrypting with key in file where last byte is different should fail

+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
++ echo -n a
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.808s
user	0m3.842s
sys	0m3.222s
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
+ + cat - /dev/fd/63
./pegh.static.libsodium-openssl ++ echo -n a
-v 0 hf0kp2y42r28
decryption failed
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m8.495s
user	0m3.798s
sys	0m3.274s
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'large values of N without enough memory should fail

+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.806s
user	0m3.982s
sys	0m3.122s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + echo cat - /dev/fd/63
'hopefully this doesnt make it to disk'
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.303s
user	0m3.877s
sys	0m3.365s
+ test ./pegh.static.libsodium-openssl ./pegh.openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -d hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.178s
user	0m3.925s
sys	0m3.311s
+ test ./pegh.static.libsodium-openssl ./pegh.openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
+ + ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.634s
user	0m3.948s
sys	0m3.351s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.932s
user	0m3.529s
sys	0m3.097s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.379s
user	0m3.292s
sys	0m3.274s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m7.375s
user	0m3.563s
sys	0m3.112s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium-openssl hf0kp2y42r28+ echo 'hopefully this doesnt make it to disk'

+ + ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
++ echo -n a
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.588s
user	0m3.575s
sys	0m3.013s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28
+ + cmp - ./pegh.libsodium-openssl /tmp/randombytes100
-d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
decryption failed
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m7.751s
user	0m3.409s
sys	0m3.134s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + ./pegh.static.libsodium-openssl -e -v 1 cmp - hf0kp2y42r28 /tmp/randombytes100-i 
/tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
+ ++ echo echo -n a
'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.513s
user	0m3.626s
sys	0m3.054s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
+ echo a
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d + cmp - /tmp/randombytes100
-f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
+ cat - /dev/fd/63
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m7.416s
user	0m3.327s
sys	0m3.217s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ echo a
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.707s
user	0m3.555s
sys	0m3.061s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 1
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
++ ./pegh.static.libsodium-openssl ++ echo a
-v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - + /tmp/randombytes100
./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.368s
user	0m3.700s
sys	0m3.016s
+ for bin_decrypt in testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
$TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -d hf0kp2y42r28
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ ++ echo a
cmp ++ ./pegh.static.libsodium-openssl hf0kp2y42r28
/dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.170s
user	0m3.473s
sys	0m2.967s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
encrypting same data with same key should result in different ciphertext
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.246s
user	0m3.385s
sys	0m3.112s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo echo a
a
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
++ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -v 1 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.862s
user	0m3.587s
sys	0m3.035s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.openssl -d hf0kp2y42r28
+ echo a
+ ./pegh.libsodium-openssl hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo encrypting same data with same key should result in different ciphertext
'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl hf0kp2y42r28
++ ./pegh.libsodium-openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl hf0kp2y42r28
++ + echo -n a
echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.928s
user	0m3.797s
sys	0m3.418s
+ test ./pegh.libsodium-openssl ./pegh.static.openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ echo a
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
encrypting same data with same key should result in different ciphertext

real	0m8.920s
user	0m4.059s
sys	0m2.991s
+ test ./pegh.libsodium-openssl ./pegh.static.openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
++ echo -n a
+ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.022s
user	0m4.181s
sys	0m2.927s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.openssl -d hf0kp2y42r28
+ ./pegh.libsodium-openssl hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl hf0kp2y42r28
++ echo a
++ ./pegh.libsodium-openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'encrypting/decrypting with key in file where last byte is different should fail

+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.853s
user	0m3.932s
sys	0m3.130s
+ test ./pegh.libsodium-openssl ./pegh.openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.478s
user	0m4.019s
sys	0m2.967s
+ test ./pegh.libsodium-openssl ./pegh.openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.232s
user	0m3.947s
sys	0m3.307s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl hf0kp2y42r28
+ + echo a
./pegh.static.libsodium-openssl -d hf0kp2y42r28
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl hf0kp2y42r28
++ ./pegh.libsodium-openssl hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ ./pegh.libsodium-openssl -e hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.840s
user	0m3.320s
sys	0m3.144s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
+ echo a
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.516s
user	0m3.493s
sys	0m3.184s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - ++ echo -n a
/dev/fd/63
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m8.442s
user	0m3.728s
sys	0m3.226s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl hf0kp2y42r28
++ ./pegh.libsodium-openssl hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl + cmp - /tmp/randombytes100
-d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl hf0kp2y42r28
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.509s
user	0m3.440s
sys	0m3.325s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
+ echo a
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ + ./pegh.libsodium-openssl -d ./pegh.libsodium-openssl -f -e /tmp/leading_zero_key-v 
+ cmp - /tmp/randombytes100
0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
bad decryption bytes are never output, file should be 0 bytes
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.348s
user	0m3.506s
sys	0m3.068s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ ./pegh.libsodium-openssl -v 1 ++ echo a
hf0kp2y42r28
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + ./pegh.libsodium-openssl -e -v cmp 1 - hf0kp2y42r28 /tmp/randombytes100-i 
/tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ + ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ + ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.615s
user	0m3.623s
sys	0m3.239s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl hf0kp2y42r28
+ + ./pegh.static.libsodium -d hf0kp2y42r28
echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl hf0kp2y42r28
++ echo a++ ./pegh.libsodium-openssl hf0kp2y42r28

/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e hf0kp2y42r28
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - + ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
/dev/fd/63
+ ./pegh.libsodium-openssl hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m6.784s
user	0m3.609s
sys	0m2.966s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
+ echo a
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.206s
user	0m3.595s
sys	0m3.000s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ + ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
./pegh.libsodium-openssl + -v 1 echo hf0kp2y42r28'hopefully this doesnt make it to disk'

+ cat - /dev/fd/63
++ echo -n a
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.333s
user	0m3.633s
sys	0m3.011s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.libsodium
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl hf0kp2y42r28
+ echo a
+ ./pegh.libsodium -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl hf0kp2y42r28
++ echo ++ echo a
++ ./pegh.libsodium-openssl hf0kp2y42r28
a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl + cmp - /tmp/randombytes100
-e hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d + cmp - /tmp/randombytes100
-f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl hf0kp2y42r28
+ cat - /dev/fd/63
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
++ echo -n a
bad decryption bytes are never output, file should be 0 bytes
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.074s
user	0m3.637s
sys	0m3.026s
+ test ./pegh.libsodium-openssl ./pegh.libsodium -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ ./pegh.libsodium-openssl + + ./pegh.libsodium -d hf0kp2y42r28echo 
a
-v 0 hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
++ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 0 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m6.159s
user	0m4.172s
sys	0m2.956s
+ test ./pegh.libsodium-openssl ./pegh.libsodium -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
++ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ ./pegh.libsodium-openssl -v 1 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.214s
user	0m3.779s
sys	0m3.212s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.static.libsodium hf0kp2y42r28
++ ./pegh.static.libsodium hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e hf0kp2y42r28
+ + cmp ./pegh.static.openssl - -d /tmp/randombytes100
hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.005s
user	0m4.187s
sys	0m3.018s
+ test ./pegh.static.libsodium ./pegh.static.openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -v 0 hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
++ echo a
encrypting same data with same key should result in different ciphertext
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
+ + ./pegh.static.openssl cmp - /tmp/randombytes100
-d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + echo ./pegh.static.libsodium + ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
'hopefully this doesnt make it to disk'-v 
0 hf0kp2y42r28
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.016s
user	0m3.996s
sys	0m3.139s
+ test ./pegh.static.libsodium ./pegh.static.openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
encrypting same data with same key should result in different ciphertext
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ + ./pegh.static.libsodium cmp -e - -v /tmp/randombytes1001 
-f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium -v 1 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.126s
user	0m4.108s
sys	0m3.136s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl

+ ./pegh.static.libsodium hf0kp2y42r28
+ echo a
+ ./pegh.openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium hf0kp2y42r28
++ echo a
++ echo a
++ ./pegh.static.libsodium hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -d hf0kp2y42r28
+ ./pegh.static.libsodium -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + ./pegh.static.libsodium cmp -e - hf0kp2y42r28 /tmp/randombytes100-i 
/tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium hf0kp2y42r28
+ cat - /dev/fd/63
+ + ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m9.424s
user	0m3.849s
sys	0m3.329s
+ test ./pegh.static.libsodium ./pegh.openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -d hf0kp2y42r28
+ echo a
+ ./pegh.static.libsodium -v 0 hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -d hf0kp2y42r28
+ + cmp ./pegh.static.libsodium - -e /tmp/randombytes100-v 
0 hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.static.libsodium -e -v 0 -f cmp /tmp/leading_zero_key- 
/tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -v 0 hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.441s
user	0m4.262s
sys	0m3.069s
+ test ./pegh.static.libsodium ./pegh.openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -v 1 hf0kp2y42r28
+ ./pegh.openssl + -d hf0kp2y42r28 cat -o - bla.txt
/dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.020s
user	0m3.706s
sys	0m3.508s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium hf0kp2y42r28
++ ./pegh.static.libsodium hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ ./pegh.static.libsodium -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp ./pegh.static.libsodium - -e /tmp/randombytes100hf0kp2y42r28 
-i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium hf0kp2y42r28
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.435s
user	0m3.333s
sys	0m3.309s
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ echo a
+ ./pegh.static.libsodium -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ + ./pegh.static.libsodium-openssl -d ./pegh.static.libsodium -f -e /tmp/leading_zero_key_b-v 
0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 0 hf0kp2y42r28
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.672s
user	0m3.446s
sys	0m3.199s
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
++ echo a
++ echo a
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ ./pegh.static.libsodium -v 1 hf0kp2y42r28
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.611s
user	0m3.609s
sys	0m3.344s
+ for bin_decrypt in $TEST_BINS
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium hf0kp2y42r28
+ echo a
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium hf0kp2y42r28
++ echo a
++ echo a
++ ./pegh.static.libsodium hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium -e hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.284s
user	0m3.252s
sys	0m3.369s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ ./pegh.static.libsodium -v 0 hf0kp2y42r28
+ echo a
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium -v 0 hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.319s
user	0m3.474s
sys	0m3.162s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
++ echo a
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -v 1 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.495s
user	0m3.780s
sys	0m3.107s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.libsodium
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ ./pegh.static.libsodium hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium hf0kp2y42r28
++ ./pegh.static.libsodium hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e hf0kp2y42r28
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp ./pegh.static.libsodium - -e /tmp/randombytes100hf0kp2y42r28 
-i /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium + ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
hf0kp2y42r28
+ cat ++ echo -n a
- /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.237s
user	0m3.445s
sys	0m3.157s
+ test ./pegh.static.libsodium ./pegh.static.libsodium -v 0
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ + ./pegh.static.libsodium -d ./pegh.static.libsodium -v hf0kp2y42r280 
hf0kp2y42r28
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp ./pegh.static.libsodium - -e /tmp/randombytes100-v 
0 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -v 0 hf0kp2y42r28+ cat - /dev/fd/63

+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.832s
user	0m3.372s
sys	0m3.238s
+ test ./pegh.static.libsodium ./pegh.static.libsodium -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ + ./pegh.static.libsodium -d ./pegh.static.libsodium hf0kp2y42r28
-e -v 1 hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
./pegh.static.libsodium + -e cmp - /tmp/randombytes100
-v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -v 1 + cat - /dev/fd/63
hf0kp2y42r28
++ echo -n a
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.525s
user	0m3.746s
sys	0m3.060s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ echo a
+ ./pegh.static.libsodium hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo ++ a./pegh.static.libsodium hf0kp2y42r28

++ ./pegh.static.libsodium hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e hf0kp2y42r28
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.876s
user	0m3.353s
sys	0m3.361s
+ test ./pegh.static.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ ./pegh.libsodium -d hf0kp2y42r28
+ ./pegh.static.libsodium -v 0 hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 0 hf0kp2y42r28
+ cat - /dev/fd/63
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
++ echo -n a
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.297s
user	0m3.452s
sys	0m3.164s
+ test ./pegh.static.libsodium ./pegh.libsodium -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.static.libsodium -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ + ./pegh.libsodium -d hf0kp2y42r28-wrongkey
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ ./pegh.static.libsodium -v 1 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m7.624s
user	0m3.631s
sys	0m3.243s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium hf0kp2y42r28
+ echo a
+ ./pegh.static.openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium hf0kp2y42r28++ ./pegh.libsodium hf0kp2y42r28

++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d hf0kp2y42r28
+ ./pegh.libsodium -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium -e hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
+ + ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium hf0kp2y42r28
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m7.843s
user	0m3.983s
sys	0m3.016s
+ test ./pegh.libsodium ./pegh.static.openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.openssl -d hf0kp2y42r28
+ echo a
+ ./pegh.libsodium -v 0 hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.libsodium -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt
+ + ++ echo -n a
+ ./pegh.libsodium -v 0 hf0kp2y42r28echo 
'hopefully this doesnt make it to disk'
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.842s
user	0m3.827s
sys	0m3.182s
+ test ./pegh.libsodium ./pegh.static.openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium -v 1 hf0kp2y42r28
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
encrypting same data with same key should result in different ciphertext
++ ./pegh.libsodium -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28
+ ./pegh.static.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ large values of N without enough memory should fail
./pegh.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63+ ./pegh.static.openssl -d hf0kp2y42r28 -o bla.txt

++ echo -n a
+ ./pegh.libsodium -v 1 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.271s
user	0m4.075s
sys	0m3.016s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ ./pegh.openssl -d hf0kp2y42r28
+ ./pegh.libsodium hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium hf0kp2y42r28
++ echo a
++ ./pegh.libsodium hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ + ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
./pegh.libsodium hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.433s
user	0m3.906s
sys	0m3.150s
+ test ./pegh.libsodium ./pegh.openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -v 0 hf0kp2y42r28
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ ./pegh.openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 0 hf0kp2y42r28
++ echo a
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.libsodium -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d hf0kp2y42r28
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'encrypting with one key and decrypting with another should fail

+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ + cmp - /tmp/randombytes100
./pegh.openssl -d hf0kp2y42r28-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 0 hf0kp2y42r28
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
+ ++ echo -n a
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.898s
user	0m3.946s
sys	0m3.067s
+ test ./pegh.libsodium ./pegh.openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
encrypting same data with same key should result in different ciphertext
++ ./pegh.libsodium -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.libsodium -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28
+ ./pegh.openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d hf0kp2y42r28-wrongkey
+ + cmp - /tmp/randombytes100./pegh.libsodium 
-e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 1 hf0kp2y42r28
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m8.746s
user	0m3.846s
sys	0m3.191s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
++ ./pegh.libsodium hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
bad decryption bytes are never output, file should be 0 bytes
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium hf0kp2y42r28
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.665s
user	0m3.238s
sys	0m3.360s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.libsodium -v 0 hf0kp2y42r28
++ ./pegh.libsodium -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d + cmp - /tmp/randombytes100
hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.816s
user	0m3.388s
sys	0m3.132s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 1 hf0kp2y42r28
++ ./pegh.libsodium -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 1 hf0kp2y42r28
+ ./pegh.static.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.295s
user	0m3.671s
sys	0m3.125s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ + echo a
./pegh.libsodium-openssl -d hf0kp2y42r28
+ ./pegh.libsodium hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium hf0kp2y42r28
++ echo a
++ echo a
++ ./pegh.libsodium hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium hf0kp2y42r28+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt

+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.041s
user	0m3.601s
sys	0m3.204s
+ test ./pegh.libsodium ./pegh.libsodium-openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium -v 0 hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
++ echo + a
cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 0 hf0kp2y42r28
++ ./pegh.libsodium -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 0 hf0kp2y42r28
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.128s
user	0m3.402s
sys	0m3.177s
+ test ./pegh.libsodium ./pegh.libsodium-openssl -v 1
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a++ ./pegh.libsodium -v 1 hf0kp2y42r28

./pegh.libsodium -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ + ./pegh.libsodium -e -v 1 hf0kp2y42r28
./pegh.libsodium-openssl -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.libsodium -v 1 hf0kp2y42r28
++ echo -n a
bad decryption bytes are never output, file should be 0 bytes
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.451s
user	0m3.646s
sys	0m3.156s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium
+ bin=./pegh.libsodium
+ shift
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium hf0kp2y42r28
+ + ./pegh.static.libsodium echo -d ahf0kp2y42r28

+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
./pegh.libsodium hf0kp2y42r28
++ ./pegh.libsodium hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -d hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e hf0kp2y42r28
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.410s
user	0m3.340s
sys	0m3.446s
+ test ./pegh.libsodium ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ echo a
+ ./pegh.libsodium -v 0 hf0kp2y42r28
+ ./pegh.static.libsodium -d hf0kp2y42r28
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium -v 0 hf0kp2y42r28
++ ./pegh.libsodium -v 0 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d hf0kp2y42r28 -o + cat - /dev/fd/63
++ echo -n a
bla.txt
+ ./pegh.libsodium -v 0 hf0kp2y42r28
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.825s
user	0m3.401s
sys	0m3.047s
+ test ./pegh.libsodium ./pegh.static.libsodium -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
encrypting same data with same key should result in different ciphertext

+ cmp /dev/fd/63 ++ /dev/fd/62
++ echo a
./pegh.libsodium -v 1 hf0kp2y42r28
++ ./pegh.libsodium -v 1 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28
+ + cmp - ./pegh.static.libsodium -d /tmp/randombytes100
hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ + cmp - /tmp/randombytes100
./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + cat - /dev/fd/63
+ echo ./pegh.static.libsodium ++ echo -n a
-d 'hopefully this doesnt make it to disk'hf0kp2y42r28 -o 
bla.txt
+ ./pegh.libsodium -v 1 hf0kp2y42r28
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.264s
user	0m3.581s
sys	0m3.135s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.libsodium
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ ./pegh.libsodium -d hf0kp2y42r28
+ ./pegh.libsodium hf0kp2y42r28
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium hf0kp2y42r28
++ echo a
++ ./pegh.libsodium hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28
+ ./pegh.libsodium -e hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium -e hf0kp2y42r28 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.066s
user	0m3.358s
sys	0m3.197s
+ test ./pegh.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
1 ']'
+ ./pegh.libsodium -v 0 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ./pegh.libsodium -v 0 hf0kp2y42r28
++ echo a
++ ./pegh.libsodium -v 0 hf0kp2y42r28
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28
+ ./pegh.libsodium -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 0 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ ./pegh.libsodium -v 0 hf0kp2y42r28
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium

real	0m8.608s
user	0m3.770s
sys	0m3.093s
+ test ./pegh.libsodium ./pegh.libsodium -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 1 hf0kp2y42r28
++ echo a
++ ./pegh.libsodium -v 1 hf0kp2y42r28
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28 -i /tmp/randombytes100
+ ./pegh.libsodium -d hf0kp2y42r28-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d hf0kp2y42r28 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ + ./pegh.libsodium -v 1 hf0kp2y42r28
./pegh.libsodium -d hf0kp2y42r28 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
successful test run!
successfully built and tested static pegh against libsodium and openssl!
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.557s
user	0m3.988s
sys	0m3.136s
+ echo 'successful test run!'
+ echo 'successfully built and tested static pegh against libsodium and openssl!'
+ mkdir -p release
+ mv pegh.static.libsodium ./release/pegh-linux-amd64-libsodium
+ '[' amd64 '==' aarch64 ]
+ mv pegh.static.openssl ./release/pegh-linux-amd64-openssl
+ mv pegh.static.libsodium-openssl ./release/pegh-linux-amd64-libsodium-openssl
+ '[' amd64 '==' amd64 ]
+ apk add git
(1/7) Installing ca-certificates (20191127-r5)
(2/7) Installing brotli-libs (1.0.9-r3)
(3/7) Installing nghttp2-libs (1.42.0-r1)
(4/7) Installing libcurl (7.76.1-r0)
(5/7) Installing expat (2.2.10-r1)
(6/7) Installing pcre2 (10.36-r0)
(7/7) Installing git (2.30.2-r0)
Executing busybox-1.32.1-r6.trigger
Executing ca-certificates-20191127-r5.trigger
OK: 376 MiB in 57 packages
+ git archive HEAD -9 --format zip -o ./release/pegh-source.zip
+ git archive HEAD -9 --format tar.gz -o ./release/pegh-source.tar.gz
going to try to build windows here...
+ '[' amd64 '==' amd64 ]
+ echo 'going to try to build windows here...'
+ apk add mingw-w64-gcc curl wine
(1/21) Installing curl (7.76.1-r0)
(2/21) Installing mingw-w64-binutils (2.35.1-r0)
(3/21) Installing mingw-w64-winpthreads (8.0.0-r0)
(4/21) Installing mingw-w64-headers (8.0.0-r0)
(5/21) Installing mingw-w64-crt (8.0.0-r0)
(6/21) Installing mingw-w64-gcc (10.2.0-r1)
(7/21) Installing libxau (1.0.9-r0)
(8/21) Installing libbsd (0.10.0-r0)
(9/21) Installing libxdmcp (1.1.3-r0)
(10/21) Installing libxcb (1.14-r1)
(11/21) Installing libx11 (1.7.1-r0)
(12/21) Installing libxext (1.3.4-r0)
(13/21) Installing alsa-lib (1.2.4-r2)
(14/21) Installing gdbm (1.19-r0)
(15/21) Installing libsasl (2.1.27-r10)
(16/21) Installing libldap (2.4.57-r1)
(17/21) Installing eudev-libs (3.2.9-r3)
(18/21) Installing spirv-tools (2020.3-r0)
(19/21) Installing vkd3d (1.2-r0)
(20/21) Installing wine-libs (4.0.3-r0)
(21/21) Installing wine (4.0.3-r0)
Executing busybox-1.32.1-r6.trigger
OK: 938 MiB in 78 packages
+ pwd
+ STATIC_LIB_DIR=/tmp
+ LIBSODIUM_VERSION=1.0.18
+ OPENSSL_VERSION=1.1.1h_3
+ OPENSSL_CURL_VERSION=7.73.0_3
+ '[' '!' -d /tmp/libsodium-win32 ]
+ curl -L -O https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-mingw.tar.gz -O https://curl.se/windows/dl-7.73.0_3/openssl-1.1.1h_3-win64-mingw.zip -O https://curl.se/windows/dl-7.73.0_3/openssl-1.1.1h_3-win32-mingw.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1013k  100 1013k    0     0  1344k      0 --:--:-- --:--:-- --:--:-- 1344k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0 4432k    0 15962    0     0  53563      0  0:01:24 --:--:--  0:01:24 53384
100 4432k  100 4432k    0     0  9045k      0 --:--:-- --:--:-- --:--:-- 9026k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 3923k  100 3923k    0     0  5926k      0 --:--:-- --:--:-- --:--:-- 5926k
+ echo 'e499c65b1c511cbc6700e436deb3771c3baa737981114c9e9f85f2ec90176861  libsodium-1.0.18-mingw.tar.gz'
+ echo 'fcaa181d848ac56150f00bc46d204d81fde4448a9afe9ef3ca04cc21d3132cb4  openssl-1.1.1h_3-win32-mingw.zip'
+ echo '913ddfa264ed9bae51f9deaa8ebce9d9450fa89fdf4c74ab41a6dfffb5880c67  openssl-1.1.1h_3-win64-mingw.zip'
+ sha256sum -c libs.sha256
libsodium-1.0.18-mingw.tar.gz: OK
openssl-1.1.1h_3-win32-mingw.zip: OK
openssl-1.1.1h_3-win64-mingw.zip: OK
+ tar xzvf libsodium-1.0.18-mingw.tar.gz
libsodium-win32/
libsodium-win32/bin/
libsodium-win32/bin/libsodium-23.dll
libsodium-win32/bin/libsodium-24.def
libsodium-win32/include/
libsodium-win32/include/sodium/
libsodium-win32/include/sodium/core.h
libsodium-win32/include/sodium/crypto_aead_aes256gcm.h
libsodium-win32/include/sodium/crypto_aead_chacha20poly1305.h
libsodium-win32/include/sodium/crypto_aead_xchacha20poly1305.h
libsodium-win32/include/sodium/crypto_auth.h
libsodium-win32/include/sodium/crypto_auth_hmacsha256.h
libsodium-win32/include/sodium/crypto_auth_hmacsha512.h
libsodium-win32/include/sodium/crypto_auth_hmacsha512256.h
libsodium-win32/include/sodium/crypto_box.h
libsodium-win32/include/sodium/crypto_box_curve25519xchacha20poly1305.h
libsodium-win32/include/sodium/crypto_box_curve25519xsalsa20poly1305.h
libsodium-win32/include/sodium/crypto_core_ed25519.h
libsodium-win32/include/sodium/crypto_core_hchacha20.h
libsodium-win32/include/sodium/crypto_core_hsalsa20.h
libsodium-win32/include/sodium/crypto_core_ristretto255.h
libsodium-win32/include/sodium/crypto_core_salsa20.h
libsodium-win32/include/sodium/crypto_core_salsa2012.h
libsodium-win32/include/sodium/crypto_core_salsa208.h
libsodium-win32/include/sodium/crypto_generichash.h
libsodium-win32/include/sodium/crypto_generichash_blake2b.h
libsodium-win32/include/sodium/crypto_hash.h
libsodium-win32/include/sodium/crypto_hash_sha256.h
libsodium-win32/include/sodium/crypto_hash_sha512.h
libsodium-win32/include/sodium/crypto_kdf.h
libsodium-win32/include/sodium/crypto_kdf_blake2b.h
libsodium-win32/include/sodium/crypto_kx.h
libsodium-win32/include/sodium/crypto_onetimeauth.h
libsodium-win32/include/sodium/crypto_onetimeauth_poly1305.h
libsodium-win32/include/sodium/crypto_pwhash.h
libsodium-win32/include/sodium/crypto_pwhash_argon2i.h
libsodium-win32/include/sodium/crypto_pwhash_argon2id.h
libsodium-win32/include/sodium/crypto_pwhash_scryptsalsa208sha256.h
libsodium-win32/include/sodium/crypto_scalarmult.h
libsodium-win32/include/sodium/crypto_scalarmult_curve25519.h
libsodium-win32/include/sodium/crypto_scalarmult_ed25519.h
libsodium-win32/include/sodium/crypto_scalarmult_ristretto255.h
libsodium-win32/include/sodium/crypto_secretbox.h
libsodium-win32/include/sodium/crypto_secretbox_xchacha20poly1305.h
libsodium-win32/include/sodium/crypto_secretbox_xsalsa20poly1305.h
libsodium-win32/include/sodium/crypto_secretstream_xchacha20poly1305.h
libsodium-win32/include/sodium/crypto_shorthash.h
libsodium-win32/include/sodium/crypto_shorthash_siphash24.h
libsodium-win32/include/sodium/crypto_sign.h
libsodium-win32/include/sodium/crypto_sign_ed25519.h
libsodium-win32/include/sodium/crypto_sign_edwards25519sha512batch.h
libsodium-win32/include/sodium/crypto_stream.h
libsodium-win32/include/sodium/crypto_stream_chacha20.h
libsodium-win32/include/sodium/crypto_stream_salsa20.h
libsodium-win32/include/sodium/crypto_stream_salsa2012.h
libsodium-win32/include/sodium/crypto_stream_salsa208.h
libsodium-win32/include/sodium/crypto_stream_xchacha20.h
libsodium-win32/include/sodium/crypto_stream_xsalsa20.h
libsodium-win32/include/sodium/crypto_verify_16.h
libsodium-win32/include/sodium/crypto_verify_32.h
libsodium-win32/include/sodium/crypto_verify_64.h
libsodium-win32/include/sodium/export.h
libsodium-win32/include/sodium/randombytes.h
libsodium-win32/include/sodium/randombytes_internal_random.h
libsodium-win32/include/sodium/randombytes_sysrandom.h
libsodium-win32/include/sodium/runtime.h
libsodium-win32/include/sodium/utils.h
libsodium-win32/include/sodium/version.h
libsodium-win32/include/sodium.h
libsodium-win32/lib/
libsodium-win32/lib/libsodium.a
libsodium-win32/lib/libsodium.dll.a
libsodium-win32/lib/libsodium.la
libsodium-win32/lib/pkgconfig/
libsodium-win32/lib/pkgconfig/libsodium.pc
libsodium-win64/
libsodium-win64/bin/
libsodium-win64/bin/libsodium-23.dll
libsodium-win64/bin/libsodium-24.def
libsodium-win64/include/
libsodium-win64/include/sodium/
libsodium-win64/include/sodium/core.h
libsodium-win64/include/sodium/crypto_aead_aes256gcm.h
libsodium-win64/include/sodium/crypto_aead_chacha20poly1305.h
libsodium-win64/include/sodium/crypto_aead_xchacha20poly1305.h
libsodium-win64/include/sodium/crypto_auth.h
libsodium-win64/include/sodium/crypto_auth_hmacsha256.h
libsodium-win64/include/sodium/crypto_auth_hmacsha512.h
libsodium-win64/include/sodium/crypto_auth_hmacsha512256.h
libsodium-win64/include/sodium/crypto_box.h
libsodium-win64/include/sodium/crypto_box_curve25519xchacha20poly1305.h
libsodium-win64/include/sodium/crypto_box_curve25519xsalsa20poly1305.h
libsodium-win64/include/sodium/crypto_core_ed25519.h
libsodium-win64/include/sodium/crypto_core_hchacha20.h
libsodium-win64/include/sodium/crypto_core_hsalsa20.h
libsodium-win64/include/sodium/crypto_core_ristretto255.h
libsodium-win64/include/sodium/crypto_core_salsa20.h
libsodium-win64/include/sodium/crypto_core_salsa2012.h
libsodium-win64/include/sodium/crypto_core_salsa208.h
libsodium-win64/include/sodium/crypto_generichash.h
libsodium-win64/include/sodium/crypto_generichash_blake2b.h
libsodium-win64/include/sodium/crypto_hash.h
libsodium-win64/include/sodium/crypto_hash_sha256.h
libsodium-win64/include/sodium/crypto_hash_sha512.h
libsodium-win64/include/sodium/crypto_kdf.h
libsodium-win64/include/sodium/crypto_kdf_blake2b.h
libsodium-win64/include/sodium/crypto_kx.h
libsodium-win64/include/sodium/crypto_onetimeauth.h
libsodium-win64/include/sodium/crypto_onetimeauth_poly1305.h
libsodium-win64/include/sodium/crypto_pwhash.h
libsodium-win64/include/sodium/crypto_pwhash_argon2i.h
libsodium-win64/include/sodium/crypto_pwhash_argon2id.h
libsodium-win64/include/sodium/crypto_pwhash_scryptsalsa208sha256.h
libsodium-win64/include/sodium/crypto_scalarmult.h
libsodium-win64/include/sodium/crypto_scalarmult_curve25519.h
libsodium-win64/include/sodium/crypto_scalarmult_ed25519.h
libsodium-win64/include/sodium/crypto_scalarmult_ristretto255.h
libsodium-win64/include/sodium/crypto_secretbox.h
libsodium-win64/include/sodium/crypto_secretbox_xchacha20poly1305.h
libsodium-win64/include/sodium/crypto_secretbox_xsalsa20poly1305.h
libsodium-win64/include/sodium/crypto_secretstream_xchacha20poly1305.h
libsodium-win64/include/sodium/crypto_shorthash.h
libsodium-win64/include/sodium/crypto_shorthash_siphash24.h
libsodium-win64/include/sodium/crypto_sign.h
libsodium-win64/include/sodium/crypto_sign_ed25519.h
libsodium-win64/include/sodium/crypto_sign_edwards25519sha512batch.h
libsodium-win64/include/sodium/crypto_stream.h
libsodium-win64/include/sodium/crypto_stream_chacha20.h
libsodium-win64/include/sodium/crypto_stream_salsa20.h
libsodium-win64/include/sodium/crypto_stream_salsa2012.h
libsodium-win64/include/sodium/crypto_stream_salsa208.h
libsodium-win64/include/sodium/crypto_stream_xchacha20.h
libsodium-win64/include/sodium/crypto_stream_xsalsa20.h
libsodium-win64/include/sodium/crypto_verify_16.h
libsodium-win64/include/sodium/crypto_verify_32.h
libsodium-win64/include/sodium/crypto_verify_64.h
libsodium-win64/include/sodium/export.h
libsodium-win64/include/sodium/randombytes.h
libsodium-win64/include/sodium/randombytes_internal_random.h
libsodium-win64/include/sodium/randombytes_sysrandom.h
libsodium-win64/include/sodium/runtime.h
libsodium-win64/include/sodium/utils.h
libsodium-win64/include/sodium/version.h
libsodium-win64/include/sodium.h
libsodium-win64/lib/
libsodium-win64/lib/libsodium.a
libsodium-win64/lib/libsodium.dll.a
libsodium-win64/lib/libsodium.la
libsodium-win64/lib/pkgconfig/
libsodium-win64/lib/pkgconfig/libsodium.pc
+ unzip openssl-1.1.1h_3-win32-mingw.zip
Archive:  openssl-1.1.1h_3-win32-mingw.zip
  inflating: openssl-1.1.1h_3-win32-mingw/BUILD-HOMEPAGE.url
  inflating: openssl-1.1.1h_3-win32-mingw/BUILD-README.txt
  inflating: openssl-1.1.1h_3-win32-mingw/CHANGES.txt
  inflating: openssl-1.1.1h_3-win32-mingw/FAQ.txt
  inflating: openssl-1.1.1h_3-win32-mingw/LICENSE.txt
  inflating: openssl-1.1.1h_3-win32-mingw/NEWS.txt
  inflating: openssl-1.1.1h_3-win32-mingw/README.txt
  inflating: openssl-1.1.1h_3-win32-mingw/ct_log_list.cnf
  inflating: openssl-1.1.1h_3-win32-mingw/ct_log_list.cnf.dist
  inflating: openssl-1.1.1h_3-win32-mingw/engines-1_1/capi.dll
  inflating: openssl-1.1.1h_3-win32-mingw/engines-1_1/padlock.dll
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/aes.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/applink.c
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/asn1.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/asn1_mac.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/asn1err.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/asn1t.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/async.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/asyncerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/bio.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/bioerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/blowfish.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/bn.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/bnerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/buffer.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/buffererr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/camellia.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/cast.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/cmac.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/cms.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/cmserr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/comp.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/comperr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/conf.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/conf_api.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/conferr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/crypto.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/cryptoerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ct.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/cterr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/des.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/dh.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/dherr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/dsa.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/dsaerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/dtls1.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/e_os2.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ebcdic.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ec.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ecdh.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ecdsa.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ecerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/engine.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/engineerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/err.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/evp.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/evperr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/hmac.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/idea.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/kdf.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/kdferr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/lhash.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/md2.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/md4.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/md5.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/mdc2.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/modes.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/obj_mac.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/objects.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/objectserr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ocsp.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ocsperr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/opensslconf.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/opensslv.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ossl_typ.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/pem.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/pem2.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/pemerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/pkcs12.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/pkcs12err.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/pkcs7.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/pkcs7err.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/rand.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/rand_drbg.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/randerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/rc2.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/rc4.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/rc5.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ripemd.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/rsa.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/rsaerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/safestack.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/seed.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/sha.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/srp.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/srtp.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ssl.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ssl2.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ssl3.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/sslerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/stack.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/store.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/storeerr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/symhacks.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/tls1.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ts.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/tserr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/txt_db.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/ui.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/uierr.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/whrlpool.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/x509.h+ unzip openssl-1.1.1h_3-win64-mingw.zip

  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/x509_vfy.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/x509err.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/x509v3.h
  inflating: openssl-1.1.1h_3-win32-mingw/include/openssl/x509v3err.h
  inflating: openssl-1.1.1h_3-win32-mingw/lib/libcrypto.a
  inflating: openssl-1.1.1h_3-win32-mingw/lib/libcrypto.dll.a
  inflating: openssl-1.1.1h_3-win32-mingw/lib/libssl.a
  inflating: openssl-1.1.1h_3-win32-mingw/lib/libssl.dll.a
  inflating: openssl-1.1.1h_3-win32-mingw/lib/pkgconfig/libcrypto.pc
  inflating: openssl-1.1.1h_3-win32-mingw/lib/pkgconfig/libssl.pc
  inflating: openssl-1.1.1h_3-win32-mingw/lib/pkgconfig/openssl.pc
  inflating: openssl-1.1.1h_3-win32-mingw/libcrypto-1_1.dll
  inflating: openssl-1.1.1h_3-win32-mingw/libssl-1_1.dll
  inflating: openssl-1.1.1h_3-win32-mingw/openssl.cnf
  inflating: openssl-1.1.1h_3-win32-mingw/openssl.cnf.dist
  inflating: openssl-1.1.1h_3-win32-mingw/openssl.exe
Archive:  openssl-1.1.1h_3-win64-mingw.zip
  inflating: openssl-1.1.1h_3-win64-mingw/BUILD-HOMEPAGE.url
  inflating: openssl-1.1.1h_3-win64-mingw/BUILD-README.txt
  inflating: openssl-1.1.1h_3-win64-mingw/CHANGES.txt
  inflating: openssl-1.1.1h_3-win64-mingw/FAQ.txt
  inflating: openssl-1.1.1h_3-win64-mingw/LICENSE.txt
  inflating: openssl-1.1.1h_3-win64-mingw/NEWS.txt
  inflating: openssl-1.1.1h_3-win64-mingw/README.txt
  inflating: openssl-1.1.1h_3-win64-mingw/ct_log_list.cnf
  inflating: openssl-1.1.1h_3-win64-mingw/ct_log_list.cnf.dist
  inflating: openssl-1.1.1h_3-win64-mingw/engines-1_1/capi.dll
  inflating: openssl-1.1.1h_3-win64-mingw/engines-1_1/padlock.dll
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/aes.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/asn1.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/asn1_mac.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/asn1err.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/asn1t.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/async.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/asyncerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/bio.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/bioerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/blowfish.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/bn.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/bnerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/buffer.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/buffererr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/camellia.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/cast.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/cmac.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/cms.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/cmserr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/comp.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/comperr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/conf.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/conf_api.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/conferr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/crypto.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/cryptoerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ct.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/cterr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/des.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/dh.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/dherr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/dsa.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/dsaerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/dtls1.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/e_os2.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ebcdic.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ec.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ecdh.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ecdsa.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ecerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/engine.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/engineerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/err.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/evp.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/evperr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/hmac.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/idea.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/kdf.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/kdferr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/lhash.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/md2.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/md4.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/md5.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/mdc2.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/modes.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/obj_mac.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/objects.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/objectserr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ocsp.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ocsperr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/opensslconf.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/opensslv.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ossl_typ.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/pem.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/pem2.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/pemerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/pkcs12.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/pkcs12err.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/pkcs7.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/pkcs7err.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/rand.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/rand_drbg.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/randerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/rc2.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/rc4.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/rc5.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ripemd.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/rsa.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/rsaerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/safestack.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/seed.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/sha.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/srp.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/srtp.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ssl.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ssl2.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ssl3.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/sslerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/stack.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/store.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/storeerr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/symhacks.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/tls1.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ts.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/tserr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/txt_db.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/ui.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/uierr.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/whrlpool.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/x509.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/x509_vfy.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/x509err.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/x509v3.h
  inflating: openssl-1.1.1h_3-win64-mingw/include/openssl/x509v3err.h
  inflating: openssl-1.1.1h_3-win64-mingw/lib/libcrypto.a
  inflating: openssl-1.1.1h_3-win64-mingw/lib/libcrypto.dll.a
  inflating: openssl-1.1.1h_3-win64-mingw/lib/libssl.a
  inflating: openssl-1.1.1h_3-win64-mingw/lib/libssl.dll.a
  inflating: openssl-1.1.1h_3-win64-mingw/lib/pkgconfig/libcrypto.pc
  inflating: openssl-1.1.1h_3-win64-mingw/lib/pkgconfig/libssl.pc
  inflating: openssl-1.1.1h_3-win64-mingw/lib/pkgconfig/openssl.pc
  inflating: openssl-1.1.1h_3-win64-mingw/libcrypto-1_1-x64.dll
  inflating: openssl-1.1.1h_3-win64-mingw/libssl-1_1-x64.dll
  inflating: openssl-1.1.1h_3-win64-mingw/openssl.cnf
  inflating: openssl-1.1.1h_3-win64-mingw/openssl.cnf.dist
  inflating: openssl-1.1.1h_3-win64-mingw/openssl.exe
+ '[' amd64 '==' i386 ]
+ export 'wine=wine'
+ '[' amd64 '==' amd64 ]
+ export 'wine=wine64'
+ make 'CC=x86_64-w64-mingw32-cc' 'PEGH_LIBSODIUM_WIN=/tmp/libsodium-win64' clean all
rm -f pegh
x86_64-w64-mingw32-cc -DPEGH_LIBSODIUM -I "/tmp/libsodium-win64/include/"    pegh.c  "/tmp/libsodium-win64/lib/libsodium.a" -o pegh
+ mv pegh.exe pegh-windows-amd64-libsodium.exe
+ make 'CC=x86_64-w64-mingw32-cc' 'PEGH_OPENSSL_WIN=/tmp/openssl-1.1.1h_3-win64-mingw' clean all
rm -f pegh
x86_64-w64-mingw32-cc -DPEGH_OPENSSL -I "/tmp/openssl-1.1.1h_3-win64-mingw/include/"    pegh.c  "/tmp/openssl-1.1.1h_3-win64-mingw/lib/libcrypto.a" -lws2_32 -o pegh
+ mv pegh.exe pegh-windows-amd64-openssl.exe
+ make 'CC=x86_64-w64-mingw32-cc' 'PEGH_OPENSSL_WIN=/tmp/openssl-1.1.1h_3-win64-mingw' 'PEGH_LIBSODIUM_WIN=/tmp/libsodium-win64' clean all
rm -f pegh
x86_64-w64-mingw32-cc -DPEGH_LIBSODIUM -DPEGH_OPENSSL -I "/tmp/libsodium-win64/include/" -I "/tmp/openssl-1.1.1h_3-win64-mingw/include/"    pegh.c  "/tmp/libsodium-win64/lib/libsodium.a" "/tmp/openssl-1.1.1h_3-win64-mingw/lib/libcrypto.a" -lws2_32 -o pegh
+ mv pegh.exe pegh-windows-amd64-libsodium-openssl.exe
+ ls -lah pegh-windows-amd64-libsodium-openssl.exe pegh-windows-amd64-libsodium.exe pegh-windows-amd64-openssl.exe
-rwxrwxrwx    1 root     root        3.0M May 22 05:15 pegh-windows-amd64-libsodium-openssl.exe
-rwxrwxrwx    1 root     root      371.6K May 22 05:15 pegh-windows-amd64-libsodium.exe
-rwxrwxrwx    1 root     root        2.8M May 22 05:15 pegh-windows-amd64-openssl.exe
+ strip pegh-windows-amd64-libsodium-openssl.exe pegh-windows-amd64-libsodium.exe pegh-windows-amd64-openssl.exe
+ ls -lah pegh-windows-amd64-libsodium-openssl.exe pegh-windows-amd64-libsodium.exe pegh-windows-amd64-openssl.exe
+ file pegh-windows-amd64-libsodium-openssl.exe pegh-windows-amd64-libsodium.exe pegh-windows-amd64-openssl.exe
-rwxrwxrwx    1 root     root        2.6M May 22 05:15 pegh-windows-amd64-libsodium-openssl.exe
-rwxrwxrwx    1 root     root      299.5K May 22 05:15 pegh-windows-amd64-libsodium.exe
-rwxrwxrwx    1 root     root        2.3M May 22 05:15 pegh-windows-amd64-openssl.exe
pegh-windows-amd64-libsodium-openssl.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
pegh-windows-amd64-libsodium.exe:         PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
pegh-windows-amd64-openssl.exe:           PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
+ wine64 ./pegh-windows-amd64-libsodium.exe -h
wine: created the configuration directory '/root/.wine'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
0012:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
0012:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
0012:err:ole:get_local_server_stream Failed: 80004002
000b:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
000b:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0014:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0014:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0014:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0014:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0014:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0014:err:ole:apartment_createwindowifneeded CreateWindow failed with error 14007
0014:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x800736b7
0014:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 800736b7
0014:err:ole:get_local_server_stream Failed: 800736b7
0010:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0010:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0010:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0016:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
0016:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0016:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0018:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
0018:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0018:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
Could not load wine-gecko. HTML rendering will be disabled.
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
wine: configuration in '/root/.wine' has been updated.
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

+ export 'TEST_BINS=./release/pegh-linux-amd64-openssl ./release/pegh-linux-amd64-libsodium-openssl ./release/pegh-linux-amd64-libsodium'
+ export 'TEST_BINS=./release/pegh-linux-amd64-openssl'
+ script=pegh-windows-amd64-libsodium-openssl.exe.sh
+ cat
+ chmod +x pegh-windows-amd64-libsodium-openssl.exe.sh
+ export 'TEST_BINS=./pegh-windows-amd64-libsodium-openssl.exe.sh ./release/pegh-linux-amd64-openssl'
+ script=pegh-windows-amd64-libsodium.exe.sh
+ cat
+ chmod +x pegh-windows-amd64-libsodium.exe.sh
+ export 'TEST_BINS=./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh ./release/pegh-linux-amd64-openssl'
+ script=pegh-windows-amd64-openssl.exe.sh
+ cat
+ chmod +x pegh-windows-amd64-openssl.exe.sh
+ export 'TEST_BINS=./pegh-windows-amd64-openssl.exe.sh ./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh ./release/pegh-linux-amd64-openssl'
+ ./test.sh
+ '[' -e /tmp/randombytes100 ']'
++ tr -dc a-z0-9
++ head -c12
+ export key=4wrl4d7jve25
+ key=4wrl4d7jve25
+ echo 'key: 4wrl4d7jve25'
+ '[' -e /tmp/leading_zero_key ']'
key: 4wrl4d7jve25
+ '[' -e /tmp/leading_zero_key_a ']'
+ '[' -e /tmp/leading_zero_key_b ']'
+ rm -f pegh
+ make PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL    pegh.c  -lcrypto -o pegh
+ mv pegh pegh.openssl
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM    pegh.c  -lsodium -o pegh
+ make PEGH_LIBSODIUM=1
+ mv pegh pegh.libsodium
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL    pegh.c  -lsodium -lcrypto -o pegh
+ make PEGH_LIBSODIUM=1 PEGH_OPENSSL=1
+ mv pegh pegh.libsodium-openssl
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-openssl.exe.sh ./pegh-windows-amd64-openssl.exe.sh
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0027:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
++ echo a
++ echo a
++ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
002b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
002d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
002f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-openssl.exe.sh -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0033:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0037:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e -f /tmp/leading_zero_key_a
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
003b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
003f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
63:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0043:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.867s
user	0m4.498s
sys	0m3.796s
+ test ./pegh-windows-amd64-openssl.exe.sh ./pegh-windows-amd64-openssl.exe.sh -v 0
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
+ echo a
+ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0049:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
++ ++ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
004b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
004d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
004f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ + ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0053:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0059:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
005d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
005f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
95:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0065:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.829s
user	0m4.630s
sys	0m3.595s
+ test ./pegh-windows-amd64-openssl.exe.sh ./pegh-windows-amd64-openssl.exe.sh -v 1
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
++ echo a
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0069:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0067:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
006b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0071:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ + ./pegh-windows-amd64-openssl.exe.sh cmp -d - 4wrl4d7jve25-wrongkey/tmp/randombytes100

Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0073:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0077:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
007b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
123:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0081:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.754s
user	0m4.247s
sys	0m3.888s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-openssl.exe.sh ./pegh-windows-amd64-libsodium.exe.sh
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0083:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
++ echo a
++ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0087:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
0089:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
008d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-openssl.exe.sh -e -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
008f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25 -i /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0093:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-openssl.exe.sh -e -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0099:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
009b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
155:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00a1:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.894s
user	0m4.370s
sys	0m3.908s
+ test ./pegh-windows-amd64-openssl.exe.sh ./pegh-windows-amd64-libsodium.exe.sh -v 0
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00a5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62++ echo a

++ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
++ echo a
++ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00a7:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00a9:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00ad:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00af:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e + ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
-v 0 4wrl4d7jve25 -i /tmp/randombytes100+ cmp - /tmp/randombytes100

Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00b3:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00b7:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00bb:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
187:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
+ ++ + ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
echo 'hopefully this doesnt make it to disk'
echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00bf:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.073s
user	0m4.358s
sys	0m3.781s
+ test ./pegh-windows-amd64-openssl.exe.sh ./pegh-windows-amd64-libsodium.exe.sh -v 1
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
++ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00c3:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
00c5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00c9:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00cb:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00cf:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00d5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00d7:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
215:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00dd:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.779s
user	0m4.313s
sys	0m3.626s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-openssl.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00df:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a++ 
++ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00e3:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00e5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00e9:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-openssl.exe.sh -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00ed:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00ef:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-openssl.exe.sh -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00f5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00f7:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
247:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00fb:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.196s
user	0m4.196s
sys	0m3.750s
+ test ./pegh-windows-amd64-openssl.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0101:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
++ echo a
++ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
encrypting same data with same key should result in different ciphertext
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0105:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0103:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0107:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
010b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
010f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0113:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0117:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
279:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ ++ echo -n a
cat - /dev/fd/63
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
011b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.985s
user	0m4.014s
sys	0m4.039s
+ test ./pegh-windows-amd64-openssl.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
++ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
011f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
0121:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ + ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0125:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0129:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
012d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0131:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0133:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
307:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0139:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.097s
user	0m4.407s
sys	0m3.548s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-openssl.exe.sh ./release/pegh-linux-amd64-openssl
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
+ echo a
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
013b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25++ echo a

++ echo a
++ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
013d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
013f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0141:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-openssl.exe.sh -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0143:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0145:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-openssl.exe.sh -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0147:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0149:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
329:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-openssl.exe.sh 4wrl4d7jve25
+ cat - /dev/fd/63
++ echo -n a
bad decryption bytes are never output, file should be 0 bytes
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
014b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.795s
user	0m4.334s
sys	0m3.548s
+ test ./pegh-windows-amd64-openssl.exe.sh ./release/pegh-linux-amd64-openssl -v 0
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl
'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
014d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
++ echo a
++ ++ echo a
./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
014f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0151:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25
encrypting then decrypting with the same key should succeed
+ + ./release/pegh-linux-amd64-openssl -d cmp 4wrl4d7jve25
- /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0153:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0155:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0157:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0159:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
015b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
347:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-openssl.exe.sh -v 0 4wrl4d7jve25
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
015d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.706s
user	0m4.106s
sys	0m3.615s
+ test ./pegh-windows-amd64-openssl.exe.sh ./release/pegh-linux-amd64-openssl -v 1
+ bin=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl'
testing binaries bin: ./pegh-windows-amd64-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
++ ++ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0161:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
015f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0163:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0165:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
encrypting with one key and decrypting with another should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0167:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0169:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-openssl.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
016b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
363:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-openssl.exe.sh -v 1 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
016d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.823s
user	0m4.195s
sys	0m3.407s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-openssl.exe.sh
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ echo a
./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
++ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium.exe.sh -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25 -i /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -f /tmp/leading_zero_key_a
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.025s
user	0m4.156s
sys	0m3.664s
+ test ./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-openssl.exe.sh -v 0
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
+ + ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
++ echo a
++ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.782s
user	0m4.308s
sys	0m3.682s
+ test ./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-openssl.exe.sh -v 1
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
++ echo a
++ echo a
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.912s
user	0m4.317s
sys	0m3.925s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-libsodium.exe.sh
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25+ 
echo a
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
++ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
++ echo a++ 
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium.exe.sh -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25 -i /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.472s
user	0m4.065s
sys	0m3.764s
+ test ./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-libsodium.exe.sh -v 0
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
++ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
++ echo a
encrypting same data with same key should result in different ciphertext
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
+ + ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.562s
user	0m3.815s
sys	0m3.862s
+ test ./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-libsodium.exe.sh -v 1
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
++ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
++ echo a
./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline

+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.625s
user	0m4.275s
sys	0m3.935s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
+ echo a
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
++ echo a
++ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-libsodium.exe.sh -e -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp ./pegh-windows-amd64-libsodium.exe.sh - -e /tmp/randombytes100
4wrl4d7jve25 -i /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-libsodium.exe.sh -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.271s
user	0m3.891s
sys	0m3.719s
+ test ./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
+ echo a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
++ echo a
++ echo a
++ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
++ echo -n a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.102s
user	0m4.150s
sys	0m3.761s
+ test ./pegh-windows-amd64-libsodium.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
+ set +eu
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
++ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.784s
user	0m4.397s
sys	0m3.568s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-libsodium.exe.sh ./release/pegh-linux-amd64-openssl
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl
+ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-libsodium.exe.sh -e -f /tmp/leading_zero_key
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25 -i /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium.exe.sh 4wrl4d7jve25
+ + ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt
echo 'hopefully this doesnt make it to disk'
+ ++ echo -n a
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.657s
user	0m4.064s
sys	0m3.660s
+ test ./pegh-windows-amd64-libsodium.exe.sh ./release/pegh-linux-amd64-openssl -v 0
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl
+ echo a
+ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
++ echo a
++ echo a
++ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium.exe.sh -v 0 4wrl4d7jve25
+ ++ echo -n a
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt
cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.295s
user	0m4.166s
sys	0m3.700s
+ test ./pegh-windows-amd64-libsodium.exe.sh ./release/pegh-linux-amd64-openssl -v 1
+ bin=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh-windows-amd64-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
++ echo a
++ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-libsodium.exe.sh -v 1 4wrl4d7jve25
+ cat - /dev/fd/63
++ echo -n a
bad decryption bytes are never output, file should be 0 bytes
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.907s
user	0m4.299s
sys	0m3.400s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./pegh-windows-amd64-openssl.exe.sh
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
++ echo a
++ echo a
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh-windows-amd64-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key_a
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
+ '[' -s bla.txt ']'
+ set -e

real	0m10.112s
user	0m4.206s
sys	0m3.730s
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./pegh-windows-amd64-openssl.exe.sh -v 0
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ + echo 'hopefully this doesnt make it to disk'
cat - /dev/fd/63
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.020s
user	0m4.144s
sys	0m3.920s
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./pegh-windows-amd64-openssl.exe.sh -v 1
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp + ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
- /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.537s
user	0m4.465s
sys	0m3.543s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./pegh-windows-amd64-libsodium.exe.sh
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100+ 
./pegh-windows-amd64-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
+ '[' -s bla.txt ']'
+ set -e

real	0m10.121s
user	0m4.202s
sys	0m3.846s
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./pegh-windows-amd64-libsodium.exe.sh -v 0
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
+ echo a
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
++ echo a
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ + ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh-windows-amd64-libsodium.exe.sh + cmp - /tmp/randombytes100
-d -f /tmp/leading_zero_key_b
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
bad decryption bytes are never output, file should be 0 bytes
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.847s
user	0m4.344s
sys	0m3.890s
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./pegh-windows-amd64-libsodium.exe.sh -v 1
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
++ echo a
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
++ echo -n a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
+ '[' -s bla.txt ']'
+ set -e

real	0m10.848s
user	0m4.572s
sys	0m3.805s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ + ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25 -i cmp /tmp/randombytes100- 
/tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
+ cat ++ - echo -n a
/dev/fd/63
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.156s
user	0m3.984s
sys	0m4.036s
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
++ echo a
./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.272s
user	0m4.214s
sys	0m3.721s
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d encrypting with one key and decrypting with another should fail
4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
+ echo 'hopefully this doesnt make it to disk'
+ + cat - /dev/fd/63
./pegh-windows-amd64-libsodium-openssl.exe.sh -d ++ echo -n a
4wrl4d7jve25 -o bla.txt
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.294s
user	0m4.389s
sys	0m3.706s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./release/pegh-linux-amd64-openssl
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl'
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
++ echo a
++ echo a
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25 -i /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt

+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.399s
user	0m4.228s
sys	0m3.505s
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./release/pegh-linux-amd64-openssl -v 0
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
+ echo a
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ bad decryption bytes are never output, file should be 0 bytes
echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0 4wrl4d7jve25
+ cat - /dev/fd/63
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m9.322s
user	0m4.080s
sys	0m3.623s
+ test ./pegh-windows-amd64-libsodium-openssl.exe.sh ./release/pegh-linux-amd64-openssl -v 1
+ bin=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-amd64-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-amd64-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
++ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt+ cat - /dev/fd/63

++ echo -n a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.161s
user	0m4.201s
sys	0m3.551s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./release/pegh-linux-amd64-openssl ./pegh-windows-amd64-openssl.exe.sh
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
+ echo a
+ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
++ echo a
++ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./release/pegh-linux-amd64-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.435s
user	0m4.867s
sys	0m3.381s
+ test ./release/pegh-linux-amd64-openssl ./pegh-windows-amd64-openssl.exe.sh -v 0
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
++ ./release/pegh-linux-amd64-openssl -v ++ 0 4wrl4d7jve25echo 
a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -e -v 0 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./release/pegh-linux-amd64-openssl -e + cmp - /tmp/randombytes100
-v 0 4wrl4d7jve25 -i /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -e -v 0 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-amd64-openssl -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.046s
user	0m4.601s
sys	0m3.346s
+ test ./release/pegh-linux-amd64-openssl ./pegh-windows-amd64-openssl.exe.sh -v 1
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./pegh-windows-amd64-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./release/pegh-linux-amd64-openssl -v 1 4wrl4d7jve25
++ ./release/pegh-linux-amd64-openssl -v 1 4wrl4d7jve25
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./release/pegh-linux-amd64-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - ./pegh-windows-amd64-openssl.exe.sh /tmp/randombytes100-d 
-f /tmp/leading_zero_key_b
+ ./release/pegh-linux-amd64-openssl -e -v 1 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./release/pegh-linux-amd64-openssl -v 1 4wrl4d7jve25
+ ./pegh-windows-amd64-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
+ '[' -s bla.txt ']'
+ set -e

real	0m9.585s
user	0m4.236s
sys	0m3.476s
+ for bin_decrypt in $TEST_BINS
+ test ./release/pegh-linux-amd64-openssl ./pegh-windows-amd64-libsodium.exe.sh
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
+ echo a
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
++ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./release/pegh-linux-amd64-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25 -i /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./release/pegh-linux-amd64-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.706s
user	0m4.564s
sys	0m3.253s
+ test ./release/pegh-linux-amd64-openssl ./pegh-windows-amd64-libsodium.exe.sh -v 0
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
++ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -e -v 0 4wrl4d7jve25
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-amd64-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./release/pegh-linux-amd64-openssl -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-amd64-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./release/pegh-linux-amd64-openssl -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt+ 
cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.186s
user	0m4.605s
sys	0m3.393s
+ test ./release/pegh-linux-amd64-openssl ./pegh-windows-amd64-libsodium.exe.sh -v 1
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh'
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium.exe.sh
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./release/pegh-linux-amd64-openssl -v ++ ./release/pegh-linux-amd64-openssl -v 1 4wrl4d7jve25
1 4wrl4d7jve25
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-amd64-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-amd64-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./release/pegh-linux-amd64-openssl -v 1 4wrl4d7jve25
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-amd64-libsodium.exe.sh -d 4wrl4d7jve25 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.453s
user	0m4.309s
sys	0m3.265s
+ for bin_decrypt in $TEST_BINS
+ test ./release/pegh-linux-amd64-openssl ./pegh-windows-amd64-libsodium-openssl.exe.sh
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
+ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
+ echo a
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
++ echo a
++ echo a
++ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-amd64-openssl -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./release/pegh-linux-amd64-openssl -e -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.117s
user	0m4.292s
sys	0m3.679s
+ test ./release/pegh-linux-amd64-openssl ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 0
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ ++ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./release/pegh-linux-amd64-openssl -e -v 0 4wrl4d7jve25
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./release/pegh-linux-amd64-openssl -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
+ + cmp - ./release/pegh-linux-amd64-openssl /tmp/randombytes100
-e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./release/pegh-linux-amd64-openssl -e -v 0 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-amd64-openssl -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -o bla.txt
+ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.472s
user	0m4.361s
sys	0m3.512s
+ test ./release/pegh-linux-amd64-openssl ./pegh-windows-amd64-libsodium-openssl.exe.sh -v 1
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./pegh-windows-amd64-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh'
+ set +eu
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./pegh-windows-amd64-libsodium-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./release/pegh-linux-amd64-openssl -v 1 4wrl4d7jve25
++ echo a
++ ./release/pegh-linux-amd64-openssl -v 1 4wrl4d7jve25
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./release/pegh-linux-amd64-openssl -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./release/pegh-linux-amd64-openssl -e -v 1 + cmp - /tmp/randombytes100
4wrl4d7jve25 -i /tmp/randombytes100
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25-wrongkey
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -e -v 1 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-amd64-libsodium-openssl.exe.sh -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ + ./release/pegh-linux-amd64-openssl -v 1 ./pegh-windows-amd64-libsodium-openssl.exe.sh 4wrl4d7jve25-d 
4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.781s
user	0m4.567s
sys	0m3.220s
+ for bin_decrypt in $TEST_BINS
+ test ./release/pegh-linux-amd64-openssl ./release/pegh-linux-amd64-openssl
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./release/pegh-linux-amd64-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
+ echo a
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./release/pegh-linux-amd64-openssl
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
++ echo a
++ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
+ ./release/pegh-linux-amd64-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25 -i /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ ./release/pegh-linux-amd64-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-amd64-openssl -e 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./release/pegh-linux-amd64-openssl 4wrl4d7jve25
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.777s
user	0m4.509s
sys	0m3.304s
+ test ./release/pegh-linux-amd64-openssl ./release/pegh-linux-amd64-openssl -v 0
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./release/pegh-linux-amd64-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./release/pegh-linux-amd64-openssl
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
++ echo a
++ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
encrypting same data with same key should result in different ciphertext
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ ./release/pegh-linux-amd64-openssl -e -v 0 4wrl4d7jve25
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
+ ./release/pegh-linux-amd64-openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
+ ./release/pegh-linux-amd64-openssl -e -v 0 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ ./release/pegh-linux-amd64-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./release/pegh-linux-amd64-openssl -e -v 0 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 cat - /dev/fd/63
-o bla.txt
+ ./release/pegh-linux-amd64-openssl -v 0 4wrl4d7jve25
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.167s
user	0m4.766s
sys	0m3.053s
+ test ./release/pegh-linux-amd64-openssl ./release/pegh-linux-amd64-openssl -v 1
+ bin=./release/pegh-linux-amd64-openssl
+ shift
+ bin_decrypt=./release/pegh-linux-amd64-openssl
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./release/pegh-linux-amd64-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
testing binaries bin: ./release/pegh-linux-amd64-openssl bin_decrypt: ./release/pegh-linux-amd64-openssl
encrypting same data with same key should result in different ciphertext
++ ./release/pegh-linux-amd64-openssl -v 1 4wrl4d7jve25
++ ./release/pegh-linux-amd64-openssl -v 1 4wrl4d7jve25
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key
+ ./release/pegh-linux-amd64-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-amd64-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./release/pegh-linux-amd64-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-amd64-openssl -e -v 1 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
6252728:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./release/pegh-linux-amd64-openssl -v 1 4wrl4d7jve25
+ ./release/pegh-linux-amd64-openssl -d 4wrl4d7jve25 -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
successful test run!
+ '[' -s bla.txt ']'
+ set -e

real	0m9.000s
user	0m4.563s
sys	0m2.992s
+ echo 'successful test run!'
+ echo 'windows binaries pass tests through wine!'
+ killall pegh-windows-amd64-libsodium-openssl.exe pegh-windows-amd64-libsodium.exe pegh-windows-amd64-openssl.exe pegh-windows-i386-libsodium-openssl.exe pegh-windows-i386-libsodium.exe pegh-windows-i386-openssl.exe
windows binaries pass tests through wine!
killall: pegh-windows-amd64-libsodium-openssl.exe: no process killed
killall: pegh-windows-amd64-libsodium.exe: no process killed
killall: pegh-windows-amd64-openssl.exe: no process killed
killall: pegh-windows-i386-libsodium-openssl.exe: no process killed
killall: pegh-windows-i386-libsodium.exe: no process killed
killall: pegh-windows-i386-openssl.exe: no process killed
+ true
+ sleep 5
+ killall -9 pegh-windows-amd64-libsodium-openssl.exe pegh-windows-amd64-libsodium.exe pegh-windows-amd64-openssl.exe pegh-windows-i386-libsodium-openssl.exe pegh-windows-i386-libsodium.exe pegh-windows-i386-openssl.exe
killall: pegh-windows-amd64-libsodium-openssl.exe: no process killed
killall: pegh-windows-amd64-libsodium.exe: no process killed
killall: pegh-windows-amd64-openssl.exe: no process killed
killall: pegh-windows-i386-libsodium-openssl.exe: no process killed
killall: pegh-windows-i386-libsodium.exe: no process killed
killall: pegh-windows-i386-openssl.exe: no process killed
+ true
+ sleep 5
+ rm -rf /root/.wine /tmp/.wine-0
+ mv pegh-windows-amd64-libsodium-openssl.exe pegh-windows-amd64-libsodium.exe pegh-windows-amd64-openssl.exe ./release/
+ docker run --rm --privileged multiarch/qemu-user-static:register --reset
Unable to find image 'multiarch/qemu-user-static:register' locally
register: Pulling from multiarch/qemu-user-static
d60bca25ef07: Pulling fs layer
7045fbe28d35: Pulling fs layer
ed8a5179ae11: Pulling fs layer
1ec39da9c97d: Pulling fs layer
1ec39da9c97d: Waiting
ed8a5179ae11: Verifying Checksum
ed8a5179ae11: Download complete
7045fbe28d35: Verifying Checksum
7045fbe28d35: Download complete
d60bca25ef07: Verifying Checksum
d60bca25ef07: Download complete
1ec39da9c97d: Verifying Checksum
1ec39da9c97d: Download complete
d60bca25ef07: Pull complete
7045fbe28d35: Pull complete
ed8a5179ae11: Pull complete
1ec39da9c97d: Pull complete
Digest: sha256:0434e870ebbe9d28d254c1e65b46969bef458490be5df04d3266ef87380518e2
Status: Downloaded newer image for multiarch/qemu-user-static:register
Setting /usr/bin/qemu-alpha-static as binfmt interpreter for alpha
Setting /usr/bin/qemu-arm-static as binfmt interpreter for arm
Setting /usr/bin/qemu-armeb-static as binfmt interpreter for armeb
Setting /usr/bin/qemu-sparc-static as binfmt interpreter for sparc
Setting /usr/bin/qemu-sparc32plus-static as binfmt interpreter for sparc32plus
Setting /usr/bin/qemu-sparc64-static as binfmt interpreter for sparc64
Setting /usr/bin/qemu-ppc-static as binfmt interpreter for ppc
Setting /usr/bin/qemu-ppc64-static as binfmt interpreter for ppc64
Setting /usr/bin/qemu-ppc64le-static as binfmt interpreter for ppc64le
Setting /usr/bin/qemu-m68k-static as binfmt interpreter for m68k
Setting /usr/bin/qemu-mips-static as binfmt interpreter for mips
Setting /usr/bin/qemu-mipsel-static as binfmt interpreter for mipsel
Setting /usr/bin/qemu-mipsn32-static as binfmt interpreter for mipsn32
Setting /usr/bin/qemu-mipsn32el-static as binfmt interpreter for mipsn32el
Setting /usr/bin/qemu-mips64-static as binfmt interpreter for mips64
Setting /usr/bin/qemu-mips64el-static as binfmt interpreter for mips64el
Setting /usr/bin/qemu-sh4-static as binfmt interpreter for sh4
Setting /usr/bin/qemu-sh4eb-static as binfmt interpreter for sh4eb
Setting /usr/bin/qemu-s390x-static as binfmt interpreter for s390x
Setting /usr/bin/qemu-aarch64-static as binfmt interpreter for aarch64
Setting /usr/bin/qemu-aarch64_be-static as binfmt interpreter for aarch64_be
Setting /usr/bin/qemu-hppa-static as binfmt interpreter for hppa
Setting /usr/bin/qemu-riscv32-static as binfmt interpreter for riscv32
Setting /usr/bin/qemu-riscv64-static as binfmt interpreter for riscv64
Setting /usr/bin/qemu-xtensa-static as binfmt interpreter for xtensa
Setting /usr/bin/qemu-xtensaeb-static as binfmt interpreter for xtensaeb
Setting /usr/bin/qemu-microblaze-static as binfmt interpreter for microblaze
Setting /usr/bin/qemu-microblazeel-static as binfmt interpreter for microblazeel
Setting /usr/bin/qemu-or1k-static as binfmt interpreter for or1k
+ docker_build i386 multiarch/alpine:i386-latest-stable .ci/build.sh
+ export ARCH=i386
+ ARCH=i386
+ shift
+ DOCKER_IMAGE=multiarch/alpine:i386-latest-stable
+ shift
++ id -g
++ pwd
++ id -g
+ docker run --rm -e ARCH -e BRANCH_NAME -e BUILD_UID=971 -e BUILD_GID=971 -v /var/lib/jenkins/workspace/moparisthebest_pegh_master:/tmp -w /tmp multiarch/alpine:i386-latest-stable sh -c 'umask a=rwx; "$@"; exit=$?; chown -R '\''971:971'\'' /tmp; exit $exit' -- .ci/build.sh
Unable to find image 'multiarch/alpine:i386-latest-stable' locally
i386-latest-stable: Pulling from multiarch/alpine
ca41585b1f3c: Pulling fs layer
ca41585b1f3c: Verifying Checksum
ca41585b1f3c: Download complete
ca41585b1f3c: Pull complete
Digest: sha256:eb6d82cfa2400bcca0e0fcd720e9daa0f45c8c4d48dd8cdcd686c7e99924ac8b
Status: Downloaded newer image for multiarch/alpine:i386-latest-stable
+ apk add build-base clang bash libsodium-dev libsodium-static openssl-dev openssl-libs-static
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/main/x86/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/community/x86/APKINDEX.tar.gz
(1/38) Upgrading libcrypto1.1 (1.1.1i-r0 -> 1.1.1k-r0)
(2/38) Upgrading libssl1.1 (1.1.1i-r0 -> 1.1.1k-r0)
(3/38) Installing ncurses-terminfo-base (6.2_p20210109-r0)
(4/38) Installing ncurses-libs (6.2_p20210109-r0)
(5/38) Installing readline (8.1.0-r0)
(6/38) Installing bash (5.1.0-r0)
Executing bash-5.1.0-r0.post-install
(7/38) Installing libgcc (10.2.1_pre1-r3)
(8/38) Installing libstdc++ (10.2.1_pre1-r3)
(9/38) Installing binutils (2.35.2-r1)
(10/38) Installing libmagic (5.39-r0)
(11/38) Installing file (5.39-r0)
(12/38) Installing libgomp (10.2.1_pre1-r3)
(13/38) Installing libatomic (10.2.1_pre1-r3)
(14/38) Installing libgphobos (10.2.1_pre1-r3)
(15/38) Installing gmp (6.2.1-r0)
(16/38) Installing isl22 (0.22-r0)
(17/38) Installing mpfr4 (4.1.0-r0)
(18/38) Installing mpc1 (1.2.0-r0)
(19/38) Installing gcc (10.2.1_pre1-r3)
(20/38) Installing musl-dev (1.2.2-r0)
(21/38) Installing libc-dev (0.7.2-r3)
(22/38) Installing g++ (10.2.1_pre1-r3)
(23/38) Installing make (4.3-r0)
(24/38) Installing fortify-headers (1.1-r0)
(25/38) Installing patch (2.7.6-r6)
(26/38) Installing build-base (0.5-r2)
(27/38) Installing libffi (3.3-r2)
(28/38) Installing xz-libs (5.2.5-r0)
(29/38) Installing libxml2 (2.9.10-r6)
(30/38) Installing llvm10-libs (10.0.1-r1)
(31/38) Installing clang-libs (10.0.1-r0)
(32/38) Installing clang (10.0.1-r0)
(33/38) Installing libsodium (1.0.18-r0)
(34/38) Installing pkgconf (1.7.3-r0)
(35/38) Installing libsodium-dev (1.0.18-r0)
(36/38) Installing libsodium-static (1.0.18-r0)
(37/38) Installing openssl-dev (1.1.1k-r0)
(38/38) Installing openssl-libs-static (1.1.1k-r0)
Executing busybox-1.32.1-r2.trigger
OK: 347 MiB in 56 packages
+ make clean all 'PEGH_LIBSODIUM=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM  -static  pegh.c  -lsodium -o pegh
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL  -static  pegh.c  -lcrypto -o pegh
+ mv pegh pegh.static.libsodium
+ make clean all 'PEGH_OPENSSL=1' 'CC=clang' 'LDFLAGS=-static'
+ mv pegh pegh.static.openssl
+ make clean all 'PEGH_LIBSODIUM=1' 'PEGH_OPENSSL=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL  -static  pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl -h
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

+ ls -lah pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
+ strip pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
-rwxrwxrwx    1 root     root      607.5K May 22 05:23 pegh.static.libsodium
-rwxrwxrwx    1 root     root        6.8M May 22 05:24 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        6.6M May 22 05:23 pegh.static.openssl
+ ls -lah pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
+ file pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
-rwxrwxrwx    1 root     root      321.4K May 22 05:24 pegh.static.libsodium
-rwxrwxrwx    1 root     root        2.2M May 22 05:24 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        2.0M May 22 05:24 pegh.static.openssl
pegh.static.libsodium:         ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
pegh.static.libsodium-openssl: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
pegh.static.openssl:           ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
+ ldd pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
/lib/ld-musl-i386.so.1: pegh.static.libsodium: Not a valid dynamic program
+ true
+ export 'TEST_BINS=./pegh.static.openssl ./pegh.openssl ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl ./pegh.static.libsodium ./pegh.libsodium'
+ '[' i386 '==' aarch64 ]
+ ./test.sh
+ '[' -e /tmp/randombytes100 ']'
++ head -c12
++ tr -dc a-z0-9
+ export key=64stuj9otxwe
+ key=64stuj9otxwe
+ echo 'key: 64stuj9otxwe'
key: 64stuj9otxwe
+ '[' -e /tmp/leading_zero_key ']'
+ '[' -e /tmp/leading_zero_key_a ']'
+ '[' -e /tmp/leading_zero_key_b ']'
+ rm -f pegh
+ make PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL    pegh.c  -lcrypto -o pegh
+ mv pegh pegh.openssl
+ make PEGH_LIBSODIUM=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM    pegh.c  -lsodium -o pegh
+ mv pegh pegh.libsodium
+ make PEGH_LIBSODIUM=1 PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL    pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.libsodium-openssl
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ ./pegh.static.openssl 64stuj9otxwe
+ echo a+ ./pegh.static.openssl -d 64stuj9otxwe

encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.static.openssl 64stuj9otxwe
echo a
++ ./pegh.static.openssl 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.static.openssl 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.340s
user	0m5.559s
sys	0m3.253s
+ test ./pegh.static.openssl ./pegh.static.openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.static.openssl -v 0 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 0 64stuj9otxwe
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ encrypting then decrypting with the same key should succeed
true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ + cat ./pegh.static.openssl -v 0 64stuj9otxwe
- /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.781s
user	0m5.355s
sys	0m3.249s
+ test ./pegh.static.openssl ./pegh.static.openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 64stuj9otxwe
++ ./pegh.static.openssl -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -v 1 64stuj9otxwe
+ cat - /dev/fd/63
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.818s
user	0m5.314s
sys	0m3.409s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl 64stuj9otxwe
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
+ ./pegh.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ++ ./pegh.static.openssl echo 64stuj9otxwea

++ echo a
++ ./pegh.static.openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -d 64stuj9otxwe
+ ./pegh.static.openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - + ./pegh.openssl -d 64stuj9otxwe -o bla.txt
/dev/fd/63
++ echo -n a
+ ./pegh.static.openssl 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m10.486s
user	0m6.147s
sys	0m2.970s
+ test ./pegh.static.openssl ./pegh.openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.openssl -v 0 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl ++ -v 0 64stuj9otxwe
echo a
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -d 64stuj9otxwe
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl + ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
-d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
large values of N without enough memory should fail
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 0 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.334s
user	0m5.228s
sys	0m3.177s
+ test ./pegh.static.openssl ./pegh.openssl -v 1
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
encrypting same data with same key should result in different ciphertext
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 64stuj9otxwe
++ echo a
++ ./pegh.static.openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e -v 1 + 64stuj9otxwe -i /tmp/randombytes100
cmp - /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 1 64stuj9otxwe
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.529s
user	0m5.321s
sys	0m3.135s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.static.openssl
+ shift
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.static.openssl 64stuj9otxwe
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl 64stuj9otxwe
++ ./pegh.static.openssl 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + ./pegh.static.libsodium-openssl ./pegh.static.openssl -d 64stuj9otxwe-e 
64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.752s
user	0m5.306s
sys	0m3.266s
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl -v 0
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 0 64stuj9otxwe
++ ./pegh.static.openssl -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
bad decryption bytes are never output, file should be 0 bytes
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.openssl -v 0 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o + bla.txt
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.602s
user	0m4.436s
sys	0m3.216s
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ echo a
./pegh.static.openssl -v 1 64stuj9otxwe++ ./pegh.static.openssl -v 1 64stuj9otxwe

/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -v 1 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m9.520s
user	0m5.000s
sys	0m3.123s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.libsodium-openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.openssl 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl 64stuj9otxwe
++ ./pegh.static.openssl 64stuj9otxwe
++ echo a
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.static.openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ ./pegh.static.openssl 64stuj9otxwe
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.458s
user	0m5.401s
sys	0m3.026s
+ test ./pegh.static.openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 64stuj9otxwe
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl -v 0 64stuj9otxwe
++ echo a
++ ./pegh.static.openssl -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 0 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
decryption failed
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m9.843s
user	0m4.422s
sys	0m3.267s
+ test ./pegh.static.openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 64stuj9otxwe
++ ./pegh.static.openssl -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a+ cmp - /tmp/randombytes100

+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 1 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.549s
user	0m5.082s
sys	0m3.191s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.libsodium
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.openssl 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.openssl 64stuj9otxwe
++ ./pegh.static.openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -d + cmp - /tmp/randombytes100
64stuj9otxwe-wrongkey
+ ./pegh.static.openssl -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl 64stuj9otxwe
+ + cat - /dev/fd/63
./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.148s
user	0m5.248s
sys	0m3.428s
+ test ./pegh.static.openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ ./pegh.static.openssl -v 0 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.openssl -v 0 64stuj9otxwe
++ ./pegh.static.openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -v 0 64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m10.473s
user	0m4.411s
sys	0m3.245s
+ test ./pegh.static.openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl -v 1 64stuj9otxwe
++ echo a
++ echo a
++ ./pegh.static.openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -v 1 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.854s
user	0m5.279s
sys	0m2.950s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.libsodium
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.openssl 64stuj9otxwe
+ echo a
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
+ ./pegh.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl 64stuj9otxwe
++ echo a
++ ./pegh.static.openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.static.openssl -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl 64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.305s
user	0m5.532s
sys	0m3.321s
+ test ./pegh.static.openssl ./pegh.libsodium -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
+ ./pegh.static.openssl -v 0 64stuj9otxwe
+ echo a
+ ./pegh.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62++ echo a

++ ./pegh.static.openssl -v 0 64stuj9otxwe
++ ./pegh.static.openssl -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe
+ ./pegh.libsodium -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ + ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
echo -n a
+ ./pegh.static.openssl -v 0 64stuj9otxwe
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.333s
user	0m4.277s
sys	0m3.300s
+ test ./pegh.static.openssl ./pegh.libsodium -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl -v 1 64stuj9otxwe
++ ./pegh.static.openssl -v 1 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -d 64stuj9otxwe
+ ./pegh.static.openssl -e + -v 1 64stuj9otxwe
cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ + cmp - ./pegh.static.openssl /tmp/randombytes100-e 
-v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.openssl -v 1 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'+ cat - /dev/fd/63

++ echo -n a
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.497s
user	0m5.241s
sys	0m2.957s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.openssl
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.openssl 64stuj9otxwe
+ echo a
+ ./pegh.static.openssl -d 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ ++ echo a
cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
./pegh.openssl 64stuj9otxwe
++ ./pegh.openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
4159777924:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.openssl 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.968s
user	0m5.597s
sys	0m3.352s
+ test ./pegh.openssl ./pegh.static.openssl -v 0
+ bin=./pegh.openssl
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.openssl -v 0 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 0 64stuj9otxwe
++ echo a
++ ./pegh.openssl -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.openssl -e -v 0 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160543876:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 0 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.452s
user	0m5.226s
sys	0m3.306s
+ test ./pegh.openssl ./pegh.static.openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.openssl -v 1 64stuj9otxwe
++ ./pegh.openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160605316:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 1 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.460s
user	0m5.284s
sys	0m3.073s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.openssl
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.openssl 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160556164:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.openssl -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
cat - ++ /dev/fd/63
echo -n a
+ ./pegh.openssl 64stuj9otxwe
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.035s
user	0m5.580s
sys	0m3.241s
+ test ./pegh.openssl ./pegh.openssl -v 0
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -d 64stuj9otxwe
+ ./pegh.openssl -v 0 64stuj9otxwe
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 0 64stuj9otxwe
++ echo a
++ echo a
++ ./pegh.openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 0 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -d + cmp - /tmp/randombytes100
-f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4159913092:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
+ ./pegh.openssl -v + cat - /dev/fd/63
++ echo -n a
0 64stuj9otxwe
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.854s
user	0m5.355s
sys	0m3.000s
+ test ./pegh.openssl ./pegh.openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 1 64stuj9otxwe
++ ./pegh.openssl -v 1 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 1 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160445572:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.openssl -v 1 64stuj9otxwe
+ + cat - echo /dev/fd/63
'hopefully this doesnt make it to disk'
+ ./pegh.openssl -d 64stuj9otxwe -o ++ bla.txt
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.226s
user	0m5.378s
sys	0m3.274s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.openssl 64stuj9otxwe+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe

+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.openssl 64stuj9otxwe
++ ./pegh.openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e 64stuj9otxwe
+ cmp - + ./pegh.static.libsodium-openssl -d 64stuj9otxwe
/tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4159802500:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - + ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
/dev/fd/63
+ ./pegh.openssl 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.150s
user	0m5.496s
sys	0m3.047s
+ test ./pegh.openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ + ./pegh.openssl -v ./pegh.static.libsodium-openssl -d 64stuj9otxwe
0 64stuj9otxwe
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl -v 0 64stuj9otxwe
++ echo a
++ ./pegh.openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 0 64stuj9otxwe
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.openssl cmp -e - -v /tmp/randombytes1000 
-f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4159831172:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.openssl -v 0 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.124s
user	0m4.682s
sys	0m3.166s
+ test ./pegh.openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 1 64stuj9otxwe
++ echo a
++ echo a
++ ./pegh.openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4159700100:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 1 64stuj9otxwe
+ ./pegh.static.libsodium-openssl + -d 64stuj9otxwe -o bla.txtecho 
'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.041s
user	0m5.058s
sys	0m3.129s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.libsodium-openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.openssl 64stuj9otxwe
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl 64stuj9otxwe
++ ./pegh.openssl 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ + cmp - ./pegh.openssl /tmp/randombytes100-e 
-f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160048260:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl 64stuj9otxwe
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.755s
user	0m5.485s
sys	0m3.050s
+ test ./pegh.openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -v 0 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ encrypting same data with same key should result in different ciphertext
cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 0 64stuj9otxwe
++ ./pegh.openssl -v 0 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 0 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160146564:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 0 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.647s
user	0m4.447s
sys	0m3.272s
+ test ./pegh.openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp ++ echo a
/dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 1 64stuj9otxwe
++ ./pegh.openssl -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160003204:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - + ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
/dev/fd/63
+ ./pegh.openssl -v 1 64stuj9otxwe
+ ++ echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m9.833s
user	0m5.363s
sys	0m2.996s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.libsodium
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.openssl 64stuj9otxwe
+ echo a
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160380036:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl 64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.652s
user	0m5.343s
sys	0m3.104s
+ test ./pegh.openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -v 0 64stuj9otxwe
+ echo a
+ ./pegh.static.libsodium -d 64stuj9otxwe
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 0 64stuj9otxwe
++ ./pegh.openssl -v 0 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 0 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.openssl cmp -e - -v /tmp/randombytes1000 
-f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160613508:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 0 64stuj9otxwe
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.017s
user	0m4.589s
sys	0m3.003s
+ test ./pegh.openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.openssl -v 1 64stuj9otxwe
++ echo ++ ./pegh.openssl -v 1 64stuj9otxwe
a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4159851652:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.openssl -v 1 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.444s
user	0m5.155s
sys	0m3.036s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.libsodium
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.openssl 64stuj9otxwe
+ ./pegh.libsodium -d 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.openssl 64stuj9otxwe
++ echo a
++ ./pegh.openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
+ ./pegh.openssl -e 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.openssl -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160560260:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.openssl 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.436s
user	0m5.614s
sys	0m3.046s
+ test ./pegh.openssl ./pegh.libsodium -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -v 0 64stuj9otxwe
+ ./pegh.libsodium -d 64stuj9otxwe
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.openssl -v 0 64stuj9otxwe
++ ./pegh.openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ + cmp ./pegh.libsodium - -d /tmp/randombytes10064stuj9otxwe-wrongkey

decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4160715908:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 0 64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.593s
user	0m4.400s
sys	0m3.195s
+ test ./pegh.openssl ./pegh.libsodium -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
encrypting same data with same key should result in different ciphertext
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl -v 1 64stuj9otxwe
++ ./pegh.openssl -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
+ ./pegh.openssl -e -v 1 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
4159757444:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
++ echo -n a
+ ./pegh.openssl -v 1 64stuj9otxwe
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.325s
user	0m5.502s
sys	0m2.989s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ++ ./pegh.static.libsodium-openssl 64stuj9otxwe
./pegh.static.libsodium-openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.555s
user	0m4.422s
sys	0m3.352s
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ + ./pegh.static.openssl -d 64stuj9otxwe
./pegh.static.libsodium-openssl + cmp - /tmp/randombytes100
-e -v 0 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - + ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
/dev/fd/63
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.584s
user	0m4.239s
sys	0m3.363s
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ + ./pegh.static.openssl -d ./pegh.static.libsodium-openssl 64stuj9otxwe-wrongkey-e 
-v 1 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
cat ++ echo -n a
- /dev/fd/63
+ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.567s
user	0m5.178s
sys	0m3.253s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62++ echo a

++ ./pegh.static.libsodium-openssl 64stuj9otxwe
++ ./pegh.static.libsodium-openssl 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.766s
user	0m4.270s
sys	0m3.141s
+ test ./pegh.static.libsodium-openssl ./pegh.openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.static.libsodium-openssl -e -v 0 -f cmp /tmp/leading_zero_key
- /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey+ cmp - /tmp/randombytes100

decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.540s
user	0m4.387s
sys	0m3.124s
+ test ./pegh.static.libsodium-openssl ./pegh.openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
+ cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.076s
user	0m5.177s
sys	0m3.063s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium-openssl 64stuj9otxwe
++ ./pegh.static.libsodium-openssl 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.460s
user	0m3.526s
sys	0m3.058s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat + ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
- /dev/fd/63
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.389s
user	0m3.403s
sys	0m3.102s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.808s
user	0m5.060s
sys	0m3.042s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl 64stuj9otxwe
++ ./pegh.static.libsodium-openssl 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.452s
user	0m3.349s
sys	0m3.217s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ + ./pegh.libsodium-openssl -d cmp 64stuj9otxwe-wrongkey
- /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.128s
user	0m3.394s
sys	0m3.206s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
++ echo a
++ echo a
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e + -v 1 -f /tmp/leading_zero_key_a
cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m10.341s
user	0m5.204s
sys	0m2.973s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium-openssl 64stuj9otxwe
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m8.240s
user	0m3.417s
sys	0m3.195s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.018s
user	0m3.467s
sys	0m3.195s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ + ./pegh.static.libsodium -d 64stuj9otxwe
cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m10.207s
user	0m5.158s
sys	0m2.877s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
+ ./pegh.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium-openssl 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium-openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium-openssl 64stuj9otxwe
decryption failed
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m8.786s
user	0m3.569s
sys	0m3.028s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
+ ./pegh.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -v 0 64stuj9otxwe
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.124s
user	0m3.328s
sys	0m3.294s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
++ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ + cmp ./pegh.static.libsodium-openssl - -e /tmp/randombytes100-v 
1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.static.libsodium-openssl -e -v cmp 1 -f - /tmp/leading_zero_key_a/tmp/randombytes100

+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium-openssl -v 1 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m10.035s
user	0m4.800s
sys	0m3.139s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl 64stuj9otxwe
+ echo a
+ ./pegh.static.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium-openssl 64stuj9otxwe
++ ./pegh.libsodium-openssl 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.758s
user	0m4.101s
sys	0m3.164s
+ test ./pegh.libsodium-openssl ./pegh.static.openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
++ echo a
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ + ./pegh.static.openssl -d cmp - 64stuj9otxwe-wrongkey/tmp/randombytes100

decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ cat - /dev/fd/63++ echo -n a

decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.206s
user	0m4.233s
sys	0m3.119s
+ test ./pegh.libsodium-openssl ./pegh.static.openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
encrypting same data with same key should result in different ciphertext
++ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
++ echo a
++ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.286s
user	0m5.163s
sys	0m3.087s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl 64stuj9otxwe
+ echo a
+ ./pegh.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl 64stuj9otxwe
++ ++ echo a
./pegh.libsodium-openssl 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -d 64stuj9otxwe
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
+ ./pegh.libsodium-openssl 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl

real	0m9.170s
user	0m4.367s
sys	0m3.207s
+ test ./pegh.libsodium-openssl ./pegh.openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ echo a
+ ./pegh.openssl -d 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
++ echo a
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100./pegh.libsodium-openssl 
-e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.672s
user	0m4.420s
sys	0m2.963s
+ test ./pegh.libsodium-openssl ./pegh.openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
++ echo a
++ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe
+ + cmp - /tmp/randombytes100
./pegh.openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.234s
user	0m5.100s
sys	0m3.150s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62++ ./pegh.libsodium-openssl 64stuj9otxwe

++ ./pegh.libsodium-openssl 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ + cmp ./pegh.static.libsodium-openssl - -d /tmp/randombytes100
64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ + ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ ++ echo -n a
./pegh.libsodium-openssl 64stuj9otxwe
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.551s
user	0m3.629s
sys	0m3.047s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat + ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
- /dev/fd/63
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ ++ echo -n a
echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.927s
user	0m3.583s
sys	0m3.380s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
++ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe
+ + ./pegh.static.libsodium-openssl -d cmp 64stuj9otxwe
- /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ + ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.412s
user	0m5.100s
sys	0m2.987s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl

+ ./pegh.libsodium-openssl 64stuj9otxwe
+ echo a
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ./pegh.libsodium-openssl 64stuj9otxwe
++ echo a
++ ./pegh.libsodium-openssl 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ + ./pegh.libsodium-openssl -d -f cmp /tmp/leading_zero_key_b- 
/tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
+ ./pegh.libsodium-openssl 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m7.655s
user	0m3.532s
sys	0m3.166s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ ./pegh.libsodium-openssl -v echo 0 a
64stuj9otxwe
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.270s
user	0m3.496s
sys	0m3.143s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
++ echo a
++ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
large values of N without enough memory should fail
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.638s
user	0m4.850s
sys	0m3.227s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium
+ bin=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl 64stuj9otxwe
++ ++ echo a
./pegh.libsodium-openssl 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl 64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.353s
user	0m3.464s
sys	0m3.036s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.527s
user	0m3.302s
sys	0m3.186s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium

+ set +eu
encrypting same data with same key should result in different ciphertext
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ++ ./pegh.libsodium-openssl -v 1 ./pegh.libsodium-openssl 64stuj9otxwe
-v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'encrypting with one key and decrypting with another should fail

+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - + /tmp/randombytes100
./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.510s
user	0m4.743s
sys	0m3.102s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.libsodium
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl 64stuj9otxwe
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ ./pegh.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl 64stuj9otxwe
++ ++ ./pegh.libsodium-openssl 64stuj9otxwe
echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.328s
user	0m3.358s
sys	0m3.093s
+ test ./pegh.libsodium-openssl ./pegh.libsodium -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ echo a
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ ./pegh.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
++ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ + ./pegh.libsodium -d -f /tmp/leading_zero_key_b
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 0 64stuj9otxwe
+ ./pegh.libsodium -d 64stuj9otxwe -o + cat - /dev/fd/63
bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.402s
user	0m3.082s
sys	0m3.504s
+ test ./pegh.libsodium-openssl ./pegh.libsodium -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
++ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -v 1 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.988s
user	0m4.932s
sys	0m3.219s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
./pegh.static.libsodium 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
+ + ./pegh.static.openssl -d cmp - /tmp/randombytes100
64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium 64stuj9otxwe
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.202s
user	0m4.138s
sys	0m3.413s
+ test ./pegh.static.libsodium ./pegh.static.openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ echo a
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
+ ./pegh.static.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.static.libsodium -v 0 64stuj9otxwe
./pegh.static.libsodium -v 0 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp ./pegh.static.libsodium - -e -v /tmp/randombytes1000 
-f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.163s
user	0m4.493s
sys	0m3.084s
+ test ./pegh.static.libsodium ./pegh.static.openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
++ echo a
++ echo a
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 1 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ cat - ++ echo -n a
/dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.832s
user	0m4.983s
sys	0m3.307s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.openssl
+ bin=./pegh.static.libsodium
+ shift
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium 64stuj9otxwe
+ echo a
+ ./pegh.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium 64stuj9otxwe
++ ./pegh.static.libsodium 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.static.libsodium 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.639s
user	0m4.493s
sys	0m3.080s
+ test ./pegh.static.libsodium ./pegh.openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 0 64stuj9otxwe
++ ./pegh.static.libsodium -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
+ + echo 'hopefully this doesnt make it to disk'
cat - /dev/fd/63
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.575s
user	0m4.326s
sys	0m3.014s
+ test ./pegh.static.libsodium ./pegh.openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
bad decryption bytes are never output, file should be 0 bytes
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.openssl -d ++ 64stuj9otxwe -o echo bla.txt
-n a
+ ./pegh.static.libsodium -v 1 64stuj9otxwe
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.932s
user	0m5.033s
sys	0m3.186s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo + ./pegh.static.libsodium-openssl -d 64stuj9otxwe
a
+ ./pegh.static.libsodium 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp ++ echo a
++ ./pegh.static.libsodium 64stuj9otxwe
/dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.267s
user	0m3.393s
sys	0m3.274s
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ echo a
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 0 64stuj9otxwe
++ ./pegh.static.libsodium -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
++ echo -n a
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
decryption failed
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m8.489s
user	0m3.515s
sys	0m3.126s
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 1 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
bad decryption bytes are never output, file should be 0 bytes
+ ++ echo cat -n - a
/dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.878s
user	0m4.772s
sys	0m3.187s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium 64stuj9otxwe
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - ./pegh.static.libsodium /tmp/randombytes100-e 
64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.libsodium 64stuj9otxwe
++ echo -n a
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
bad decryption bytes are never output, file should be 0 bytes
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl

real	0m7.862s
user	0m3.528s
sys	0m3.081s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 0 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'large values of N without enough memory should fail

+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.485s
user	0m3.365s
sys	0m3.323s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -v 1 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'++ echo -n a

decryption failed
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m9.201s
user	0m4.933s
sys	0m3.303s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ ./pegh.static.libsodium 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 encrypting same data with same key should result in different ciphertext
']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium 64stuj9otxwe++ echo a

++ ./pegh.static.libsodium 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -d + cmp - /tmp/randombytes100
64stuj9otxwe
+ ./pegh.static.libsodium -e 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium 64stuj9otxwe
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.223s
user	0m3.395s
sys	0m3.214s
+ test ./pegh.static.libsodium ./pegh.static.libsodium -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 0 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ + ./pegh.static.libsodium cat - /dev/fd/63
-d 64stuj9otxwe -o bla.txt++ echo -n a

+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.487s
user	0m3.398s
sys	0m3.174s
+ test ./pegh.static.libsodium ./pegh.static.libsodium -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -v 1 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.394s
user	0m4.950s
sys	0m3.131s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.libsodium
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium 64stuj9otxwe
+ echo a
+ ./pegh.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.static.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.579s
user	0m3.277s
sys	0m3.249s
+ test ./pegh.static.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium -d 64stuj9otxwe
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 0 64stuj9otxwe
++ echo a
++ ./pegh.static.libsodium -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -d 64stuj9otxwe
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 0 64stuj9otxwe
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.321s
user	0m3.386s
sys	0m3.214s
+ test ./pegh.static.libsodium ./pegh.libsodium -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 ++ echo a
++ ./pegh.static.libsodium -v 1 64stuj9otxwe
/dev/fd/62
++ ++ echo a
./pegh.static.libsodium -v 1 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e -v 1 + 64stuj9otxwe
cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ + ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 1 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m10.392s
user	0m4.791s
sys	0m3.052s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium 64stuj9otxwe
+ ./pegh.static.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium 64stuj9otxwe
++ ./pegh.libsodium ++ 64stuj9otxwe
++ echo a
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.libsodium -e 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium 64stuj9otxwe
+ ./pegh.static.openssl -d + cat - /dev/fd/63
64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.019s
user	0m4.293s
sys	0m3.080s
+ test ./pegh.libsodium ./pegh.static.openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.libsodium -v 0 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 0 64stuj9otxwe
++ ./pegh.libsodium -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.libsodium -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ + ./pegh.static.openssl -d -f /tmp/leading_zero_key_b./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a

+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.libsodium -v 0 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
encrypting same data with same key should result in different ciphertext
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.011s
user	0m4.185s
sys	0m3.272s
+ test ./pegh.libsodium ./pegh.static.openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ echo a
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -d 64stuj9otxwe
+ ./pegh.libsodium -e -v 1 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium + cmp - /tmp/randombytes100
-e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -d 64stuj9otxwe -o bla.txt
+ ++ echo -n a
cat - /dev/fd/63+ 
echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 1 64stuj9otxwe
decryption failed
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m10.131s
user	0m5.127s
sys	0m3.026s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium 64stuj9otxwe
++ echo a
++ ./pegh.libsodium 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e + cmp - /tmp/randombytes100
-f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.libsodium 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.835s
user	0m4.136s
sys	0m3.217s
+ test ./pegh.libsodium ./pegh.openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ ./pegh.libsodium -v 0 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 0 64stuj9otxwe
++ ./pegh.libsodium -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -v 0 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
+ ++ echo -n a
echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.138s
user	0m4.082s
sys	0m3.368s
+ test ./pegh.libsodium ./pegh.openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ echo a
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.libsodium -v 1 64stuj9otxwe
+ ./pegh.openssl -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m10.228s
user	0m5.127s
sys	0m3.088s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ echo a
+ ./pegh.libsodium 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium 64stuj9otxwe
++ echo a
++ ./pegh.libsodium 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + cat - /dev/fd/63
./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ ./pegh.libsodium 64stuj9otxwe
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.092s
user	0m3.483s
sys	0m3.056s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium -v 0 64stuj9otxwe
+ echo a
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 0 64stuj9otxwe
++ echo a
++ echo a
++ ./pegh.libsodium -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.libsodium -v 0 64stuj9otxwe
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.063s
user	0m3.483s
sys	0m3.470s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ echo a
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -v 1 64stuj9otxwe
+ cat - /dev/fd/63
+ ++ echo -n a
./pegh.static.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.135s
user	0m4.981s
sys	0m2.957s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium 64stuj9otxwe
++ echo a
++ ./pegh.libsodium 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium 64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.310s
user	0m3.437s
sys	0m3.258s
+ test ./pegh.libsodium ./pegh.libsodium-openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ ./pegh.libsodium -v 0 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 0 64stuj9otxwe
++ echo a
++ echo a
++ ./pegh.libsodium -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 0 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium -v 0 64stuj9otxwe
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
++ echo -n a
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.681s
user	0m3.172s
sys	0m3.262s
+ test ./pegh.libsodium ./pegh.libsodium-openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ echo a
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 1 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
large values of N without enough memory should fail
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 1 64stuj9otxwe
+ ./pegh.libsodium-openssl -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium

real	0m8.637s
user	0m4.921s
sys	0m3.127s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium 64stuj9otxwe
++ echo a
++ ./pegh.libsodium 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.static.libsodium -d + cmp - /tmp/randombytes100
64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.libsodium 64stuj9otxwe
++ echo -n a
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.441s
user	0m3.395s
sys	0m3.169s
+ test ./pegh.libsodium ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ ./pegh.libsodium -v 0 64stuj9otxwe
+ echo a
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 0 64stuj9otxwe
++ ./pegh.libsodium -v 0 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 0 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 0 64stuj9otxwe
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium -d 64stuj9otxwe -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.427s
user	0m3.253s
sys	0m3.236s
+ test ./pegh.libsodium ./pegh.static.libsodium -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 1 64stuj9otxwe
+ ./pegh.static.libsodium -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 1 64stuj9otxwe
+ cat - /dev/fd/63
+ ./pegh.static.libsodium ++ -d 64stuj9otxwe echo -o bla.txt-n 
a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.322s
user	0m4.921s
sys	0m3.182s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.libsodium
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium 64stuj9otxwe
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ ./pegh.libsodium -d 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium 64stuj9otxwe
++ ++ ./pegh.libsodium 64stuj9otxwe
echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e 64stuj9otxwe
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -d 64stuj9otxwe
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.libsodium -e 64stuj9otxwe -i /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - ./pegh.libsodium /tmp/randombytes100
-e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium 64stuj9otxwe
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.543s
user	0m3.459s
sys	0m3.247s
+ test ./pegh.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -v 0 64stuj9otxwe
+ ./pegh.libsodium -d 64stuj9otxwe
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium -v 0 64stuj9otxwe
++ ./pegh.libsodium -v 0 64stuj9otxwe
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -d 64stuj9otxwe
+ ./pegh.libsodium -e -v + cmp - /tmp/randombytes100
0 64stuj9otxwe
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v + 0 -f /tmp/leading_zero_key_a
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 0 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -v 0 + ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
64stuj9otxwe
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.100s
user	0m3.409s
sys	0m3.423s
+ test ./pegh.libsodium ./pegh.libsodium -v 1
+ bin=./pegh.libsodium
+ shift
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ ./pegh.libsodium -v 1 64stuj9otxwe
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 64stuj9otxwe
+ ./pegh.libsodium -e -v 1 64stuj9otxwe
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d 64stuj9otxwe-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 64stuj9otxwe -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 1 64stuj9otxwe
+ cat - /dev/fd/63
+ ./pegh.libsodium -d 64stuj9otxwe -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.330s
user	0m4.903s
sys	0m3.073s
+ echo 'successful test run!'
successful test run!
successfully built and tested static pegh against libsodium and openssl!
+ echo 'successfully built and tested static pegh against libsodium and openssl!'
+ mkdir -p release
+ mv pegh.static.libsodium ./release/pegh-linux-i386-libsodium
+ '[' i386 '==' aarch64 ]
+ mv pegh.static.openssl ./release/pegh-linux-i386-openssl
+ mv pegh.static.libsodium-openssl ./release/pegh-linux-i386-libsodium-openssl
+ '[' i386 '==' amd64 ]
going to try to build windows here...
+ '[' i386 '==' amd64 ]
+ '[' i386 '==' i386 ]
+ echo 'going to try to build windows here...'
+ apk add mingw-w64-gcc curl wine
(1/25) Installing ca-certificates (20191127-r5)
(2/25) Installing brotli-libs (1.0.9-r3)
(3/25) Installing nghttp2-libs (1.42.0-r1)
(4/25) Installing libcurl (7.76.1-r0)
(5/25) Installing curl (7.76.1-r0)
(6/25) Installing mingw-w64-binutils (2.35.1-r0)
(7/25) Installing mingw-w64-winpthreads (8.0.0-r0)
(8/25) Installing mingw-w64-headers (8.0.0-r0)
(9/25) Installing mingw-w64-crt (8.0.0-r0)
(10/25) Installing mingw-w64-gcc (10.2.0-r1)
(11/25) Installing libxau (1.0.9-r0)
(12/25) Installing libbsd (0.10.0-r0)
(13/25) Installing libxdmcp (1.1.3-r0)
(14/25) Installing libxcb (1.14-r1)
(15/25) Installing libx11 (1.7.1-r0)
(16/25) Installing libxext (1.3.4-r0)
(17/25) Installing alsa-lib (1.2.4-r2)
(18/25) Installing gdbm (1.19-r0)
(19/25) Installing libsasl (2.1.27-r10)
(20/25) Installing libldap (2.4.57-r1)
(21/25) Installing eudev-libs (3.2.9-r3)
(22/25) Installing spirv-tools (2020.3-r0)
(23/25) Installing vkd3d (1.2-r0)
(24/25) Installing wine-libs (4.0.3-r0)
(25/25) Installing wine (4.0.3-r0)
Executing busybox-1.32.1-r2.trigger
Executing ca-certificates-20191127-r5.trigger
OK: 865 MiB in 81 packages
+ pwd
+ STATIC_LIB_DIR=/tmp
+ LIBSODIUM_VERSION=1.0.18
+ OPENSSL_VERSION=1.1.1h_3
+ OPENSSL_CURL_VERSION=7.73.0_3
+ '[' '!' -d /tmp/libsodium-win32 ]
+ '[' i386 '==' i386 ]
+ make 'CC=i686-w64-mingw32-cc' 'PEGH_LIBSODIUM_WIN=/tmp/libsodium-win32' clean all
rm -f pegh
i686-w64-mingw32-cc -DPEGH_LIBSODIUM -I "/tmp/libsodium-win32/include/"    pegh.c  "/tmp/libsodium-win32/lib/libsodium.a" -o pegh
+ mv pegh.exe pegh-windows-i386-libsodium.exe
+ make 'CC=i686-w64-mingw32-cc' 'PEGH_OPENSSL_WIN=/tmp/openssl-1.1.1h_3-win32-mingw' clean all
rm -f pegh
i686-w64-mingw32-cc -DPEGH_OPENSSL -I "/tmp/openssl-1.1.1h_3-win32-mingw/include/"    pegh.c  "/tmp/openssl-1.1.1h_3-win32-mingw/lib/libcrypto.a" -lws2_32 -o pegh
+ mv pegh.exe pegh-windows-i386-openssl.exe
+ make 'CC=i686-w64-mingw32-cc' 'PEGH_OPENSSL_WIN=/tmp/openssl-1.1.1h_3-win32-mingw' 'PEGH_LIBSODIUM_WIN=/tmp/libsodium-win32' clean all
rm -f pegh
i686-w64-mingw32-cc -DPEGH_LIBSODIUM -DPEGH_OPENSSL -I "/tmp/libsodium-win32/include/" -I "/tmp/openssl-1.1.1h_3-win32-mingw/include/"    pegh.c  "/tmp/libsodium-win32/lib/libsodium.a" "/tmp/openssl-1.1.1h_3-win32-mingw/lib/libcrypto.a" -lws2_32 -o pegh
+ mv pegh.exe pegh-windows-i386-libsodium-openssl.exe
+ export 'wine=wine'
+ '[' i386 '==' amd64 ]
+ ls -lah pegh-windows-i386-libsodium-openssl.exe pegh-windows-i386-libsodium.exe pegh-windows-i386-openssl.exe
-rwxrwxrwx    1 root     root        2.6M May 22 05:40 pegh-windows-i386-libsodium-openssl.exe
-rwxrwxrwx    1 root     root      426.9K May 22 05:40 pegh-windows-i386-libsodium.exe
-rwxrwxrwx    1 root     root        2.3M May 22 05:40 pegh-windows-i386-openssl.exe
+ strip pegh-windows-i386-libsodium-openssl.exe pegh-windows-i386-libsodium.exe pegh-windows-i386-openssl.exe
-rwxrwxrwx    1 root     root        2.2M May 22 05:40 pegh-windows-i386-libsodium-openssl.exe
-rwxrwxrwx    1 root     root      349.5K May 22 05:40 pegh-windows-i386-libsodium.exe
-rwxrwxrwx    1 root     root        1.9M May 22 05:40 pegh-windows-i386-openssl.exe
+ ls -lah pegh-windows-i386-libsodium-openssl.exe pegh-windows-i386-libsodium.exe pegh-windows-i386-openssl.exe
+ file pegh-windows-i386-libsodium-openssl.exe pegh-windows-i386-libsodium.exe pegh-windows-i386-openssl.exe
pegh-windows-i386-libsodium-openssl.exe: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
pegh-windows-i386-libsodium.exe:         PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
pegh-windows-i386-openssl.exe:           PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
+ wine ./pegh-windows-i386-libsodium.exe -h
wine: created the configuration directory '/root/.wine'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0012:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0012:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0012:err:ole:apartment_createwindowifneeded CreateWindow failed with error 183
0014:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
0014:err:ole:marshal_object couldn't get IPSFactory buffer for interface {6d5140c1-7436-11ce-8034-00aa006009fa}
0014:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x80004002
0014:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 80004002
0014:err:ole:get_local_server_stream Failed: 80004002
0012:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0012:err:ole:marshal_object couldn't get IPSFactory buffer for interface {00000131-0000-0000-c000-000000000046}
000b:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
000b:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0012:err:ole:apartment_createwindowifneeded CreateWindow failed with error 14007
0012:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hres=0x800736b7
0012:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, 800736b7
0012:err:ole:get_local_server_stream Failed: 800736b7
0010:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0010:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0010:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0016:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
0016:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0016:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0018:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
0018:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0018:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
Could not load wine-gecko. HTML rendering will be disabled.
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
wine: configuration in '/root/.wine' has been updated.
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

+ export 'TEST_BINS=./release/pegh-linux-i386-openssl ./release/pegh-linux-i386-libsodium-openssl ./release/pegh-linux-i386-libsodium'
+ export 'TEST_BINS=./release/pegh-linux-i386-openssl'
+ script=pegh-windows-i386-libsodium-openssl.exe.sh
+ cat
+ chmod +x pegh-windows-i386-libsodium-openssl.exe.sh
+ export 'TEST_BINS=./pegh-windows-i386-libsodium-openssl.exe.sh ./release/pegh-linux-i386-openssl'
+ script=pegh-windows-i386-libsodium.exe.sh
+ cat
+ chmod +x pegh-windows-i386-libsodium.exe.sh
+ export 'TEST_BINS=./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh ./release/pegh-linux-i386-openssl'
+ script=pegh-windows-i386-openssl.exe.sh
+ cat
+ chmod +x pegh-windows-i386-openssl.exe.sh
+ export 'TEST_BINS=./pegh-windows-i386-openssl.exe.sh ./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh ./release/pegh-linux-i386-openssl'
+ ./test.sh
+ '[' -e /tmp/randombytes100 ']'
++ tr -dc a-z0-9
++ head -c12
+ export key=2yhoc7qvi2mz
+ key=2yhoc7qvi2mz
+ echo 'key: 2yhoc7qvi2mz'
+ '[' -e /tmp/leading_zero_key ']'
+ '[' -e /tmp/leading_zero_key_a ']'
key: 2yhoc7qvi2mz
+ '[' -e /tmp/leading_zero_key_b ']'
+ rm -f pegh
+ make PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL    pegh.c  -lcrypto -o pegh
+ mv pegh pegh.openssl
+ make PEGH_LIBSODIUM=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM    pegh.c  -lsodium -o pegh
+ mv pegh pegh.libsodium
+ make PEGH_LIBSODIUM=1 PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL    pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.libsodium-openssl
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-openssl.exe.sh ./pegh-windows-i386-openssl.exe.sh
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0025:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
++ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
002b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
0029:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
002f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-openssl.exe.sh -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0031:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0037:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-i386-openssl.exe.sh -e -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
003b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
003d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
61:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0043:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
+ '[' -s bla.txt ']'
+ set -e

real	0m12.360s
user	0m5.247s
sys	0m4.122s
+ test ./pegh-windows-i386-openssl.exe.sh ./pegh-windows-i386-openssl.exe.sh -v 0
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ echo a
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0045:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
004b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0049:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
004f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0051:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ + cmp - /tmp/randombytes100
./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0057:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0059:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
005d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
93:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0061:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m11.754s
user	0m5.074s
sys	0m3.908s
+ test ./pegh-windows-i386-openssl.exe.sh ./pegh-windows-i386-openssl.exe.sh -v 1
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo ++ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
a
++ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0067:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
0065:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0069:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
006d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -i + /tmp/randombytes100
cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0071:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0075:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0079:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
121:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ + echo 'hopefully this doesnt make it to disk'
echo -n + ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
007f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.504s
user	0m5.006s
sys	0m3.997s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-openssl.exe.sh ./pegh-windows-i386-libsodium.exe.sh
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
+ set +eu
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
+ '[' '' '!=' 1 ']'
+ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0081:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
++ echo a
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0085:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
0087:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
008b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh-windows-i386-openssl.exe.sh -e -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
008d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0091:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-openssl.exe.sh -e -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0097:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0099:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
153:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
+ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
009f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.520s
user	0m5.436s
sys	0m3.799s
+ test ./pegh-windows-i386-openssl.exe.sh ./pegh-windows-i386-libsodium.exe.sh -v 0
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00a3:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
++ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
encrypting same data with same key should result in different ciphertext
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00a5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00a7:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00ab:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00af:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00b3:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00b5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00b9:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
185:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ cat - /dev/fd/63
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00bd:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m10.468s
user	0m4.572s
sys	0m3.661s
+ test ./pegh-windows-i386-openssl.exe.sh ./pegh-windows-i386-libsodium.exe.sh -v 1
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
++ echo a
++ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00c1:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
00c3:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00c5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00c9:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00cd:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00d1:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00d5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
213:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00d9:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.200s
user	0m5.026s
sys	0m3.678s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-openssl.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00df:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp ++ echo a
/dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
++ echo a
++ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00e1:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00e3:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ + ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00e5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -e -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00eb:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00ef:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00f1:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00f5:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
245:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00fb:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m12.102s
user	0m5.534s
sys	0m3.996s
+ test ./pegh-windows-i386-openssl.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
00fd:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0101:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0103:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0107:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
010b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
010d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0111:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0115:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
277:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
011b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.185s
user	0m4.829s
sys	0m3.903s
+ test ./pegh-windows-i386-openssl.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
011d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
011f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0123:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0127:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-openssl.exe.sh -e -v + cmp - /tmp/randombytes100
1 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
012b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
012f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0131:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
305:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
+ cat - /dev/fd/63
++ + ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
echo -n a
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0137:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.911s
user	0m5.349s
sys	0m3.697s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-openssl.exe.sh ./release/pegh-linux-i386-openssl
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl'
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0139:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62++ echo a

++ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
++ echo a
++ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
013b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
013d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
013f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-openssl.exe.sh -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0141:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0143:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -f /tmp/leading_zero_key_a
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0145:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0147:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
327:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -o bla.txt
+ ./pegh-windows-i386-openssl.exe.sh 2yhoc7qvi2mz
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0149:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.828s
user	0m5.692s
sys	0m3.785s
+ test ./pegh-windows-i386-openssl.exe.sh ./release/pegh-linux-i386-openssl -v 0
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
014b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ ./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
014d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
014f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0151:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0153:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0155:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0157:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0159:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
345:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63+ 
./pegh-windows-i386-openssl.exe.sh -v 0 2yhoc7qvi2mz
bad decryption bytes are never output, file should be 0 bytes
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -o bla.txt
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
015b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.044s
user	0m5.435s
sys	0m3.589s
+ test ./pegh-windows-i386-openssl.exe.sh ./release/pegh-linux-i386-openssl -v 1
+ bin=./pegh-windows-i386-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
++ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
testing binaries bin: ./pegh-windows-i386-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl
encrypting same data with same key should result in different ciphertext
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
015d:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
015f:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0161:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-openssl.exe.sh + -e -v 1 cmp -f - /tmp/leading_zero_key/tmp/randombytes100

Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0163:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0165:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0167:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
0169:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
scrypt key derivation error
361:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded::0:
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-i386-openssl.exe.sh -v 1 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
016b:err:winediag:gnutls_initialize failed to load libgnutls, no support for encryption
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.325s
user	0m5.204s
sys	0m3.416s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-openssl.exe.sh
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
+ echo a
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
./pegh-windows-i386-libsodium.exe.sh ++ 2yhoc7qvi2mz
./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
++ echo a
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium.exe.sh -e -f /tmp/leading_zero_key
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.265s
user	0m4.541s
sys	0m3.848s
+ test ./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-openssl.exe.sh -v 0
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium.exe.sh ++ -v ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
0 2yhoc7qvi2mz
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.298s
user	0m4.549s
sys	0m3.776s
+ test ./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-openssl.exe.sh -v 1
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'encrypting/decrypting with key in file where last byte is different should fail

+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.858s
user	0m5.412s
sys	0m3.594s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-libsodium.exe.sh
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
+ echo a
+ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a++ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz

++ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-i386-libsodium.exe.sh -e -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.015s
user	0m4.007s
sys	0m3.719s
+ test ./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-libsodium.exe.sh -v 0
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
+ echo a
+ + ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
++ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
+ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
bad decryption bytes are never output, file should be 0 bytes
++ echo -n a
decryption failed
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	0m9.915s
user	0m3.717s
sys	0m3.907s
+ test ./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-libsodium.exe.sh -v 1
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
++ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ cat - + ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
/dev/fd/63
+ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
++ echo -n a
decryption failed
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
+ '[' -s bla.txt ']'
+ set -e

real	0m11.638s
user	0m5.543s
sys	0m3.377s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
++ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - + ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
/tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -e -f + cmp - /tmp/randombytes100
/tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -e -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.908s
user	0m4.019s
sys	0m3.702s
+ test ./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
++ echo a
++ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.201s
user	0m4.135s
sys	0m3.778s
+ test ./pegh-windows-i386-libsodium.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
++ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
++ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
++ echo -n a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m11.539s
user	0m5.371s
sys	0m3.650s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-libsodium.exe.sh ./release/pegh-linux-i386-openssl
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
+ echo a
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
echo a
++ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-libsodium.exe.sh -e -f /tmp/leading_zero_key
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-i386-libsodium.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-libsodium.exe.sh 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.861s
user	0m4.565s
sys	0m3.459s
+ test ./pegh-windows-i386-libsodium.exe.sh ./release/pegh-linux-i386-openssl -v 0
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl'
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-i386-libsodium.exe.sh -v + 0 2yhoc7qvi2mz
./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz++ 
./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz + -o bla.txt
cat - /dev/fd/63
+ ./pegh-windows-i386-libsodium.exe.sh -v 0 2yhoc7qvi2mz
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.524s
user	0m4.537s
sys	0m3.805s
+ test ./pegh-windows-i386-libsodium.exe.sh ./release/pegh-linux-i386-openssl -v 1
testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl
encrypting same data with same key should result in different ciphertext
+ bin=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
++ echo a
++ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-i386-libsodium.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-libsodium.exe.sh -v 1 2yhoc7qvi2mz
+ echo 'hopefully this doesnt make it to disk'+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -o bla.txt

+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.052s
user	0m5.330s
sys	0m3.490s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./pegh-windows-i386-openssl.exe.sh
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
++ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key_a+ cmp - /tmp/randombytes100

Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
++ echo -n a
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.540s
user	0m4.703s
sys	0m3.736s
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./pegh-windows-i386-openssl.exe.sh -v 0
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
++ echo a
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.226s
user	0m4.709s
sys	0m3.583s
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./pegh-windows-i386-openssl.exe.sh -v 1
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo ++ a
./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.245s
user	0m5.636s
sys	0m3.476s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./pegh-windows-i386-libsodium.exe.sh
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
++ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
++ echo ++ echo a
a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
encrypting with one key and decrypting with another should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
+ cat - /dev/fd/63
++ + ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
echo -n a
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m8.957s
user	0m3.981s
sys	0m3.719s
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./pegh-windows-i386-libsodium.exe.sh -v 0
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ echo a
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-libsodium.exe.sh + -d ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.268s
user	0m4.060s
sys	0m3.874s
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./pegh-windows-i386-libsodium.exe.sh -v 1
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -euencrypting same data with same key should result in different ciphertext

+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
encrypting then decrypting with the same key should succeed
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.192s
user	0m5.315s
sys	0m3.699s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
+ echo a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.455s
user	0m4.264s
sys	0m3.727s
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ echo a
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp ++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
/dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.265s
user	0m4.021s
sys	0m3.821s
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m12.167s
user	0m5.408s
sys	0m3.705s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./release/pegh-linux-i386-openssl
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
++ echo a
++ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -f /tmp/leading_zero_key_a
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
bad decryption bytes are never output, file should be 0 bytes
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.000s
user	0m4.489s
sys	0m3.479s
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./release/pegh-linux-i386-openssl -v 0
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl'
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0 2yhoc7qvi2mz
bad decryption bytes are never output, file should be 0 bytes
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -o bla.txt
+ ++ echo -n a
cat - /dev/fd/63
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl
encrypting same data with same key should result in different ciphertext

real	0m9.705s
user	0m4.208s
sys	0m3.631s
+ test ./pegh-windows-i386-libsodium-openssl.exe.sh ./release/pegh-linux-i386-openssl -v 1
+ bin=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
+ echo 'testing binaries bin: ./pegh-windows-i386-libsodium-openssl.exe.sh bin_decrypt: ./release/pegh-linux-i386-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
++ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
++ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
bad decryption bytes are never output, file should be 0 bytes
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -o bla.txt
+ ++ echo -n a
cat - /dev/fd/63
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1 2yhoc7qvi2mz
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.914s
user	0m5.073s
sys	0m3.670s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./release/pegh-linux-i386-openssl ./pegh-windows-i386-openssl.exe.sh
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ++ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -e -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./release/pegh-linux-i386-openssl -e -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
+ + ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
echo 'hopefully this doesnt make it to disk'
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.054s
user	0m5.466s
sys	0m3.722s
+ test ./release/pegh-linux-i386-openssl ./pegh-windows-i386-openssl.exe.sh -v 0
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
+ + ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
++ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./release/pegh-linux-i386-openssl -e -v 0 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./release/pegh-linux-i386-openssl -e -v 0 -f /tmp/leading_zero_key_a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.009s
user	0m5.451s
sys	0m3.310s
+ test ./release/pegh-linux-i386-openssl ./pegh-windows-i386-openssl.exe.sh -v 1
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./pegh-windows-i386-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
++ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh-windows-i386-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -e -v 1 -f /tmp/leading_zero_key
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ + ./release/pegh-linux-i386-openssl -e -v 1 -f /tmp/leading_zero_key_a./pegh-windows-i386-openssl.exe.sh 
-d -f /tmp/leading_zero_key_b
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
+ ./pegh-windows-i386-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m11.097s
user	0m5.428s
sys	0m3.317s
+ for bin_decrypt in $TEST_BINS
+ test ./release/pegh-linux-i386-openssl ./pegh-windows-i386-libsodium.exe.sh
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
+ echo a
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
++ echo a
++ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
encrypting same data with same key should result in different ciphertext
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-i386-openssl -e -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./release/pegh-linux-i386-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.947s
user	0m5.577s
sys	0m3.659s
+ test ./release/pegh-linux-i386-openssl ./pegh-windows-i386-libsodium.exe.sh -v 0
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
+ + ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
++ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz
encrypting then decrypting with the same key should succeed
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-i386-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-i386-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
echo 'hopefully this doesnt make it to disk'
+ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.220s
user	0m4.994s
sys	0m3.400s
+ test ./release/pegh-linux-i386-openssl ./pegh-windows-i386-libsodium.exe.sh -v 1
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium.exe.sh
encrypting same data with same key should result in different ciphertext
++ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
++ echo a
++ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key
+ ./release/pegh-linux-i386-openssl -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium.exe.sh -d -f /tmp/leading_zero_key_b
+ ./release/pegh-linux-i386-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ + cat - /dev/fd/63
./pegh-windows-i386-libsodium.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.513s
user	0m5.361s
sys	0m3.412s
+ for bin_decrypt in $TEST_BINS
+ test ./release/pegh-linux-i386-openssl ./pegh-windows-i386-libsodium-openssl.exe.sh
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
+ echo a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
++ echo a
++ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-i386-openssl -e -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ ./release/pegh-linux-i386-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - ++ echo -n a
/dev/fd/63
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m10.155s
user	0m5.953s
sys	0m3.210s
+ test ./release/pegh-linux-i386-openssl ./pegh-windows-i386-libsodium-openssl.exe.sh -v 0
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
++ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./release/pegh-linux-i386-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-i386-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
large values of N without enough memory should fail
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
+ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
+ echo 'hopefully this doesnt make it to disk'
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.261s
user	0m4.934s
sys	0m3.589s
+ test ./release/pegh-linux-i386-openssl ./pegh-windows-i386-libsodium-openssl.exe.sh -v 1
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./pegh-windows-i386-libsodium-openssl.exe.sh
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./pegh-windows-i386-libsodium-openssl.exe.sh
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
++ echo a
++ echo a
++ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key
+ ./release/pegh-linux-i386-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz-wrongkey
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./release/pegh-linux-i386-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ + ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
cat - + ./pegh-windows-i386-libsodium-openssl.exe.sh -d 2yhoc7qvi2mz -o bla.txt
/dev/fd/63
++ echo -n a
Wine cannot find the FreeType font library.  To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.435s
user	0m5.301s
sys	0m3.404s
+ for bin_decrypt in $TEST_BINS
+ test ./release/pegh-linux-i386-openssl ./release/pegh-linux-i386-openssl
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./release/pegh-linux-i386-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./release/pegh-linux-i386-openssl
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
++ echo a
++ echo a
++ ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
encrypting then decrypting with the same key should succeed
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./release/pegh-linux-i386-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-i386-openssl -e -f /tmp/leading_zero_key_a
+ ./release/pegh-linux-i386-openssl + cmp - /tmp/randombytes100
-d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-i386-openssl -e 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./release/pegh-linux-i386-openssl ./release/pegh-linux-i386-openssl 2yhoc7qvi2mz-d 
2yhoc7qvi2mz -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m9.452s
user	0m5.794s
sys	0m3.078s
+ test ./release/pegh-linux-i386-openssl ./release/pegh-linux-i386-openssl -v 0
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./release/pegh-linux-i386-openssl
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./release/pegh-linux-i386-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
++ + cmp /dev/fd/63 /dev/fd/62
++ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
echo a
++ echo a
++ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ + ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
./release/pegh-linux-i386-openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./release/pegh-linux-i386-openssl + ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
-e -v 0 2yhoc7qvi2mz -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./release/pegh-linux-i386-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-i386-openssl -e -v 0 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ + cat - /dev/fd/63
./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -o bla.txt++ echo -n a

+ ./release/pegh-linux-i386-openssl -v 0 2yhoc7qvi2mz
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.690s
user	0m5.629s
sys	0m3.437s
+ test ./release/pegh-linux-i386-openssl ./release/pegh-linux-i386-openssl -v 1
+ bin=./release/pegh-linux-i386-openssl
+ shift
+ bin_decrypt=./release/pegh-linux-i386-openssl
+ shift
testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./release/pegh-linux-i386-openssl
+ echo 'testing binaries bin: ./release/pegh-linux-i386-openssl bin_decrypt: ./release/pegh-linux-i386-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
++ echo a
+ cmp /dev/fd/63 /dev/fd/62
++ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
++ echo a
++ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ + ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz
./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./release/pegh-linux-i386-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz-wrongkey
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./release/pegh-linux-i386-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./release/pegh-linux-i386-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./release/pegh-linux-i386-openssl -e -v 1 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
136584268:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./release/pegh-linux-i386-openssl -v 1 2yhoc7qvi2mz
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
+ ./release/pegh-linux-i386-openssl -d 2yhoc7qvi2mz -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m7.709s
user	0m5.899s
sys	0m2.989s
successful test run!
+ echo 'successful test run!'
windows binaries pass tests through wine!
+ echo 'windows binaries pass tests through wine!'
+ killall pegh-windows-amd64-libsodium-openssl.exe pegh-windows-amd64-libsodium.exe pegh-windows-amd64-openssl.exe pegh-windows-i386-libsodium-openssl.exe pegh-windows-i386-libsodium.exe pegh-windows-i386-openssl.exe
killall: pegh-windows-amd64-libsodium-openssl.exe: no process killed
killall: pegh-windows-amd64-libsodium.exe: no process killed
killall: pegh-windows-amd64-openssl.exe: no process killed
killall: pegh-windows-i386-libsodium-openssl.exe: no process killed
killall: pegh-windows-i386-libsodium.exe: no process killed
killall: pegh-windows-i386-openssl.exe: no process killed
+ true
+ sleep 5
+ killall -9 pegh-windows-amd64-libsodium-openssl.exe pegh-windows-amd64-libsodium.exe pegh-windows-amd64-openssl.exe pegh-windows-i386-libsodium-openssl.exe pegh-windows-i386-libsodium.exe pegh-windows-i386-openssl.exe
killall: pegh-windows-amd64-libsodium-openssl.exe: no process killed
killall: pegh-windows-amd64-libsodium.exe: no process killed
killall: pegh-windows-amd64-openssl.exe: no process killed
killall: pegh-windows-i386-libsodium-openssl.exe: no process killed
killall: pegh-windows-i386-libsodium.exe: no process killed
killall: pegh-windows-i386-openssl.exe: no process killed
+ true
+ sleep 5
+ rm -rf /root/.wine /tmp/.wine-0
+ mv pegh-windows-i386-libsodium-openssl.exe pegh-windows-i386-libsodium.exe pegh-windows-i386-openssl.exe ./release/
+ docker_build aarch64 multiarch/alpine:aarch64-latest-stable .ci/build.sh
+ export ARCH=aarch64
+ ARCH=aarch64
+ shift
+ DOCKER_IMAGE=multiarch/alpine:aarch64-latest-stable
+ shift
++ id -g
++ pwd
++ id -g
+ docker run --rm -e ARCH -e BRANCH_NAME -e BUILD_UID=971 -e BUILD_GID=971 -v /var/lib/jenkins/workspace/moparisthebest_pegh_master:/tmp -w /tmp multiarch/alpine:aarch64-latest-stable sh -c 'umask a=rwx; "$@"; exit=$?; chown -R '\''971:971'\'' /tmp; exit $exit' -- .ci/build.sh
Unable to find image 'multiarch/alpine:aarch64-latest-stable' locally
aarch64-latest-stable: Pulling from multiarch/alpine
7f210dca2caf: Pulling fs layer
7f210dca2caf: Verifying Checksum
7f210dca2caf: Download complete
7f210dca2caf: Pull complete
Digest: sha256:d81f92a1677b32810cdb70d68828c91876076531756829950f244a9678314278
Status: Downloaded newer image for multiarch/alpine:aarch64-latest-stable
+ apk add build-base clang bash libsodium-dev libsodium-static openssl-dev openssl-libs-static
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/main/aarch64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/community/aarch64/APKINDEX.tar.gz
(1/38) Upgrading libcrypto1.1 (1.1.1i-r0 -> 1.1.1k-r0)
(2/38) Upgrading libssl1.1 (1.1.1i-r0 -> 1.1.1k-r0)
(3/38) Installing ncurses-terminfo-base (6.2_p20210109-r0)
(4/38) Installing ncurses-libs (6.2_p20210109-r0)
(5/38) Installing readline (8.1.0-r0)
(6/38) Installing bash (5.1.0-r0)
Executing bash-5.1.0-r0.post-install
(7/38) Installing libgcc (10.2.1_pre1-r3)
(8/38) Installing libstdc++ (10.2.1_pre1-r3)
(9/38) Installing binutils (2.35.2-r1)
(10/38) Installing libmagic (5.39-r0)
(11/38) Installing file (5.39-r0)
(12/38) Installing libgomp (10.2.1_pre1-r3)
(13/38) Installing libatomic (10.2.1_pre1-r3)
(14/38) Installing libgphobos (10.2.1_pre1-r3)
(15/38) Installing gmp (6.2.1-r0)
(16/38) Installing isl22 (0.22-r0)
(17/38) Installing mpfr4 (4.1.0-r0)
(18/38) Installing mpc1 (1.2.0-r0)
(19/38) Installing gcc (10.2.1_pre1-r3)
(20/38) Installing musl-dev (1.2.2-r0)
(21/38) Installing libc-dev (0.7.2-r3)
(22/38) Installing g++ (10.2.1_pre1-r3)
(23/38) Installing make (4.3-r0)
(24/38) Installing fortify-headers (1.1-r0)
(25/38) Installing patch (2.7.6-r6)
(26/38) Installing build-base (0.5-r2)
(27/38) Installing libffi (3.3-r2)
(28/38) Installing xz-libs (5.2.5-r0)
(29/38) Installing libxml2 (2.9.10-r6)
(30/38) Installing llvm10-libs (10.0.1-r1)
(31/38) Installing clang-libs (10.0.1-r0)
(32/38) Installing clang (10.0.1-r0)
(33/38) Installing libsodium (1.0.18-r0)
(34/38) Installing pkgconf (1.7.3-r0)
(35/38) Installing libsodium-dev (1.0.18-r0)
(36/38) Installing libsodium-static (1.0.18-r0)
(37/38) Installing openssl-dev (1.1.1k-r0)
(38/38) Installing openssl-libs-static (1.1.1k-r0)
Executing busybox-1.32.1-r2.trigger
OK: 370 MiB in 56 packages
+ make clean all 'PEGH_LIBSODIUM=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM  -static  pegh.c  -lsodium -o pegh
+ mv pegh pegh.static.libsodium
+ make clean all 'PEGH_OPENSSL=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL  -static  pegh.c  -lcrypto -o pegh
+ mv pegh pegh.static.openssl
+ make clean all 'PEGH_LIBSODIUM=1' 'PEGH_OPENSSL=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL  -static  pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl -h
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

+ ls -lah pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
-rwxrwxrwx    1 root     root      554.2K May 22 05:49 pegh.static.libsodium
-rwxrwxrwx    1 root     root        8.9M May 22 05:50 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        8.7M May 22 05:50 pegh.static.openssl
+ strip pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
+ ls -lah pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
-rwxrwxrwx    1 root     root      174.1K May 22 05:50 pegh.static.libsodium
-rwxrwxrwx    1 root     root        1.8M May 22 05:50 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        1.7M May 22 05:50 pegh.static.openssl
+ file pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
pegh.static.libsodium:         ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
pegh.static.libsodium-openssl: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
pegh.static.openssl:           ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped
+ ldd pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
/lib/ld-musl-aarch64.so.1: pegh.static.libsodium: Not a valid dynamic program
+ true
+ export 'TEST_BINS=./pegh.static.openssl ./pegh.openssl ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl ./pegh.static.libsodium ./pegh.libsodium'
+ '[' aarch64 '==' aarch64 ]
+ export 'TEST_BINS=./pegh.static.libsodium-openssl ./pegh.libsodium-openssl ./pegh.static.libsodium ./pegh.libsodium'
+ ./test.sh
+ '[' -e /tmp/randombytes100 ']'
++ tr -dc a-z0-9
++ head -c12
+ export key=kseni8i0elrn
+ key=kseni8i0elrn
+ echo 'key: kseni8i0elrn'
+ '[' -e /tmp/leading_zero_key ']'
+ '[' -e /tmp/leading_zero_key_a ']'
+ '[' -e /tmp/leading_zero_key_b ']'
+ rm -f pegh
key: kseni8i0elrn
+ make PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL    pegh.c  -lcrypto -o pegh
+ mv pegh pegh.openssl
+ make PEGH_LIBSODIUM=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM    pegh.c  -lsodium -o pegh
+ mv pegh pegh.libsodium
+ make PEGH_LIBSODIUM=1 PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL    pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.libsodium-openssl
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl kseni8i0elrn
+ echo a
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl kseni8i0elrn
++ echo a
++ ./pegh.static.libsodium-openssl kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo encrypting then decrypting with the same key should succeed
'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn -i /tmp/randombytes100
+ cmp + ./pegh.static.libsodium-openssl -d - /tmp/randombytes100
kseni8i0elrn-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl kseni8i0elrn
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m45.699s
user	0m37.821s
sys	0m3.547s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ echo a
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
+ ./pegh.static.libsodium-openssl -v 0 kseni8i0elrn
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 kseni8i0elrn
++ ++ ./pegh.static.libsodium-openssl -v 0 kseni8i0elrn
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
+ ./pegh.static.libsodium-openssl -e -v 0 kseni8i0elrn
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 0 kseni8i0elrn -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl + ./pegh.static.libsodium-openssl -v -d 0 kseni8i0elrn -o kseni8i0elrnbla.txt

+ cat - /dev/fd/63
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m30.434s
user	1m12.231s
sys	0m4.375s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
++ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ + ./pegh.static.libsodium-openssl -d kseni8i0elrn
./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d kseni8i0elrn-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ + ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m48.456s
user	0m36.960s
sys	0m3.460s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl

+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium-openssl kseni8i0elrn
+ ./pegh.libsodium-openssl -d kseni8i0elrn
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
./pegh.static.libsodium-openssl kseni8i0elrn
++ ++ ./pegh.static.libsodium-openssl kseni8i0elrn
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d kseni8i0elrn
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d kseni8i0elrn-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl kseni8i0elrn
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d kseni8i0elrn -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m47.341s
user	0m37.943s
sys	0m3.727s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -v 0 kseni8i0elrn
+ echo a
+ ./pegh.libsodium-openssl -d kseni8i0elrn
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 kseni8i0elrn
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d kseni8i0elrn
+ ./pegh.static.libsodium-openssl -e -v 0 kseni8i0elrn
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kseni8i0elrn-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 0 kseni8i0elrn -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 0 kseni8i0elrn
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d kseni8i0elrn -o bla.txt
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m34.201s
user	1m13.983s
sys	0m3.703s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d kseni8i0elrn
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d kseni8i0elrn-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
+ ./pegh.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m48.116s
user	0m38.393s
sys	0m3.711s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium-openssl kseni8i0elrn
+ echo a
+ ./pegh.static.libsodium -d kseni8i0elrn
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl kseni8i0elrn
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -d kseni8i0elrn
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl + cmp - /tmp/randombytes100
-e -f /tmp/leading_zero_key
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'bad decryption bytes are never output, file should be 0 bytes

+ ./pegh.static.libsodium-openssl kseni8i0elrn
+ cat + ./pegh.static.libsodium -d kseni8i0elrn -o bla.txt
+ - /dev/fd/63
echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m43.660s
user	0m37.046s
sys	0m3.697s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -v 0 kseni8i0elrn
+ ./pegh.static.libsodium -d kseni8i0elrn
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.670s
user	0m0.593s
sys	0m0.030s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -d kseni8i0elrn
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d kseni8i0elrn-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp + ./pegh.static.libsodium-openssl -e - /tmp/randombytes100
-v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo + cat - /dev/fd/63
'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -d kseni8i0elrn -o bla.txt
+ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m50.507s
user	0m38.262s
sys	0m3.871s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl kseni8i0elrn
+ ./pegh.libsodium -d kseni8i0elrn
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.static.libsodium-openssl kseni8i0elrn
++ echo a
++ echo a
./pegh.static.libsodium-openssl kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + + cmp ./pegh.static.libsodium-openssl - -e /tmp/randombytes100
kseni8i0elrn
./pegh.libsodium -d kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d kseni8i0elrn-wrongkey
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl kseni8i0elrn
+ cat - /dev/fd/63
+ + ./pegh.libsodium -d kseni8i0elrn -o bla.txt
echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m50.590s
user	0m37.578s
sys	0m3.683s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 kseni8i0elrn
+ ./pegh.libsodium -d kseni8i0elrn
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0
skipping this test because libsodium doesn't support AES on this CPU

real	0m0.732s
user	0m0.510s
sys	0m0.019s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -d kseni8i0elrn
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp + - /tmp/randombytes100
./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn -i /tmp/randombytes100
+ ./pegh.libsodium -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ + ./pegh.libsodium -d -f /tmp/leading_zero_key_bcmp 
- /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d kseni8i0elrn -o bla.txt
+ + cat - /dev/fd/63
./pegh.static.libsodium-openssl -v 1 kseni8i0elrn
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m49.511s
user	0m38.097s
sys	0m3.537s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ echo a
+ ./pegh.libsodium-openssl kseni8i0elrn
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl kseni8i0elrn
++ echo a
++ echo a
++ ./pegh.libsodium-openssl kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + ./pegh.static.libsodium-openssl -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
./pegh.libsodium-openssl -e kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo bad decryption bytes are never output, file should be 0 bytes
'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium-openssl kseni8i0elrn
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m46.876s
user	0m40.811s
sys	0m3.742s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 kseni8i0elrn
+ echo a
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 0 kseni8i0elrn
++ echo a
++ ./pegh.libsodium-openssl -v 0 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d kseni8i0elrn
+ ./pegh.libsodium-openssl -e -v 0 kseni8i0elrn
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn-wrongkey
./pegh.libsodium-openssl -e -v 0 kseni8i0elrn -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 0 kseni8i0elrn
+ + ./pegh.static.libsodium-openssl -d kseni8i0elrn -o bla.txt
cat - /dev/fd/63
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m31.647s
user	1m13.990s
sys	0m3.538s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ ++ ++ ++ echo a
echo a
./pegh.libsodium-openssl -v 1 kseni8i0elrn
./pegh.libsodium-openssl -v 1 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 kseni8i0elrn
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e -v 1 kseni8i0elrn -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 1 kseni8i0elrn
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m50.476s
user	0m37.883s
sys	0m3.664s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl -d kseni8i0elrn
+ ./pegh.libsodium-openssl kseni8i0elrn
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl kseni8i0elrn
++ ++ echo a
./pegh.libsodium-openssl kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e kseni8i0elrn
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d kseni8i0elrn
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e kseni8i0elrn -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kseni8i0elrn-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl kseni8i0elrn
+ ./pegh.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m46.652s
user	0m38.312s
sys	0m3.324s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 kseni8i0elrn
+ ./pegh.libsodium-openssl -d kseni8i0elrn
+ echo a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 0 kseni8i0elrn
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 0 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 0 kseni8i0elrn
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d kseni8i0elrn
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 kseni8i0elrn -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 0 kseni8i0elrn
+ ./pegh.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m29.374s
user	1m12.872s
sys	0m3.750s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 1 kseni8i0elrn
++ echo a
++ ./pegh.libsodium-openssl -v 1 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kseni8i0elrn
+ ./pegh.libsodium-openssl -e -v 1 kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d kseni8i0elrn-wrongkey
+ cmp - + /tmp/randombytes100
./pegh.libsodium-openssl -e -v 1 kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ ++ ./pegh.libsodium-openssl -v 1 kseni8i0elrn
+ echo -n a
echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m49.582s
user	0m36.738s
sys	0m3.638s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl kseni8i0elrn
+ echo a
+ ./pegh.static.libsodium -d kseni8i0elrn
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl kseni8i0elrn
++ echo a
++ ./pegh.libsodium-openssl kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e kseni8i0elrn
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -d kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e kseni8i0elrn -i /tmp/randombytes100
+ ./pegh.static.libsodium -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.static.libsodium -d kseni8i0elrn -o bla.txt
echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium-openssl kseni8i0elrn
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m49.689s
user	0m38.456s
sys	0m3.624s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 kseni8i0elrn
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ echo a
+ ./pegh.static.libsodium -d kseni8i0elrn
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.643s
user	0m0.511s
sys	0m0.029s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 1 kseni8i0elrn
++ ./pegh.libsodium-openssl -v 1 kseni8i0elrn
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -e -v 1 kseni8i0elrn
+ ./pegh.static.libsodium -d kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d kseni8i0elrn-wrongkey
+ ./pegh.libsodium-openssl -e -v 1 kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium-openssl + cat - /dev/fd/63
echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -d kseni8i0elrn -o bla.txt
-v 1 kseni8i0elrn
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m41.649s
user	0m35.440s
sys	0m3.404s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.libsodium
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl kseni8i0elrn
+ ./pegh.libsodium -d kseni8i0elrn
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl kseni8i0elrn
++ echo a
++ ++ ./pegh.libsodium-openssl kseni8i0elrn
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -d kseni8i0elrn
+ ./pegh.libsodium-openssl -e kseni8i0elrn
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d kseni8i0elrn-wrongkey
+ ./pegh.libsodium-openssl -e kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl kseni8i0elrn
+ ./pegh.libsodium -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m48.344s
user	0m38.866s
sys	0m3.880s
+ test ./pegh.libsodium-openssl ./pegh.libsodium -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 kseni8i0elrn
+ ./pegh.libsodium -d kseni8i0elrn
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
skipping this test because libsodium doesn't support AES on this CPU
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.820s
user	0m0.510s
sys	0m0.031s
+ test ./pegh.libsodium-openssl ./pegh.libsodium -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 1 kseni8i0elrn
++ echo a
++ ./pegh.libsodium-openssl -v 1 kseni8i0elrn
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -d kseni8i0elrn
+ ./pegh.libsodium-openssl -e -v 1 kseni8i0elrn
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 1 kseni8i0elrn -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d kseni8i0elrn-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
- /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -d kseni8i0elrn -o bla.txt
+ + ./pegh.libsodium-openssl -v 1 kseni8i0elrn
++ echo -n a
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.270s
user	0m38.687s
sys	0m3.637s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ + ./pegh.static.libsodium-openssl -d kseni8i0elrn
./pegh.static.libsodium kseni8i0elrn
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ++ ./pegh.static.libsodium kseni8i0elrn
++ echo a
echo a
++ ./pegh.static.libsodium kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e kseni8i0elrn
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn-wrongkey
+ ./pegh.static.libsodium -e kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium kseni8i0elrn
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m54.165s
user	0m41.315s
sys	0m4.031s
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ ./pegh.static.libsodium -v 0 kseni8i0elrn
+ echo a
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.033s
user	0m0.000s
sys	0m0.034s
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 kseni8i0elrn
++ ./pegh.static.libsodium -v 1 kseni8i0elrn
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e -v 1 kseni8i0elrn
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e -v 1 kseni8i0elrn -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium -v 1 kseni8i0elrn
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m44.948s
user	0m37.792s
sys	0m3.679s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium kseni8i0elrn
+ ./pegh.libsodium-openssl -d kseni8i0elrn
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo aecho 
a
++ ./pegh.static.libsodium kseni8i0elrn
++ ./pegh.static.libsodium kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e kseni8i0elrn
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d kseni8i0elrn
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e kseni8i0elrn -i /tmp/randombytes100
+ + ./pegh.libsodium-openssl -d cmp kseni8i0elrn-wrongkey
- /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ++ echo -n a
cat - /dev/fd/63
+ + ./pegh.libsodium-openssl -d kseni8i0elrn -o bla.txt./pegh.static.libsodium 
kseni8i0elrn
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m46.382s
user	0m37.190s
sys	0m3.764s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ echo a
+ + ./pegh.libsodium-openssl ./pegh.static.libsodium -v 0 kseni8i0elrn
-d kseni8i0elrn
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.072s
user	0m0.043s
sys	0m0.014s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 kseni8i0elrn
++ ++ ./pegh.static.libsodium -v 1 kseni8i0elrn
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -d kseni8i0elrn
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ + ./pegh.libsodium-openssl -d kseni8i0elrn-wrongkey
./pegh.static.libsodium -e -v 1 kseni8i0elrn -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d + -f /tmp/leading_zero_key_b
./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -v 1 kseni8i0elrn
++ echo -n a+ ./pegh.libsodium-openssl -d kseni8i0elrn -o bla.txt

decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.253s
user	0m38.229s
sys	0m3.716s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ ./pegh.static.libsodium kseni8i0elrn
+ ./pegh.static.libsodium -d kseni8i0elrn
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.static.libsodium kseni8i0elrn
++ ./pegh.static.libsodium kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e kseni8i0elrn
+ ./pegh.static.libsodium -d kseni8i0elrn
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e kseni8i0elrn -i /tmp/randombytes100
+ + ./pegh.static.libsodium -d kseni8i0elrn-wrongkey
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium kseni8i0elrn
+ ./pegh.static.libsodium -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m50.508s
user	0m37.373s
sys	0m3.409s
+ test ./pegh.static.libsodium ./pegh.static.libsodium -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium -d kseni8i0elrn
+ ./pegh.static.libsodium -v 0 kseni8i0elrn
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.028s
user	0m0.022s
sys	0m0.008s
+ test ./pegh.static.libsodium ./pegh.static.libsodium -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo encrypting same data with same key should result in different ciphertext
'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 1 kseni8i0elrn
++ echo a
++ echo a
++ ./pegh.static.libsodium -v 1 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 1 kseni8i0elrn
+ ./pegh.static.libsodium -d kseni8i0elrn
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d kseni8i0elrn -o bla.txt
+ + cat - /dev/fd/63
./pegh.static.libsodium -v 1 kseni8i0elrn
+ ++ echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m44.427s
user	0m36.602s
sys	0m3.609s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium kseni8i0elrn
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ ./pegh.libsodium -d kseni8i0elrn
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium kseni8i0elrn
++ ++ ./pegh.static.libsodium kseni8i0elrn
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e kseni8i0elrn
+ ./pegh.libsodium -d kseni8i0elrn
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e kseni8i0elrn -i /tmp/randombytes100
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d kseni8i0elrn-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium kseni8i0elrn
+ ./pegh.libsodium -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
+ ++ echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m46.704s
user	0m37.984s
sys	0m3.653s
+ test ./pegh.static.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium -d kseni8i0elrn
+ ./pegh.static.libsodium -v 0 kseni8i0elrn
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.056s
user	0m0.033s
sys	0m0.007s
+ test ./pegh.static.libsodium ./pegh.libsodium -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ '[' 1 '!=' 1 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 1 kseni8i0elrn
++ echo a
++ echo a
++ ./pegh.static.libsodium -v 1 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e + ./pegh.libsodium -d kseni8i0elrn
-v 1 kseni8i0elrn
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 kseni8i0elrn -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -v 1 kseni8i0elrn
+ cat - /dev/fd/63
+ ./pegh.libsodium -d kseni8i0elrn -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.489s
user	0m38.262s
sys	0m3.939s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' '' '!=' 1 ']'
+ echo a
+ + ./pegh.libsodium kseni8i0elrn
./pegh.static.libsodium-openssl -d kseni8i0elrn
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
encrypting same data with same key should result in different ciphertext
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium kseni8i0elrn
++ ./pegh.libsodium kseni8i0elrn
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e kseni8i0elrn
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e kseni8i0elrn -i /tmp/randombytes100
+ + ./pegh.static.libsodium-openssl -d kseni8i0elrn-wrongkey
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + echo 'hopefully this doesnt make it to disk'
+ + ./pegh.static.libsodium-openssl -d kseni8i0elrn -o bla.txt
./pegh.libsodium kseni8i0elrn
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.219s
user	0m38.405s
sys	0m3.495s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ + ./pegh.static.libsodium-openssl -d kseni8i0elrn
./pegh.libsodium -v 0 kseni8i0elrn
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.062s
user	0m0.028s
sys	0m0.013s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
++ ./pegh.libsodium -v 1 kseni8i0elrn
++ ./pegh.libsodium -v 1 kseni8i0elrn
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 1 kseni8i0elrn
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d kseni8i0elrn
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e -v 1 kseni8i0elrn -i /tmp/randombytes100
+ + cmp ./pegh.static.libsodium-openssl -d - kseni8i0elrn-wrongkey
/tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 1 kseni8i0elrn
+ ./pegh.static.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m47.999s
user	0m35.981s
sys	0m3.836s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl -d kseni8i0elrn
+ ./pegh.libsodium kseni8i0elrn
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium kseni8i0elrn
++ ./pegh.libsodium kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d kseni8i0elrn
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + ./pegh.libsodium -e kseni8i0elrn -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d kseni8i0elrn-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - + /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b+ 
./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium kseni8i0elrn
+ ./pegh.libsodium-openssl -d kseni8i0elrn -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m47.098s
user	0m37.635s
sys	0m3.767s
+ test ./pegh.libsodium ./pegh.libsodium-openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ echo a
+ ./pegh.libsodium -v 0 kseni8i0elrn
+ ./pegh.libsodium-openssl -d kseni8i0elrn
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

skipping this test because libsodium doesn't support AES on this CPU
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.096s
user	0m0.047s
sys	0m0.004s
+ test ./pegh.libsodium ./pegh.libsodium-openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 kseni8i0elrn
++ ./pegh.libsodium -v 1 kseni8i0elrn
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -d kseni8i0elrn
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 1 kseni8i0elrn
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ + cmp ./pegh.libsodium -e - -v 1 /tmp/randombytes100-f 
/tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -v 1 kseni8i0elrn
+ + echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d kseni8i0elrn -o bla.txt
++ echo -n a
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m49.320s
user	0m36.742s
sys	0m3.807s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium -d kseni8i0elrn
+ ./pegh.libsodium kseni8i0elrn
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium kseni8i0elrn
++ echo a
++ echo a
++ ./pegh.libsodium kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e kseni8i0elrn
+ ./pegh.static.libsodium -d kseni8i0elrn
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo encrypting with one key and decrypting with another should fail
'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d kseni8i0elrn-wrongkey
+ ./pegh.libsodium -e kseni8i0elrn -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d kseni8i0elrn -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium kseni8i0elrn+ cat - /dev/fd/63

++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m55.009s
user	0m40.358s
sys	0m3.707s
+ test ./pegh.libsodium ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ ./pegh.libsodium -v 0 kseni8i0elrn
+ + ./pegh.static.libsodium -d kseni8i0elrn
echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
skipping this test because libsodium doesn't support AES on this CPU
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.094s
user	0m0.041s
sys	0m0.017s
+ test ./pegh.libsodium ./pegh.static.libsodium -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'encrypting same data with same key should result in different ciphertext

+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium -v 1 kseni8i0elrn
++ ./pegh.libsodium -v 1 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 1 kseni8i0elrn
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e -v 1 kseni8i0elrn -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d kseni8i0elrn-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -d kseni8i0elrn -o bla.txt
+ + ./pegh.libsodium -v 1 kseni8i0elrn
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m53.264s
user	0m39.081s
sys	0m3.893s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.libsodium
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ + ./pegh.libsodium -d kseni8i0elrn
./pegh.libsodium kseni8i0elrn
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium kseni8i0elrn
++ echo a
++ ++ echo a
./pegh.libsodium kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d kseni8i0elrn
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e kseni8i0elrn
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e kseni8i0elrn -i /tmp/randombytes100
+ ./pegh.libsodium -d kseni8i0elrn-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e kseni8i0elrn -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ + ./pegh.libsodium -d kseni8i0elrn -o bla.txt
++ echo -n a
+ cat - /dev/fd/63
./pegh.libsodium kseni8i0elrn
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m50.135s
user	0m38.938s
sys	0m3.459s
+ test ./pegh.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ ./pegh.libsodium -v 0 kseni8i0elrn
+ echo a
+ ./pegh.libsodium -d kseni8i0elrn
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.064s
user	0m0.046s
sys	0m0.004s
+ test ./pegh.libsodium ./pegh.libsodium -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 1 kseni8i0elrn
++ echo a
++ ./pegh.libsodium -v 1 kseni8i0elrn
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 1 kseni8i0elrn
+ ./pegh.libsodium -d kseni8i0elrn
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e -v 1 kseni8i0elrn -i /tmp/randombytes100
+ cmp - + ./pegh.libsodium -d kseni8i0elrn-wrongkey
/tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ + ./pegh.libsodium -d -f /tmp/leading_zero_key_b
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 kseni8i0elrn -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kseni8i0elrn -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + + + ./pegh.libsodium -d kseni8i0elrn -o bla.txt
./pegh.libsodium -v 1 kseni8i0elrn
echo 'hopefully this doesnt make it to disk'
cat - ++ echo -n a
/dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m47.764s
user	0m37.814s
sys	0m3.713s
+ echo 'successful test run!'
successful test run!
+ echo 'successfully built and tested static pegh against libsodium and openssl!'
successfully built and tested static pegh against libsodium and openssl!
+ mkdir -p release
+ mv pegh.static.libsodium ./release/pegh-linux-aarch64-libsodium
+ '[' aarch64 '==' aarch64 ]
+ rm -f pegh.static.openssl pegh.static.libsodium-openssl
+ '[' aarch64 '==' amd64 ]
+ '[' aarch64 '==' amd64 ]
+ '[' aarch64 '==' i386 ]
+ docker_build armv7 multiarch/alpine:armv7-latest-stable .ci/build.sh
+ export ARCH=armv7
+ ARCH=armv7
+ shift
+ DOCKER_IMAGE=multiarch/alpine:armv7-latest-stable
+ shift
++ id -g
++ pwd
++ id -g
+ docker run --rm -e ARCH -e BRANCH_NAME -e BUILD_UID=971 -e BUILD_GID=971 -v /var/lib/jenkins/workspace/moparisthebest_pegh_master:/tmp -w /tmp multiarch/alpine:armv7-latest-stable sh -c 'umask a=rwx; "$@"; exit=$?; chown -R '\''971:971'\'' /tmp; exit $exit' -- .ci/build.sh
Unable to find image 'multiarch/alpine:armv7-latest-stable' locally
armv7-latest-stable: Pulling from multiarch/alpine
082e509b8e85: Pulling fs layer
082e509b8e85: Download complete
082e509b8e85: Pull complete
Digest: sha256:fe4ce876616e1fe41a686632d123569210d91df455d4f3bdf414c5a308b2f9fb
Status: Downloaded newer image for multiarch/alpine:armv7-latest-stable
+ apk add build-base clang bash libsodium-dev libsodium-static openssl-dev openssl-libs-static
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/main/armv7/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/community/armv7/APKINDEX.tar.gz
(1/38) Upgrading libcrypto1.1 (1.1.1i-r0 -> 1.1.1k-r0)
(2/38) Upgrading libssl1.1 (1.1.1i-r0 -> 1.1.1k-r0)
(3/38) Installing ncurses-terminfo-base (6.2_p20210109-r0)
(4/38) Installing ncurses-libs (6.2_p20210109-r0)
(5/38) Installing readline (8.1.0-r0)
(6/38) Installing bash (5.1.0-r0)
Executing bash-5.1.0-r0.post-install
(7/38) Installing libgcc (10.2.1_pre1-r3)
(8/38) Installing libstdc++ (10.2.1_pre1-r3)
(9/38) Installing binutils (2.35.2-r1)
(10/38) Installing libmagic (5.39-r0)
(11/38) Installing file (5.39-r0)
(12/38) Installing libgomp (10.2.1_pre1-r3)
(13/38) Installing libatomic (10.2.1_pre1-r3)
(14/38) Installing libgphobos (10.2.1_pre1-r3)
(15/38) Installing gmp (6.2.1-r0)
(16/38) Installing isl22 (0.22-r0)
(17/38) Installing mpfr4 (4.1.0-r0)
(18/38) Installing mpc1 (1.2.0-r0)
(19/38) Installing gcc (10.2.1_pre1-r3)
(20/38) Installing musl-dev (1.2.2-r0)
(21/38) Installing libc-dev (0.7.2-r3)
(22/38) Installing g++ (10.2.1_pre1-r3)
(23/38) Installing make (4.3-r0)
(24/38) Installing fortify-headers (1.1-r0)
(25/38) Installing patch (2.7.6-r6)
(26/38) Installing build-base (0.5-r2)
(27/38) Installing libffi (3.3-r2)
(28/38) Installing xz-libs (5.2.5-r0)
(29/38) Installing libxml2 (2.9.10-r6)
(30/38) Installing llvm10-libs (10.0.1-r1)
(31/38) Installing clang-libs (10.0.1-r0)
(32/38) Installing clang (10.0.1-r0)
(33/38) Installing libsodium (1.0.18-r0)
(34/38) Installing pkgconf (1.7.3-r0)
(35/38) Installing libsodium-dev (1.0.18-r0)
(36/38) Installing libsodium-static (1.0.18-r0)
(37/38) Installing openssl-dev (1.1.1k-r0)
(38/38) Installing openssl-libs-static (1.1.1k-r0)
Executing busybox-1.32.1-r2.trigger
OK: 258 MiB in 56 packages
+ make clean all 'PEGH_LIBSODIUM=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM  -static  pegh.c  -lsodium -o pegh
+ mv pegh pegh.static.libsodium
+ make clean all 'PEGH_OPENSSL=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL  -static  pegh.c  -lcrypto -o pegh
+ mv pegh pegh.static.openssl
+ make clean all 'PEGH_LIBSODIUM=1' 'PEGH_OPENSSL=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL  -static  pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl -h
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

+ ls -lah pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
-rwxrwxrwx    1 root     root      481.0K May 22 06:23 pegh.static.libsodium
-rwxrwxrwx    1 root     root        7.2M May 22 06:23 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        7.0M May 22 06:23 pegh.static.openssl
+ strip pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
+ ls -lah pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
-rwxrwxrwx    1 root     root      157.5K May 22 06:23 pegh.static.libsodium
-rwxrwxrwx    1 root     root        1.3M May 22 06:23 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        1.2M May 22 06:23 pegh.static.openssl
+ file pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
pegh.static.libsodium:         ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
pegh.static.libsodium-openssl: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
pegh.static.openssl:           ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, stripped
+ ldd pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
/lib/ld-musl-armhf.so.1: pegh.static.libsodium: Not a valid dynamic program
+ true
+ export 'TEST_BINS=./pegh.static.openssl ./pegh.openssl ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl ./pegh.static.libsodium ./pegh.libsodium'
+ '[' armv7 '==' aarch64 ]
+ ./test.sh
+ '[' -e /tmp/randombytes100 ']'
++ head -c12
++ tr -dc a-z0-9
+ export key=kwwec0xhs3u6
+ key=kwwec0xhs3u6
+ echo 'key: kwwec0xhs3u6'
key: kwwec0xhs3u6
+ '[' -e /tmp/leading_zero_key ']'
+ '[' -e /tmp/leading_zero_key_a ']'
+ '[' -e /tmp/leading_zero_key_b ']'
+ rm -f pegh
+ make PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL    pegh.c  -lcrypto -o pegh
+ mv pegh pegh.openssl
+ make PEGH_LIBSODIUM=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM    pegh.c  -lsodium -o pegh
+ mv pegh pegh.libsodium
+ make PEGH_LIBSODIUM=1 PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL    pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.libsodium-openssl
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ ./pegh.static.openssl kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ++ echo a
echo a./pegh.static.openssl 
kwwec0xhs3u6
++ ./pegh.static.openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.static.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl kwwec0xhs3u6
+ cat - /dev/fd/63
+ ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m46.229s
user	0m35.197s
sys	0m3.429s
+ test ./pegh.static.openssl ./pegh.static.openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ ./pegh.static.openssl -v 0 kwwec0xhs3u6
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl -v 0 kwwec0xhs3u6
++ echo a
++ ./pegh.static.openssl -v 0 kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100./pegh.static.openssl 
-d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 0 kwwec0xhs3u6
+ ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m32.201s
user	1m17.312s
sys	0m3.991s
+ test ./pegh.static.openssl ./pegh.static.openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.openssl -v 1 kwwec0xhs3u6
++ ./pegh.static.openssl -v 1 kwwec0xhs3u6
++ echo a
+ cmp /dev/fd/63 /dev/fd/62
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ + ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
./pegh.static.openssl + -v 1 kwwec0xhs3u6
cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m43.196s
user	0m33.016s
sys	0m3.836s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.openssl kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ++ echo a
./pegh.static.openssl kwwec0xhs3u6
++ ./pegh.static.openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e kwwec0xhs3u6
+ + cmp - /tmp/randombytes100
./pegh.openssl -d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.openssl kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m48.211s
user	0m35.714s
sys	0m3.580s
+ test ./pegh.static.openssl ./pegh.openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
+ ./pegh.static.openssl -v 0 kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ++ ./pegh.static.openssl echo -v 0 akwwec0xhs3u6

++ echo a
++ ./pegh.static.openssl -v 0 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -d + kwwec0xhs3u6-wrongkey
./pegh.static.openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ + ++ echo -n a
./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
+ cat ./pegh.static.openssl -v 0 kwwec0xhs3u6
- /dev/fd/63
decryption failed
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
encrypting same data with same key should result in different ciphertext
+ '[' -s bla.txt ']'
+ set -e

real	1m35.105s
user	1m16.675s
sys	0m3.900s
+ test ./pegh.static.openssl ./pegh.openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ++ ++ echo echo aa

./pegh.static.openssl -v 1 kwwec0xhs3u6./pegh.static.openssl 
-v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.openssl -v 1 kwwec0xhs3u6
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m45.695s
user	0m35.106s
sys	0m3.575s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ echo a
+ ./pegh.static.openssl kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
encrypting same data with same key should result in different ciphertext
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
++ ++ echo a
./pegh.static.openssl kwwec0xhs3u6
./pegh.static.openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e kwwec0xhs3u6
+ + ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ + ./pegh.static.libsodium-openssl -d ./pegh.static.openssl kwwec0xhs3u6-wrongkey-e 
kwwec0xhs3u6 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.static.libsodium-openssl ./pegh.static.openssl -d -f -e -f /tmp/leading_zero_key_b
/tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
./pegh.static.openssl kwwec0xhs3u6
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.707s
user	0m40.635s
sys	0m3.701s
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ ./pegh.static.openssl -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ echo a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ++ ./pegh.static.openssl -v 0 kwwec0xhs3u6
echo a
++ echo a
./pegh.static.openssl -v 0 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
encrypting/decrypting with key in file where last byte is different should fail
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ ++ echo -n a
+ ./pegh.static.openssl -v 0 kwwec0xhs3u6
cat - /dev/fd/63
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m28.947s
user	1m16.270s
sys	0m3.658s
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 kwwec0xhs3u6
++ ++ echo a
./pegh.static.openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + + ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ + ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
./pegh.static.openssl -v 1 kwwec0xhs3u6
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m50.015s
user	0m37.776s
sys	0m3.715s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.libsodium-openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ ./pegh.static.openssl kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl kwwec0xhs3u6
++ ./pegh.static.openssl kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt+ cat - /dev/fd/63

++ echo -n a
./pegh.static.openssl kwwec0xhs3u6
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m53.262s
user	0m39.327s
sys	0m4.052s
+ test ./pegh.static.openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.openssl -v 0 kwwec0xhs3u6
+ echo a
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.openssl -v 0 kwwec0xhs3u6
++ echo a
++ ./pegh.static.openssl -v 0 kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ + ./pegh.static.openssl -v 0 kwwec0xhs3u6
cat - /dev/fd/63
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m34.070s
user	1m17.274s
sys	0m3.745s
+ test ./pegh.static.openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
./pegh.static.openssl -v 1 kwwec0xhs3u6
++ ++ ./pegh.static.openssl -v 1 kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
./pegh.static.openssl -v 1 kwwec0xhs3u6
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m50.596s
user	0m39.533s
sys	0m3.571s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.libsodium
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
+ ./pegh.static.openssl kwwec0xhs3u6
+ echo a
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl kwwec0xhs3u6
++ ./pegh.static.openssl kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
+ + cat - /dev/fd/63
./pegh.static.openssl kwwec0xhs3u6
+ ++ echo -n a
echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m49.164s
user	0m39.440s
sys	0m3.410s
+ test ./pegh.static.openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.921s
user	0m0.696s
sys	0m0.035s
+ test ./pegh.static.openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl -v 1 kwwec0xhs3u6
++ echo a
++ ++ ./pegh.static.openssl -v 1 kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.static.libsodium ./pegh.static.openssl -d -e -f -v 1 -f /tmp/leading_zero_key/tmp/leading_zero_key

+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v + cmp 1 - /tmp/randombytes100
-f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 1 kwwec0xhs3u6
+ ./pegh.static.libsodium + cat - /dev/fd/63
-d kwwec0xhs3u6 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m50.729s
user	0m38.792s
sys	0m3.911s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.libsodium
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo ++ ++ a
++ ./pegh.static.openssl kwwec0xhs3u6
./pegh.static.openssl kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -d kwwec0xhs3u6
+ ./pegh.static.openssl -e kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
+ ++ echo -n a
+ ./pegh.static.openssl kwwec0xhs3u6
echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m51.494s
user	0m39.351s
sys	0m3.768s
+ test ./pegh.static.openssl ./pegh.libsodium -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
+ echo a
+ ./pegh.static.openssl -v 0 kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ skipping this test because libsodium doesn't support AES on this CPU
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
encrypting same data with same key should result in different ciphertext
'[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m1.012s
user	0m0.715s
sys	0m0.034s
+ test ./pegh.static.openssl ./pegh.libsodium -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 kwwec0xhs3u6
++ echo a
++ ./pegh.static.openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.libsodium -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1366788:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium -d kwwec0xhs3u6 -o bla.txt
+ + ./pegh.static.openssl cat - -v /dev/fd/631 
kwwec0xhs3u6
++ echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.501s
user	0m38.509s
sys	0m3.399s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ + ./pegh.static.openssl -d kwwec0xhs3u6
echo a
+ ./pegh.openssl kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl kwwec0xhs3u6
++ ./pegh.openssl kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + ./pegh.static.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
./pegh.openssl -e kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ + cat - /dev/fd/63
./pegh.openssl kwwec0xhs3u6
++ echo -n a
+ ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m48.925s
user	0m34.637s
sys	0m3.759s
+ test ./pegh.openssl ./pegh.static.openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ ./pegh.openssl -v 0 kwwec0xhs3u6
+ echo a
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
encrypting same data with same key should result in different ciphertext
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 0 kwwec0xhs3u6
++ echo a
++ ./pegh.openssl -v 0 kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ ./pegh.openssl -e -v 0 kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + + ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
cmp - /tmp/randombytes100
./pegh.openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 0 kwwec0xhs3u6
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m42.236s
user	1m17.790s
sys	0m3.723s
+ test ./pegh.openssl ./pegh.static.openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 1 kwwec0xhs3u6
++ echo a
++ ++ ./pegh.openssl -v 1 kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 1 kwwec0xhs3u6
+ + ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
cat ++ echo -n a
- /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m43.764s
user	0m32.580s
sys	0m3.785s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.openssl kwwec0xhs3u6
+ echo a
+ ./pegh.openssl -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl kwwec0xhs3u6
++ ++ ./pegh.openssl kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e kwwec0xhs3u6
+ + cmp - /tmp/randombytes100
./pegh.openssl -d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + cat - /dev/fd/63
+ ./pegh.openssl -d kwwec0xhs3u6 -o ++ bla.txt
+ echo ./pegh.openssl kwwec0xhs3u6
echo -n a
'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m46.983s
user	0m35.959s
sys	0m3.567s
+ test ./pegh.openssl ./pegh.openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ ./pegh.openssl -v 0 kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.openssl -v 0 kwwec0xhs3u6
echo a
++ ++ echo a
./pegh.openssl -v 0 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6
+ ./pegh.openssl -e -v 0 kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ + ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 0 kwwec0xhs3u6
+ + cat - /dev/fd/63
++ echo -n a
./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m39.918s
user	1m17.675s
sys	0m3.664s
+ test ./pegh.openssl ./pegh.openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ++ ++ ./pegh.openssl -v 1 kwwec0xhs3u6
echo a
echo a
./pegh.openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6
+ + cmp - /tmp/randombytes100
./pegh.openssl -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
./pegh.openssl -v 1 kwwec0xhs3u6
++ + echo -n a
echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m45.291s
user	0m34.063s
sys	0m3.597s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.openssl kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl kwwec0xhs3u6
++ echo a
++ ./pegh.openssl kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'encrypting then decrypting with the same key should succeed

+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl + ./pegh.openssl -e kwwec0xhs3u6
-d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ ./pegh.openssl kwwec0xhs3u6
+ cat - /dev/fd/63
+ ++ echo -n a
echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m51.945s
user	0m40.245s
sys	0m3.607s
+ test ./pegh.openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ echo a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ ++ ./pegh.openssl -v 0 kwwec0xhs3u6
./pegh.openssl -v 0 kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
./pegh.openssl -e -v 0 kwwec0xhs3u6
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ + cat - /dev/fd/63
./pegh.openssl -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m36.151s
user	1m16.780s
sys	0m3.685s
+ test ./pegh.openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ ./pegh.openssl -v 1 kwwec0xhs3u6
++ echo a
++ ./pegh.openssl -v 1 kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + ./pegh.openssl -e -v 1 kwwec0xhs3u6
./pegh.static.libsodium-openssl -d kwwec0xhs3u6+ 
cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100
./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 1 kwwec0xhs3u6
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.679s
user	0m39.030s
sys	0m3.845s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.libsodium-openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ + ./pegh.libsodium-openssl -d kwwec0xhs3u6
./pegh.openssl kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ++ ++ echo echo aa

./pegh.openssl ./pegh.openssl kwwec0xhs3u6kwwec0xhs3u6

/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e kwwec0xhs3u6
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ + ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ ./pegh.openssl kwwec0xhs3u6
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m55.034s
user	0m40.776s
sys	0m3.594s
+ test ./pegh.openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -v + ./pegh.libsodium-openssl -d kwwec0xhs3u6
0 kwwec0xhs3u6
+ echo a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ./pegh.openssl -v 0 kwwec0xhs3u6
++ ++ echo a
echo a
++ ./pegh.openssl -v 0 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ ./pegh.openssl -e -v 0 kwwec0xhs3u6
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.openssl -v 0 kwwec0xhs3u6
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m37.733s
user	1m17.915s
sys	0m3.734s
+ test ./pegh.openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 1 kwwec0xhs3u6
++ echo a
++ echo a
++ ./pegh.openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ + cmp - ./pegh.openssl /tmp/randombytes100
-e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.openssl -v 1 kwwec0xhs3u6
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.401s
user	0m39.830s
sys	0m3.529s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.libsodium
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
+ echo a
+ ./pegh.openssl kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ++ ./pegh.openssl kwwec0xhs3u6
./pegh.openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
+ + cmp - /tmp/randombytes100
./pegh.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
+ echo + cat - /dev/fd/63
'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.319s
user	0m40.003s
sys	0m3.812s
+ test ./pegh.openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -v 0 kwwec0xhs3u6
+ + ./pegh.static.libsodium -d kwwec0xhs3u6
echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m1.014s
user	0m0.731s
sys	0m0.035s
+ test ./pegh.openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ++ ./pegh.openssl -v 1 kwwec0xhs3u6
echo a
echo a
++ ./pegh.openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 1 kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
++ echo -n a
decryption failed
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m51.308s
user	0m38.090s
sys	0m3.748s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.libsodium
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.openssl kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl kwwec0xhs3u6
++ ++ echo a
./pegh.openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + ./pegh.libsodium -d kwwec0xhs3u6
cmp - /tmp/randombytes100
+ ./pegh.openssl -e kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + cat - /dev/fd/63
./pegh.openssl kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.828s
user	0m39.793s
sys	0m3.824s
+ test ./pegh.openssl ./pegh.libsodium -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ + ./pegh.libsodium -d kwwec0xhs3u6
./pegh.openssl -v 0 kwwec0xhs3u6
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.898s
user	0m0.716s
sys	0m0.055s
+ test ./pegh.openssl ./pegh.libsodium -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ ++ echo a
++ ./pegh.openssl -v 1 kwwec0xhs3u6
cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.openssl -v 1 kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -d kwwec0xhs3u6-wrongkey
+ encrypting with one key and decrypting with another should fail
./pegh.openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100+ cmp - /tmp/randombytes100

decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
1065345936:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium -d kwwec0xhs3u6 -o bla.txt
./pegh.openssl -v 1 kwwec0xhs3u6
+ + cat - /dev/fd/63
echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.342s
user	0m38.682s
sys	0m3.831s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ echo a
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl kwwec0xhs3u6
++ echo a
++ ++ ./pegh.static.libsodium-openssl kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl + cat - /dev/fd/63
-d kwwec0xhs3u6 -o bla.txt
+ ./pegh.static.libsodium-openssl kwwec0xhs3u6
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m53.080s
user	0m42.425s
sys	0m3.661s
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
+ + ./pegh.static.openssl -d kwwec0xhs3u6
echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ++ ++ echo a
./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6
./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
+ ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m32.214s
user	1m16.208s
sys	0m3.963s
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
++ ++ echo a
./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ + ./pegh.static.openssl -d kwwec0xhs3u6
cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 1 -f + /tmp/leading_zero_key
cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
+ ++ + ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
cat - /dev/fd/63
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m53.502s
user	0m42.838s
sys	0m3.800s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
+ echo a
+ ./pegh.static.libsodium-openssl kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl kwwec0xhs3u6
++ ./pegh.static.libsodium-openssl kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m54.701s
user	0m44.166s
sys	0m3.635s
+ test ./pegh.static.libsodium-openssl ./pegh.openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
+ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
++ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ + ./pegh.static.libsodium-openssl -e -v ./pegh.openssl -d kwwec0xhs3u60 
kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
+ + echo 'hopefully this doesnt make it to disk'
cat - /dev/fd/63
++ echo -n a
+ ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
encrypting same data with same key should result in different ciphertext

real	1m30.740s
user	1m17.206s
sys	0m3.653s
+ test ./pegh.static.libsodium-openssl ./pegh.openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ++ ./pegh.static.libsodium-openssl echo -v 1 akwwec0xhs3u6

echo a
++ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ + cmp - /tmp/randombytes100
./pegh.openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
+ cat - /dev/fd/63
+ ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m50.313s
user	0m40.920s
sys	0m3.646s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl kwwec0xhs3u6
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl kwwec0xhs3u6
++ echo a
++ ++ echo ./pegh.static.libsodium-openssl a
kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -e kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ + ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
./pegh.static.libsodium-openssl -e + cmp - /tmp/randombytes100
-f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl kwwec0xhs3u6
+ ++ echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m59.819s
user	0m48.247s
sys	0m3.616s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ echo a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
++ ++ echo a
./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d kwwec0xhs3u6
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ + ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ + ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ ++ echo -n a
cat - /dev/fd/63
./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m32.995s
user	1m18.032s
sys	0m4.375s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ ++ ++ ++ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
./pegh.static.libsodium-openssl -v echo 1 akwwec0xhs3u6

echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e -v + cmp - /tmp/randombytes100
1 kwwec0xhs3u6 -i + ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
/tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
+ cat - /dev/fd/63
+ + ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m59.513s
user	0m47.583s
sys	0m3.726s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ + ./pegh.libsodium-openssl -d kwwec0xhs3u6
./pegh.static.libsodium-openssl kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl kwwec0xhs3u6
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
./pegh.static.libsodium-openssl kwwec0xhs3u6
++ + echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m2.992s
user	0m47.048s
sys	0m3.900s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
++ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
+ ++ echo 'hopefully this doesnt make it to disk'
echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m31.362s
user	1m17.193s
sys	0m3.936s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
++ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ echo encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ + + ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
++ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
cat - /dev/fd/63
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m56.515s
user	0m46.027s
sys	0m3.582s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
++ ./pegh.static.libsodium-openssl kwwec0xhs3u6
++ echo a
./pegh.static.libsodium-openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl kwwec0xhs3u6
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m58.883s
user	0m47.837s
sys	0m3.584s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0
skipping this test because libsodium doesn't support AES on this CPU

real	0m0.915s
user	0m0.689s
sys	0m0.012s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ + cmp - ./pegh.static.libsodium /tmp/randombytes100
-d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +eencrypting with one key and decrypting with another should fail

+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
+ + ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m57.116s
user	0m46.516s
sys	0m3.552s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium -d kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl kwwec0xhs3u6
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl kwwec0xhs3u6
++ ./pegh.static.libsodium-openssl kwwec0xhs3u6
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.libsodium -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m55.513s
user	0m46.651s
sys	0m3.716s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
skipping this test because libsodium doesn't support AES on this CPU
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.853s
user	0m0.693s
sys	0m0.023s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d kwwec0xhs3u6-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium -d kwwec0xhs3u6 -o bla.txt
./pegh.static.libsodium-openssl -v 1 kwwec0xhs3u6
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m58.289s
user	0m46.022s
sys	0m3.659s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl kwwec0xhs3u6
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ++ echo a
./pegh.libsodium-openssl kwwec0xhs3u6
++ ./pegh.libsodium-openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key+ cmp - /tmp/randombytes100

+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl kwwec0xhs3u6
+ + + ./pegh.static.openssl -d kwwec0xhs3u6 -o cat bla.txt- 
/dev/fd/63
echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m54.549s
user	0m43.431s
sys	0m3.930s
+ test ./pegh.libsodium-openssl ./pegh.static.openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.static.openssl -d -f /tmp/leading_zero_key
cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
+ cat - + ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
++ /dev/fd/63
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m36.549s
user	1m18.194s
sys	0m4.112s
+ test ./pegh.libsodium-openssl ./pegh.static.openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ++ ./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
echo a
++ echo a
./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ + ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ + ./pegh.static.openssl ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o -v bla.txt1 
kwwec0xhs3u6
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m53.432s
user	0m41.004s
sys	0m4.031s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ ./pegh.libsodium-openssl kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ ./pegh.libsodium-openssl kwwec0xhs3u6
++ echo a
./pegh.libsodium-openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -d kwwec0xhs3u6
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -e kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100
./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
+ encrypting with one key and decrypting with another should fail
./pegh.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl kwwec0xhs3u6
+ + ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m56.158s
user	0m43.813s
sys	0m3.834s
+ test ./pegh.libsodium-openssl ./pegh.openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ + ./pegh.openssl -d kwwec0xhs3u6
+ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ++ ++ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
echo a
echo a
./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp - /tmp/randombytes100
./pegh.openssl -d kwwec0xhs3u6
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6 -i + /tmp/randombytes100
./pegh.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
+ + ++ echo -n a
cat - /dev/fd/63
./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m42.451s
user	1m17.867s
sys	0m4.030s
+ test ./pegh.libsodium-openssl ./pegh.openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
++ ++ echo a
./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ + ./pegh.libsodium-openssl cmp - /tmp/randombytes100
-e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
+ + ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
cat + echo 'hopefully this doesnt make it to disk'
- /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m58.100s
user	0m41.823s
sys	0m3.581s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ + echo a
./pegh.static.libsodium-openssl -d + kwwec0xhs3u6./pegh.libsodium-openssl kwwec0xhs3u6

+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.libsodium-openssl kwwec0xhs3u6
++ ./pegh.libsodium-openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
cmp + - /tmp/randombytes100
./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ + ./pegh.libsodium-openssl kwwec0xhs3u6
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m59.396s
user	0m47.878s
sys	0m3.850s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ + ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
+ echo a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
echo a
++ ++ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
+ + ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ ++ echo -n a
cat - /dev/fd/63
echo 'hopefully this doesnt make it to disk'
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m36.068s
user	1m16.727s
sys	0m4.093s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
++ ++ echo a
./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 1 + kwwec0xhs3u6
echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m0.511s
user	0m48.250s
sys	0m3.816s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ echo a
+ ./pegh.libsodium-openssl kwwec0xhs3u6
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.libsodium-openssl kwwec0xhs3u6
echo a
++ ++ ./pegh.libsodium-openssl kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.libsodium-openssl cmp -d - -f /tmp/randombytes100/tmp/leading_zero_key

+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl kwwec0xhs3u6
+ + echo + cat - /dev/fd/63
++ echo -n a
'hopefully this doesnt make it to disk'./pegh.libsodium-openssl 
-d kwwec0xhs3u6 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m2.708s
user	0m49.271s
sys	0m3.949s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
+ echo a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
++ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
++ echo a
./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6 -i /tmp/randombytes100
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
echo 'hopefully this doesnt make it to disk'+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt

+ cat - /dev/fd/63
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m33.715s
user	1m19.424s
sys	0m3.626s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ + ++ echo -n a
cat - /dev/fd/63
./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m54.824s
user	0m48.079s
sys	0m3.773s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium-openssl kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl kwwec0xhs3u6
++ echo a
++ ./pegh.libsodium-openssl ++ echo kwwec0xhs3u6
a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100+ 
./pegh.static.libsodium -d kwwec0xhs3u6
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -i + /tmp/randombytes100./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey

decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m55.024s
user	0m48.811s
sys	0m3.872s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
skipping this test because libsodium doesn't support AES on this CPU
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.711s
user	0m0.688s
sys	0m0.025s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6+ cmp - /tmp/randombytes100

+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
+ ++ echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m56.112s
user	0m49.054s
sys	0m3.546s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.libsodium
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ++ echo a
./pegh.libsodium-openssl kwwec0xhs3u6
++ echo a
++ ./pegh.libsodium-openssl kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d kwwec0xhs3u6-wrongkey
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -d -f + ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
/tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -d kwwec0xhs3u6 -o bla.txt
+ + cat - /dev/fd/63
./pegh.libsodium-openssl kwwec0xhs3u6
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m56.215s
user	0m49.792s
sys	0m3.774s
+ test ./pegh.libsodium-openssl ./pegh.libsodium -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium -d kwwec0xhs3u6
+ echo a
+ ./pegh.libsodium-openssl -v 0 kwwec0xhs3u6
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.878s
user	0m0.734s
sys	0m0.033s
+ test ./pegh.libsodium-openssl ./pegh.libsodium -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
echo a
++ ++ echo a
./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.libsodium -d kwwec0xhs3u6-wrongkey
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d + -f cmp - /tmp/randombytes100
/tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ++ echo -n a
./pegh.libsodium-openssl -v 1 kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6 -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.705s
user	0m47.356s
sys	0m3.621s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium kwwec0xhs3u6
+ echo a
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.static.libsodium kwwec0xhs3u6
++ echo a
++ ./pegh.static.libsodium kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -d + -f ./pegh.static.libsodium -e -f /tmp/leading_zero_key
/tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
./pegh.static.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
cat - /dev/fd/63
+ ./pegh.static.libsodium kwwec0xhs3u6
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m48.652s
user	0m42.333s
sys	0m3.538s
+ test ./pegh.static.libsodium ./pegh.static.openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium -v 0 kwwec0xhs3u6
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0
skipping this test because libsodium doesn't support AES on this CPU

real	0m0.050s
user	0m0.030s
sys	0m0.002s
+ test ./pegh.static.libsodium ./pegh.static.openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
++ echo a
++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -e + -v ./pegh.static.openssl 1 kwwec0xhs3u6-d 
kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
++ echo -n a+ ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt

+ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m47.953s
user	0m41.831s
sys	0m3.716s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.libsodium kwwec0xhs3u6
++ ./pegh.static.libsodium kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp + + - /tmp/randombytes100
./pegh.openssl ./pegh.static.libsodium -d -e -f -f /tmp/leading_zero_key/tmp/leading_zero_key

+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
+ + ./pegh.openssl -d cmp - kwwec0xhs3u6-wrongkey
/tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m47.879s
user	0m42.541s
sys	0m3.758s
+ test ./pegh.static.libsodium ./pegh.openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
+ echo a
+ ./pegh.static.libsodium -v 0 kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
skipping this test because libsodium doesn't support AES on this CPU
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
encrypting same data with same key should result in different ciphertext
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.036s
user	0m0.029s
sys	0m0.015s
+ test ./pegh.static.libsodium ./pegh.openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
++ ++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6
+ ./pegh.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key+ cmp 
- /tmp/randombytes100
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
+ cat - /dev/fd/63
+ ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m48.232s
user	0m40.164s
sys	0m3.673s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
./pegh.static.libsodium kwwec0xhs3u6
++ ./pegh.static.libsodium kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e kwwec0xhs3u6
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ + ./pegh.static.libsodium ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
-e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium + cmp - /tmp/randombytes100-e -f /tmp/leading_zero_key_a

decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m56.296s
user	0m46.164s
sys	0m4.264s
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium -v 0 kwwec0xhs3u6
+ echo a+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6

Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.054s
user	0m0.018s
sys	0m0.018s
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
skipping this test because libsodium doesn't support AES on this CPU
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
++ ++ echo a
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m54.478s
user	0m47.213s
sys	0m3.783s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ echo a
+ ./pegh.static.libsodium kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium kwwec0xhs3u6
++ ++ echo a
./pegh.static.libsodium kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e kwwec0xhs3u6
+ + cmp ./pegh.libsodium-openssl -d kwwec0xhs3u6- 
/tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium kwwec0xhs3u6
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.631s
user	0m46.803s
sys	0m3.260s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6
+ ./pegh.static.libsodium -v 0 kwwec0xhs3u6
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0
skipping this test because libsodium doesn't support AES on this CPU

real	0m0.046s
user	0m0.038s
sys	0m0.009s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
++ echo a
++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium + -e -v 1 kwwec0xhs3u6
./pegh.libsodium-openssl -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
./pegh.static.libsodium -e + cmp - /tmp/randombytes100
-v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ + ./pegh.libsodium-openssl ./pegh.static.libsodium -d -e -v kwwec0xhs3u6-wrongkey1 
kwwec0xhs3u6 -i /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m53.159s
user	0m46.928s
sys	0m3.705s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium kwwec0xhs3u6
+ + ./pegh.static.libsodium -d kwwec0xhs3u6
echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ ./pegh.static.libsodium kwwec0xhs3u6
++ echo a
./pegh.static.libsodium kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ + + ./pegh.static.libsodium cmp -d kwwec0xhs3u6- 
/tmp/randombytes100
./pegh.static.libsodium -e kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + ./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium kwwec0xhs3u6
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium

real	0m53.834s
user	0m47.979s
sys	0m3.595s
+ test ./pegh.static.libsodium ./pegh.static.libsodium -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ ./pegh.static.libsodium -v 0 kwwec0xhs3u6
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ skipping this test because libsodium doesn't support AES on this CPU
return 0

real	0m0.030s
user	0m0.035s
sys	0m0.000s
+ test ./pegh.static.libsodium ./pegh.static.libsodium -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ + ./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b+ 
cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.525s
user	0m46.444s
sys	0m4.071s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ + ./pegh.libsodium -d kwwec0xhs3u6
./pegh.static.libsodium kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
++ ./pegh.static.libsodium kwwec0xhs3u6
./pegh.static.libsodium kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -d kwwec0xhs3u6
+ ./pegh.static.libsodium -e + cmp - /tmp/randombytes100
kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
+ + ./pegh.libsodium -d kwwec0xhs3u6-wrongkey
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium + -d kwwec0xhs3u6 -o bla.txt
+ cat ./pegh.static.libsodium kwwec0xhs3u6
- /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m53.819s
user	0m47.050s
sys	0m3.814s
+ test ./pegh.static.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ + ./pegh.libsodium -d kwwec0xhs3u6
./pegh.static.libsodium -v 0 kwwec0xhs3u6
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.052s
user	0m0.036s
sys	0m0.009s
+ test ./pegh.static.libsodium ./pegh.libsodium -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
skipping this test because libsodium doesn't support AES on this CPU
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ echo ./pegh.static.libsodium -v 1 kwwec0xhs3u6
++ ./pegh.static.libsodium -v 1 kwwec0xhs3u6
a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp - /tmp/randombytes100
+ ./pegh.libsodium -d kwwec0xhs3u6./pegh.static.libsodium 
-e -v 1 kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d kwwec0xhs3u6-wrongkey
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -v 1 + kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.087s
user	0m45.878s
sys	0m3.858s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ + ./pegh.libsodium kwwec0xhs3u6
echo a
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
++ ++ echo a
./pegh.libsodium kwwec0xhs3u6./pegh.libsodium 
kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e kwwec0xhs3u6
+ + ./pegh.static.openssl -d kwwec0xhs3u6
cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ + ./pegh.libsodium -e -f cmp /tmp/leading_zero_key- /tmp/randombytes100

+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ + ./pegh.static.openssl ./pegh.libsodium -d -e kwwec0xhs3u6-wrongkeykwwec0xhs3u6 
-i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ + cmp - /tmp/randombytes100
./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ + ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
cat - /dev/fd/63
+ ./pegh.libsodium kwwec0xhs3u6
+ ++ echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m48.561s
user	0m41.865s
sys	0m3.844s
+ test ./pegh.libsodium ./pegh.static.openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ + ./pegh.static.openssl -d kwwec0xhs3u6
./pegh.libsodium -v 0 kwwec0xhs3u6
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.065s
user	0m0.021s
sys	0m0.021s
+ test ./pegh.libsodium ./pegh.static.openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 kwwec0xhs3u6
++ echo a
++ ./pegh.libsodium -v 1 kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6
+ ./pegh.static.openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d kwwec0xhs3u6-wrongkey
+ + cmp - /tmp/randombytes100
./pegh.libsodium -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -e -v 1 -f + /tmp/leading_zero_key_a
./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium + cat - /dev/fd/63
-v 1 kwwec0xhs3u6
+ ./pegh.static.openssl -d kwwec0xhs3u6 -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m47.716s
user	0m40.663s
sys	0m3.900s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.openssl -d kwwec0xhs3u6
+ ./pegh.libsodium kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium kwwec0xhs3u6
++ ./pegh.libsodium kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
./pegh.libsodium kwwec0xhs3u6
+ ++ echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m49.451s
user	0m43.242s
sys	0m3.692s
+ test ./pegh.libsodium ./pegh.openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ '[' 0 '!=' 1 ']'
+ + ./pegh.openssl -d kwwec0xhs3u6
./pegh.libsodium -v 0 kwwec0xhs3u6
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.060s
user	0m0.030s
sys	0m0.025s
+ test ./pegh.libsodium ./pegh.openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a++ ./pegh.libsodium 
++ -v 1 kwwec0xhs3u6
./pegh.libsodium -v 1 kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d kwwec0xhs3u6
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -d + kwwec0xhs3u6-wrongkeycmp 
+ - ./pegh.libsodium -e /tmp/randombytes100-v 
1 kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + cat + ./pegh.openssl -d kwwec0xhs3u6 -o bla.txt
- /dev/fd/63
./pegh.libsodium -v 1 kwwec0xhs3u6
+ ++ echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m45.655s
user	0m40.088s
sys	0m3.505s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ + ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
./pegh.libsodium kwwec0xhs3u6
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium kwwec0xhs3u6
++ echo a
++ echo a
++ ./pegh.libsodium kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ + cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
./pegh.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + cat - /dev/fd/63
./pegh.libsodium kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ ++ echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m54.490s
user	0m47.756s
sys	0m3.801s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.033s
user	0m0.037s
sys	0m0.002s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 kwwec0xhs3u6
skipping this test because libsodium doesn't support AES on this CPU
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.libsodium -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 1 kwwec0xhs3u6
+ ./pegh.static.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m51.148s
user	0m45.391s
sys	0m3.452s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium kwwec0xhs3u6
+ + echo a
./pegh.libsodium-openssl -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium kwwec0xhs3u6
++ echo a
++ ./pegh.libsodium kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e kwwec0xhs3u6
+ + ./pegh.libsodium-openssl -d kwwec0xhs3u6
cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
+ + ./pegh.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium kwwec0xhs3u6
+ + ./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m53.859s
user	0m46.854s
sys	0m3.709s
+ test ./pegh.libsodium ./pegh.libsodium-openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ + ./pegh.libsodium-openssl -d kwwec0xhs3u6
./pegh.libsodium -v 0 kwwec0xhs3u6
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
skipping this test because libsodium doesn't support AES on this CPU
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.048s
user	0m0.041s
sys	0m0.013s
+ test ./pegh.libsodium ./pegh.libsodium-openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 kwwec0xhs3u6
++ echo a
++ echo a
++ ./pegh.libsodium -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v + ./pegh.libsodium-openssl -d kwwec0xhs3u6
1 kwwec0xhs3u6
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + echo 'hopefully this doesnt make it to disk'
./pegh.libsodium-openssl -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium -v 1 kwwec0xhs3u6
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.402s
user	0m45.504s
sys	0m3.695s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ echo a
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ ./pegh.libsodium kwwec0xhs3u6
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium kwwec0xhs3u6
++ ./pegh.libsodium kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ ./pegh.libsodium -e kwwec0xhs3u6
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
+ ./pegh.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium kwwec0xhs3u6
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m54.922s
user	0m46.619s
sys	0m4.088s
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ test ./pegh.libsodium ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -v 0 kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.031s
user	0m0.030s
sys	0m0.014s
+ test ./pegh.libsodium ./pegh.static.libsodium -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 1 kwwec0xhs3u6
++ ./pegh.libsodium -v 1 kwwec0xhs3u6
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6
+ ./pegh.static.libsodium -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -d kwwec0xhs3u6-wrongkey
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6 -i + cmp - /tmp/randombytes100
/tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d kwwec0xhs3u6 -o bla.txt
+ ./pegh.libsodium -v 1 kwwec0xhs3u6
++ + echo 'hopefully this doesnt make it to disk'
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m55.318s
user	0m46.054s
sys	0m3.732s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.libsodium
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium kwwec0xhs3u6
+ echo a
+ ./pegh.libsodium -d kwwec0xhs3u6
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium kwwec0xhs3u6
++ echo a
++ ./pegh.libsodium kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e kwwec0xhs3u6 -i /tmp/randombytes100
+ ./pegh.libsodium -d kwwec0xhs3u6-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6 -o bla.txt+ cat - /dev/fd/63

++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m55.898s
user	0m46.855s
sys	0m3.954s
+ test ./pegh.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -v 0 kwwec0xhs3u6
+ ./pegh.libsodium -d kwwec0xhs3u6
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 4095 (AES-256-GCM) or 4095 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
skipping this test because libsodium doesn't support AES on this CPU
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.073s
user	0m0.052s
sys	0m0.002s
+ test ./pegh.libsodium ./pegh.libsodium -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 1 kwwec0xhs3u6
++ echo a
++ ./pegh.libsodium -v 1 kwwec0xhs3u6
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -d kwwec0xhs3u6
+ + ./pegh.libsodium cmp -e -v - /tmp/randombytes1001 kwwec0xhs3u6

+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ + cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 ./pegh.libsodium kwwec0xhs3u6 -d -i kwwec0xhs3u6-wrongkey/tmp/randombytes100

decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d kwwec0xhs3u6 -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -d + kwwec0xhs3u6 -o bla.txt
cat - + ./pegh.libsodium -v 1 kwwec0xhs3u6
/dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m52.183s
user	0m46.607s
sys	0m3.315s
+ echo 'successful test run!'
successful test run!
+ echo 'successfully built and tested static pegh against libsodium and openssl!'
successfully built and tested static pegh against libsodium and openssl!
+ mkdir -p release
+ mv pegh.static.libsodium ./release/pegh-linux-armv7-libsodium
+ '[' armv7 '==' aarch64 ]
+ mv pegh.static.openssl ./release/pegh-linux-armv7-openssl
+ mv pegh.static.libsodium-openssl ./release/pegh-linux-armv7-libsodium-openssl
+ '[' armv7 '==' amd64 ]
+ '[' armv7 '==' amd64 ]
+ '[' armv7 '==' i386 ]
+ docker_build ppc64le multiarch/alpine:ppc64le-latest-stable .ci/build.sh
+ export ARCH=ppc64le
+ ARCH=ppc64le
+ shift
+ DOCKER_IMAGE=multiarch/alpine:ppc64le-latest-stable
+ shift
++ id -g
++ pwd
++ id -g
+ docker run --rm -e ARCH -e BRANCH_NAME -e BUILD_UID=971 -e BUILD_GID=971 -v /var/lib/jenkins/workspace/moparisthebest_pegh_master:/tmp -w /tmp multiarch/alpine:ppc64le-latest-stable sh -c 'umask a=rwx; "$@"; exit=$?; chown -R '\''971:971'\'' /tmp; exit $exit' -- .ci/build.sh
+ apk add build-base clang bash libsodium-dev libsodium-static openssl-dev openssl-libs-static
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/main/ppc64le/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ppc64le/APKINDEX.tar.gz
(1/37) Upgrading libcrypto1.1 (1.1.1i-r0 -> 1.1.1k-r0)
(2/37) Upgrading libssl1.1 (1.1.1i-r0 -> 1.1.1k-r0)
(3/37) Installing ncurses-terminfo-base (6.2_p20210109-r0)
(4/37) Installing ncurses-libs (6.2_p20210109-r0)
(5/37) Installing readline (8.1.0-r0)
(6/37) Installing bash (5.1.0-r0)
Executing bash-5.1.0-r0.post-install
(7/37) Installing libgcc (10.2.1_pre1-r3)
(8/37) Installing libstdc++ (10.2.1_pre1-r3)
(9/37) Installing binutils (2.35.2-r1)
(10/37) Installing libmagic (5.39-r0)
(11/37) Installing file (5.39-r0)
(12/37) Installing libgomp (10.2.1_pre1-r3)
(13/37) Installing libatomic (10.2.1_pre1-r3)
(14/37) Installing gmp (6.2.1-r0)
(15/37) Installing isl22 (0.22-r0)
(16/37) Installing mpfr4 (4.1.0-r0)
(17/37) Installing mpc1 (1.2.0-r0)
(18/37) Installing gcc (10.2.1_pre1-r3)
(19/37) Installing musl-dev (1.2.2-r0)
(20/37) Installing libc-dev (0.7.2-r3)
(21/37) Installing g++ (10.2.1_pre1-r3)
(22/37) Installing make (4.3-r0)
(23/37) Installing fortify-headers (1.1-r0)
(24/37) Installing patch (2.7.6-r6)
(25/37) Installing build-base (0.5-r2)
(26/37) Installing libffi (3.3-r2)
(27/37) Installing xz-libs (5.2.5-r0)
(28/37) Installing libxml2 (2.9.10-r6)
(29/37) Installing llvm10-libs (10.0.1-r1)
(30/37) Installing clang-libs (10.0.1-r0)
(31/37) Installing clang (10.0.1-r0)
(32/37) Installing libsodium (1.0.18-r0)
(33/37) Installing pkgconf (1.7.3-r0)
(34/37) Installing libsodium-dev (1.0.18-r0)
(35/37) Installing libsodium-static (1.0.18-r0)
(36/37) Installing openssl-dev (1.1.1k-r0)
(37/37) Installing openssl-libs-static (1.1.1k-r0)
Executing busybox-1.32.1-r2.trigger
OK: 383 MiB in 55 packages
+ make clean all 'PEGH_LIBSODIUM=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM  -static  pegh.c  -lsodium -o pegh
+ mv pegh pegh.static.libsodium
+ make clean all 'PEGH_OPENSSL=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL  -static  pegh.c  -lcrypto -o pegh
+ mv pegh pegh.static.openssl
+ make clean all 'PEGH_LIBSODIUM=1' 'PEGH_OPENSSL=1' 'CC=clang' 'LDFLAGS=-static'
rm -f pegh
clang -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL  -static  pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.static.libsodium-openssl
+ ./pegh.static.libsodium-openssl -h
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

+ ls -lah pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
-rwxrwxrwx    1 root     root      560.7K May 22 07:53 pegh.static.libsodium
-rwxrwxrwx    1 root     root        8.6M May 22 07:54 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        8.4M May 22 07:53 pegh.static.openssl
+ strip pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
+ ls -lah pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
-rwxrwxrwx    1 root     root      194.2K May 22 07:54 pegh.static.libsodium
-rwxrwxrwx    1 root     root        2.1M May 22 07:54 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        1.9M May 22 07:54 pegh.static.openssl
+ file pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
pegh.static.libsodium:         ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
pegh.static.libsodium-openssl: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
pegh.static.openssl:           ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, stripped
+ ldd pegh.static.libsodium pegh.static.libsodium-openssl pegh.static.openssl
/lib/ld-musl-powerpc64le.so.1: pegh.static.libsodium: Not a valid dynamic program
+ true
+ export 'TEST_BINS=./pegh.static.openssl ./pegh.openssl ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl ./pegh.static.libsodium ./pegh.libsodium'
+ '[' ppc64le '==' aarch64 ]
+ ./test.sh
+ '[' -e /tmp/randombytes100 ']'
++ tr -dc a-z0-9
++ head -c12
+ export key=6gjuvi5vjcho
+ key=6gjuvi5vjcho
+ echo 'key: 6gjuvi5vjcho'
key: 6gjuvi5vjcho
+ '[' -e /tmp/leading_zero_key ']'
+ '[' -e /tmp/leading_zero_key_a ']'
+ '[' -e /tmp/leading_zero_key_b ']'
+ rm -f pegh
+ make PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_OPENSSL    pegh.c  -lcrypto -o pegh
+ mv pegh pegh.openssl
+ make PEGH_LIBSODIUM=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM    pegh.c  -lsodium -o pegh
+ mv pegh pegh.libsodium
+ make PEGH_LIBSODIUM=1 PEGH_OPENSSL=1
cc -Wall -Wextra -Werror -std=c89 -pedantic -Wstrict-prototypes -Wold-style-definition -Wconversion -Wno-missing-prototypes -Wno-missing-noreturn -Wno-format -O3 -D_POSIX_SOURCE -DPEGH_LIBSODIUM -DPEGH_OPENSSL    pegh.c  -lsodium -lcrypto -o pegh
+ mv pegh pegh.libsodium-openssl
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ + ./pegh.static.openssl 6gjuvi5vjcho
echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl 6gjuvi5vjcho
++ echo a
++ ./pegh.static.openssl 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - + ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
/tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ + ./pegh.static.openssl 6gjuvi5vjcho
echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m51.065s
user	1m43.821s
sys	0m3.659s
+ test ./pegh.static.openssl ./pegh.static.openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 0 6gjuvi5vjcho
++ ./pegh.static.openssl -v 0 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 0 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.312s
user	1m43.269s
sys	0m3.443s
+ test ./pegh.static.openssl ./pegh.static.openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + echo ./pegh.static.openssl 'hopefully this doesnt make it to disk'
-v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.891s
user	0m22.836s
sys	0m3.142s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
+ ./pegh.static.openssl 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo encrypting same data with same key should result in different ciphertext
'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.openssl 6gjuvi5vjcho
++ ./pegh.static.openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e 6gjuvi5vjcho
+ + cmp - /tmp/randombytes100
./pegh.openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.openssl -d -f /tmp/leading_zero_key
cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ + ./pegh.static.openssl 6gjuvi5vjcho
+ cat - /dev/fd/63
./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m46.159s
user	1m44.818s
sys	0m3.404s
+ test ./pegh.static.openssl ./pegh.openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
encrypting same data with same key should result in different ciphertext
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 0 6gjuvi5vjcho
++ ++ ./pegh.static.openssl -v 0 6gjuvi5vjcho
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.openssl -d cmp -f - /tmp/leading_zero_key/tmp/randombytes100

+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl + ./pegh.openssl -d -f /tmp/leading_zero_key_b
-e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 0 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m47.597s
user	1m46.219s
sys	0m3.440s
+ test ./pegh.static.openssl ./pegh.openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - + ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
/tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f + /tmp/leading_zero_key_b
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.375s
user	0m22.181s
sys	0m3.522s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl 6gjuvi5vjcho
++ echo a
++ ./pegh.static.openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d + -f /tmp/leading_zero_key
./pegh.static.openssl -e -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl + -d -f /tmp/leading_zero_key_b
./pegh.static.openssl -e -f /tmp/leading_zero_key_a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.static.openssl 6gjuvi5vjcho
echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m47.631s
user	1m45.497s
sys	0m3.351s
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ echo a
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.static.openssl -v 0 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.static.openssl -v 0 6gjuvi5vjcho
++ ./pegh.static.openssl -v 0 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e + ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
-v 0 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl + cmp - -d -f /tmp/randombytes100
/tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e + -v 0 -f ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
/tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.static.openssl -v 0 6gjuvi5vjcho
echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m46.908s
user	1m44.829s
sys	0m3.645s
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ echo a
./pegh.static.openssl -v 1 6gjuvi5vjcho
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ + cmp - ./pegh.static.libsodium-openssl /tmp/randombytes100-d 6gjuvi5vjcho-wrongkey

decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.438s
user	0m21.438s
sys	0m3.038s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.libsodium-openssl
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ echo a
+ ./pegh.static.openssl 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ echo a
++ ./pegh.static.openssl 6gjuvi5vjcho
++ ./pegh.static.openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -f + /tmp/leading_zero_key_a
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.325s
user	1m43.736s
sys	0m3.395s
+ test ./pegh.static.openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.openssl -v 0 6gjuvi5vjcho
++ echo a
++ ./pegh.static.openssl -v 0 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -v 0 6gjuvi5vjcho
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m44.140s
user	1m42.924s
sys	0m3.393s
+ test ./pegh.static.openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -i + /tmp/randombytes100./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey

+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 1 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.970s
user	0m22.128s
sys	0m3.144s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.static.libsodium
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.openssl 6gjuvi5vjcho
+ echo a
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
skipping this test because libsodium doesn't support AES on this CPU
+ '[' 141 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.518s
user	0m0.463s
sys	0m0.077s
+ test ./pegh.static.openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ + echo ./pegh.static.openssl -v 0 6gjuvi5vjcho
a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
skipping this test because libsodium doesn't support AES on this CPU
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium
encrypting same data with same key should result in different ciphertext
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.489s
user	0m0.500s
sys	0m0.011s
+ test ./pegh.static.openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + ./pegh.static.openssl -e -v 1 6gjuvi5vjcho
./pegh.static.libsodium -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -i + ./pegh.static.libsodium -d 6gjuvi5vjcho-wrongkey
/tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e -v 1 -f + ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
/tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -o bla.txt
+ ./pegh.static.openssl -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.432s
user	0m21.482s
sys	0m3.208s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.libsodium
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
'' '!=' 1 ']'
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ ./pegh.static.openssl 6gjuvi5vjcho
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0
skipping this test because libsodium doesn't support AES on this CPU

real	0m0.458s
user	0m0.438s
sys	0m0.048s
+ test ./pegh.static.openssl ./pegh.libsodium -v 0
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 6gjuvi5vjcho
+ ./pegh.libsodium -d 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 141 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.429s
user	0m0.448s
sys	0m0.005s
+ test ./pegh.static.openssl ./pegh.libsodium -v 1
skipping this test because libsodium doesn't support AES on this CPU
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
++ ./pegh.static.openssl -v 1 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp + - /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho
./pegh.static.openssl -e -v 1 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho-wrongkey
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -e -v 1 -f /tmp/leading_zero_key_a+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b

+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
270562776:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -v 1 6gjuvi5vjcho
+ ./pegh.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m22.512s
user	0m21.726s
sys	0m3.049s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.openssl 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl 6gjuvi5vjcho
++ echo a
++ ./pegh.openssl 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
+ ./pegh.openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl 6gjuvi5vjcho
+ + cat - /dev/fd/63
./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.823s
user	1m44.532s
sys	0m3.296s
+ test ./pegh.openssl ./pegh.static.openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -v 0 6gjuvi5vjcho
+ echo a
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 0 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.openssl -v 0 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 0 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 0 + -f /tmp/leading_zero_key_a./pegh.static.openssl -d -f /tmp/leading_zero_key_b

+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
+ ./pegh.openssl -v 0 6gjuvi5vjcho
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m44.883s
user	1m43.721s
sys	0m3.213s
+ test ./pegh.openssl ./pegh.static.openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl -v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e + -v 1 cmp - /tmp/randombytes100
6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100+ cmp 
- /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 1 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
+ echo 'hopefully this doesnt make it to disk'+ cat - /dev/fd/63

++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.297s
user	0m20.982s
sys	0m3.443s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ + ./pegh.openssl 6gjuvi5vjchoecho 
a
+ ./pegh.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl 6gjuvi5vjcho
++ ./pegh.openssl 6gjuvi5vjcho
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e 6gjuvi5vjcho
+ ./pegh.openssl -d + cmp 6gjuvi5vjcho- /tmp/randombytes100

encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ + ./pegh.openssl -d -f /tmp/leading_zero_key_b
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
+ + cat ./pegh.openssl - /dev/fd/63
6gjuvi5vjcho
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m49.021s
user	1m44.701s
sys	0m4.320s
+ test ./pegh.openssl ./pegh.openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.openssl -v 0 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 0 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.openssl -v 0 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 0 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -v 0 -f + ./pegh.openssl -d -f /tmp/leading_zero_key
/tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.openssl -e + ./pegh.openssl -d -v 6gjuvi5vjcho-wrongkey
0 6gjuvi5vjcho -i + cmp - /tmp/randombytes100
/tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 0 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho + -o cat bla.txt
- /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.386s
user	1m43.779s
sys	0m3.554s
+ test ./pegh.openssl ./pegh.openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl -v 1 6gjuvi5vjcho
++ ./pegh.openssl -v 1 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo encrypting then decrypting with the same key should succeed
'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.openssl -d -f /tmp/leading_zero_key
./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 1 6gjuvi5vjcho
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.538s
user	0m21.460s
sys	0m3.237s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.openssl 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl 6gjuvi5vjcho
++ ./pegh.openssl 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl + ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
-e -f /tmp/leading_zero_key+ cmp - /tmp/randombytes100

Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + + ./pegh.openssl 6gjuvi5vjcho
./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt+ cat - /dev/fd/63

++ echo -n a
echo 'hopefully this doesnt make it to disk'
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.542s
user	1m44.120s
sys	0m3.377s
+ test ./pegh.openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.openssl -v 0 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ ./pegh.openssl ./pegh.openssl -v -v 0 6gjuvi5vjcho0 
6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e + cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
-v 0 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e -v 0 6gjuvi5vjcho + -i cmp - /tmp/randombytes100
/tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 0 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.761s
user	1m44.552s
sys	0m3.242s
+ test ./pegh.openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.openssl -v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho
encrypting then decrypting with the same key should succeed
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp + ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
- /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 1 6gjuvi5vjcho
+ + ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.660s
user	0m21.575s
sys	0m3.246s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.libsodium-openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ '[' '' '!=' 1 ']'
+ + ./pegh.openssl 6gjuvi5vjcho
echo a
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl 6gjuvi5vjcho
++ echo a
++ ./pegh.openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + cmp - /tmp/randombytes100
./pegh.openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ + ./pegh.openssl 6gjuvi5vjcho
cat + ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
- /dev/fd/63
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.780s
user	1m44.556s
sys	0m3.383s
+ test ./pegh.openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.openssl -v 0 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 0 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.openssl -v 0 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 0 6gjuvi5vjcho
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ + ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ ./pegh.openssl -v 0 6gjuvi5vjchoecho 
'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.641s
user	1m44.485s
sys	0m3.286s
+ test ./pegh.openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ echo a
./pegh.openssl -v ++ 1 6gjuvi5vjcho
./pegh.openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'encrypting then decrypting with the same key should succeed

+ ./pegh.openssl -e -v 1 6gjuvi5vjcho
+ ./pegh.libsodium-openssl + cmp - /tmp/randombytes100
-d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ + ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.openssl -v 1 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.422s
user	0m21.510s
sys	0m3.306s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.libsodium
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.openssl 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.453s
user	0m0.428s
sys	0m0.039s
+ test ./pegh.openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.openssl -v 0 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0
skipping this test because libsodium doesn't support AES on this CPU

real	0m0.441s
user	0m0.437s
sys	0m0.020s
+ test ./pegh.openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.openssl -v 1 6gjuvi5vjcho
++ ./pegh.openssl -v 1 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.openssl -v 1 6gjuvi5vjcho
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m21.959s
user	0m21.240s
sys	0m2.947s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.libsodium
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ ./pegh.openssl 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.461s
user	0m0.435s
sys	0m0.050s
+ test ./pegh.openssl ./pegh.libsodium -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ ./pegh.openssl -v 0 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.451s
user	0m0.447s
sys	0m0.021s
+ test ./pegh.openssl ./pegh.libsodium -v 1
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.openssl -v 1 6gjuvi5vjcho
++ ./pegh.openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error
274904008416:error:060B50AC:digital envelope routines:EVP_PBE_scrypt:memory limit exceeded:crypto/evp/pbe_scrypt.c:232:
+ ./pegh.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.libsodium -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m21.991s
user	0m20.786s
sys	0m3.164s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
++ echo a
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'large values of N without enough memory should fail

+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ + ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
echo 'hopefully this doesnt make it to disk'
++ echo -n a
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.750s
user	0m21.640s
sys	0m3.344s
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ + ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
./pegh.static.openssl -d 6gjuvi5vjcho+ 
echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
++ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + + ./pegh.static.openssl -d -f /tmp/leading_zero_key
./pegh.static.libsodium-openssl -e cmp - -v 0 /tmp/randombytes100
-f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho -i + cmp - /tmp/randombytes100
/tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.542s
user	1m43.670s
sys	0m3.529s
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a./pegh.static.libsodium-openssl 
-v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
+ ./pegh.static.libsodium-openssl + cmp - /tmp/randombytes100
-e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl + + cmp ./pegh.static.openssl -d - -f /tmp/randombytes100
/tmp/leading_zero_key_b
-e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.423s
user	0m22.228s
sys	0m3.470s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo + ./pegh.openssl -d 6gjuvi5vjcho
a
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e + + cmp ./pegh.openssl -d -f /tmp/leading_zero_key_b
- /tmp/randombytes100
-f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.openssl + cat - /dev/fd/63
-d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m25.055s
user	0m23.947s
sys	0m3.535s
+ test ./pegh.static.libsodium-openssl ./pegh.openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m46.017s
user	1m44.356s
sys	0m3.756s
+ test ./pegh.static.libsodium-openssl ./pegh.openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.010s
user	0m21.912s
sys	0m3.394s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.797s
user	0m21.964s
sys	0m3.729s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp - ./pegh.static.libsodium-openssl /tmp/randombytes100-d 6gjuvi5vjcho

+ ./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ + ./pegh.static.libsodium-openssl cmp - -d -f /tmp/randombytes100/tmp/leading_zero_key_b

+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
+ ++ echo -n a
./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.599s
user	1m44.070s
sys	0m3.503s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ + cmp ./pegh.static.libsodium-openssl - /tmp/randombytes100
-e -v 1 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -e -v 1 + ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
-f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.299s
user	0m21.274s
sys	0m3.200s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ + ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
cat - /dev/fd/63
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.540s
user	0m22.526s
sys	0m3.280s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
++ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl + ./pegh.libsodium-openssl -d 6gjuvi5vjcho
-e -v 0 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
+ cat - /dev/fd/63
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.346s
user	1m44.508s
sys	0m3.077s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ encrypting then decrypting with the same key should succeed
echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 1 + ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
6gjuvi5vjcho + cmp - /tmp/randombytes100
-i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m21.873s
user	0m21.115s
sys	0m2.965s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.774s
user	0m22.025s
sys	0m3.322s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.476s
user	0m0.468s
sys	0m0.031s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.933s
user	0m22.056s
sys	0m3.115s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -d 6gjuvi5vjcho -o bla.txt
+ ./pegh.static.libsodium-openssl 6gjuvi5vjcho
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.681s
user	0m22.488s
sys	0m3.565s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 6gjuvi5vjcho
+ ./pegh.libsodium -d 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 141 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.476s
user	0m0.458s
sys	0m0.043s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
skipping this test because libsodium doesn't support AES on this CPU
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a+ + ./pegh.libsodium -d -f /tmp/leading_zero_key_b
cmp - /tmp/randombytes100

decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.libsodium -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m22.421s
user	0m21.488s
sys	0m3.264s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.libsodium-openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ + ./pegh.static.openssl -d -f /tmp/leading_zero_key
cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ + ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
./pegh.libsodium-openssl 6gjuvi5vjcho
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.675s
user	0m22.193s
sys	0m3.301s
+ test ./pegh.libsodium-openssl ./pegh.static.openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ echo a
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
++ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.static.openssl -d -f /tmp/leading_zero_key
./pegh.libsodium-openssl -e -v + cmp - /tmp/randombytes100
0 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v + ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
0 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl + -v ./pegh.static.openssl -d 0 6gjuvi5vjcho 6gjuvi5vjcho
-o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m50.246s
user	1m46.592s
sys	0m4.412s
+ test ./pegh.libsodium-openssl ./pegh.static.openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.openssl
encrypting same data with same key should result in different ciphertext
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + ./pegh.static.openssl -d 6gjuvi5vjcho
+ ./pegh.libsodium-openssl cmp - /tmp/randombytes100
-e -v 1 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.681s
user	0m21.684s
sys	0m3.083s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.openssl
+ bin=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium-openssl 6gjuvi5vjcho
++ ./pegh.libsodium-openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -d 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.080s
user	0m22.502s
sys	0m3.115s
+ test ./pegh.libsodium-openssl ./pegh.openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
+ echo a
+ ./pegh.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62encrypting same data with same key should result in different ciphertext

++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
++ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
+ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m46.509s
user	1m44.864s
sys	0m3.794s
+ test ./pegh.libsodium-openssl ./pegh.openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl'
+ set +eu
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.openssl
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e + ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
-v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.545s
user	0m21.554s
sys	0m3.240s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl 6gjuvi5vjcho
++ ./pegh.libsodium-openssl 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'encrypting then decrypting with the same key should succeed

+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl + -d -f /tmp/leading_zero_key
cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m24.129s
user	0m23.138s
sys	0m3.317s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ echo a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
++ echo a
++ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ + cmp ./pegh.libsodium-openssl - -e /tmp/randombytes100-v 
0 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ ./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m46.621s
user	1m44.942s
sys	0m3.651s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' 1 '!=' 1 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ echo a
++ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.412s
user	0m22.118s
sys	0m2.963s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ echo a
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ echo a
++ ./pegh.libsodium-openssl 6gjuvi5vjcho
++ echo a
++ ./pegh.libsodium-openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho
+ + ./pegh.libsodium-openssl -d 6gjuvi5vjcho
cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'bad decryption bytes are never output, file should be 0 bytes

+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.361s
user	0m23.064s
sys	0m2.915s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
encrypting same data with same key should result in different ciphertext
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
++ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho++ echo a

++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho
+ + cmp - /tmp/randombytes100./pegh.libsodium-openssl -d 6gjuvi5vjcho

Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e + cmp - /tmp/randombytes100
-v + ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
0 -f /tmp/leading_zero_key
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'encrypting with one key and decrypting with another should fail

+ ./pegh.libsodium-openssl + ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
-e -v 0 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 0 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
++ echo -n a
Warning: libsodium does not support AES-256-GCM on this CPU, falling back to openssl version instead...
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	1m45.296s
user	1m43.589s
sys	0m3.764s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium-openssl + cmp - /tmp/randombytes100
-d 6gjuvi5vjcho-wrongkey
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.311s
user	0m21.343s
sys	0m3.251s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl 6gjuvi5vjcho
++ ++ echo a
./pegh.libsodium-openssl 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
++ echo -n a
decryption failed
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m23.174s
user	0m22.299s
sys	0m3.121s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ echo a
+ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 141 -eq 19 -o 19 -eq 19 ']'
+ set -eu
skipping this test because libsodium doesn't support AES on this CPU
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.459s
user	0m0.443s
sys	0m0.034s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
++ echo a
++ ++ echo a
./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho
+ ./pegh.static.libsodium + -d 6gjuvi5vjcho
cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.076s
user	0m21.614s
sys	0m3.088s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium-openssl ./pegh.libsodium
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ echo a
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
encrypting same data with same key should result in different ciphertext
++ ++ ./pegh.libsodium-openssl 6gjuvi5vjcho
echo a
++ ./pegh.libsodium-openssl 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ large values of N without enough memory should fail
echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl 6gjuvi5vjcho
+ ./pegh.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.364s
user	0m22.497s
sys	0m3.183s
+ test ./pegh.libsodium-openssl ./pegh.libsodium -v 0
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -v 0 6gjuvi5vjcho
+ ./pegh.libsodium -d 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ '[' 0 -eq 19 -o 19 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.460s
user	0m0.431s
sys	0m0.047s
+ test ./pegh.libsodium-openssl ./pegh.libsodium -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
++ ./pegh.libsodium-openssl -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo encrypting then decrypting with the same key should succeed
'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ cmp - + /tmp/randombytes100
./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ + ./pegh.libsodium -d -f /tmp/leading_zero_key_b
./pegh.libsodium-openssl -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium-openssl -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium-openssl cat - /dev/fd/63
-v 1 6gjuvi5vjcho
++ echo -n a
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -d 6gjuvi5vjcho -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.573s
user	0m21.669s
sys	0m3.097s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
./pegh.static.libsodium 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium -e 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ cmp + ./pegh.static.openssl -d -f /tmp/leading_zero_key
- /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ + ./pegh.static.libsodium 6gjuvi5vjcho
echo + ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m24.370s
user	0m22.968s
sys	0m3.193s
+ test ./pegh.static.libsodium ./pegh.static.openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl

+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -v 0 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.025s
user	0m0.021s
sys	0m0.016s
+ test ./pegh.static.libsodium ./pegh.static.openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ + ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.static.libsodium + cmp - /tmp/randombytes100
-e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.271s
user	0m20.922s
sys	0m3.244s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium -e 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
+ ./pegh.static.libsodium 6gjuvi5vjcho
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.913s
user	0m21.496s
sys	0m3.398s
+ test ./pegh.static.libsodium ./pegh.openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium -v 0 6gjuvi5vjcho
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0
skipping this test because libsodium doesn't support AES on this CPU

real	0m0.026s
user	0m0.018s
sys	0m0.027s
+ test ./pegh.static.libsodium ./pegh.openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
++ echo a
echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo encrypting then decrypting with the same key should succeed
'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.762s
user	0m21.568s
sys	0m3.405s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ echo a
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium 6gjuvi5vjcho
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ++ ./pegh.static.libsodium 6gjuvi5vjcho
echo a
++ echo a
++ ./pegh.static.libsodium 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.libsodium + ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
-e 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium 6gjuvi5vjcho
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ++ echo -n a
./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
decryption failed
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m23.655s
user	0m21.502s
sys	0m3.632s
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -v 0 6gjuvi5vjcho
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
skipping this test because libsodium doesn't support AES on this CPU
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.027s
user	0m0.022s
sys	0m0.019s
+ test ./pegh.static.libsodium ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho+ cmp - /tmp/randombytes100

+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'+ ./pegh.static.libsodium -v 1 6gjuvi5vjcho

+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.826s
user	0m21.275s
sys	0m3.353s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium 6gjuvi5vjcho
++ ./pegh.static.libsodium 6gjuvi5vjcho
++ echo a++ echo a

/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium -e 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.static.libsodium 6gjuvi5vjcho
echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.898s
user	0m22.094s
sys	0m3.153s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.static.libsodium -v 0 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
skipping this test because libsodium doesn't support AES on this CPU
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.041s
user	0m0.058s
sys	0m0.002s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
large values of N without enough memory should fail
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.640s
user	0m21.360s
sys	0m3.244s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.static.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.static.libsodium 6gjuvi5vjcho
+ echo a
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium 6gjuvi5vjcho
++ ++ echo a
./pegh.static.libsodium 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key
+ cmp - + /tmp/randombytes100
./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ set +e
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 6gjuvi5vjcho-wrongkey
+ ./pegh.static.libsodium -e 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.static.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m23.695s
user	0m22.504s
sys	0m3.269s
+ test ./pegh.static.libsodium ./pegh.static.libsodium -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium -v 0 6gjuvi5vjcho
+ echo a
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.024s
user	0m0.013s
sys	0m0.027s
+ test ./pegh.static.libsodium ./pegh.static.libsodium -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -d 6gjuvi5vjcho-wrongkey
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ + cmp ./pegh.static.libsodium -d -f - /tmp/randombytes100
/tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -o bla.txt
+ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m21.689s
user	0m20.606s
sys	0m3.263s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium ./pegh.libsodium
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium 6gjuvi5vjcho
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.static.libsodium -e 6gjuvi5vjcho
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -d + + -f ./pegh.static.libsodium -e /tmp/leading_zero_key
-f /tmp/leading_zero_key
cmp - /tmp/randombytes100
encrypting with one key and decrypting with another should fail
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
+ + ./pegh.libsodium -d 6gjuvi5vjcho-wrongkey
+ ./pegh.static.libsodium cmp - /tmp/randombytes100
-e 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ + ./pegh.libsodium -d -f /tmp/leading_zero_key_b
cmp - /tmp/randombytes100
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.libsodium + 6gjuvi5vjcho
echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m22.873s
user	0m21.902s
sys	0m3.282s
+ test ./pegh.static.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ ./pegh.static.libsodium -v 0 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.035s
user	0m0.038s
sys	0m0.005s
+ test ./pegh.static.libsodium ./pegh.libsodium -v 1
+ bin=./pegh.static.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - + ./pegh.libsodium -d -f /tmp/leading_zero_key_b
/tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -v 1 6gjuvi5vjcho
+ ./pegh.libsodium -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
+ cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.633s
user	0m21.710s
sys	0m3.053s
+ for bin in $TEST_BINS
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium 6gjuvi5vjcho
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.libsodium 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e + ./pegh.static.openssl -d -f /tmp/leading_zero_key_b
-f /tmp/leading_zero_key_a
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
+ large values of N without enough memory should fail
./pegh.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ cat - /dev/fd/63
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium 6gjuvi5vjcho
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.397s
user	0m22.092s
sys	0m3.504s
+ test ./pegh.libsodium ./pegh.static.openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ ./pegh.libsodium -v 0 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.031s
user	0m0.045s
sys	0m0.000s
+ test ./pegh.libsodium ./pegh.static.openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e -v 1 + ./pegh.static.openssl -d 6gjuvi5vjcho-wrongkey
6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100+ ./pegh.static.openssl -d -f /tmp/leading_zero_key_b

decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.static.openssl -d 6gjuvi5vjcho -o bla.txt
+ + echo 'hopefully this doesnt make it to disk'
./pegh.libsodium -v 1 6gjuvi5vjcho
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.860s
user	0m21.468s
sys	0m3.562s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium 6gjuvi5vjcho
+ ./pegh.openssl -d 6gjuvi5vjcho
encrypting same data with same key should result in different ciphertext
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium 6gjuvi5vjcho
++ echo a
++ ./pegh.libsodium 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo encrypting then decrypting with the same key should succeed
'encrypting then decrypting with the same key should succeed'
+ + ./pegh.libsodium -e 6gjuvi5vjcho
./pegh.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium 6gjuvi5vjcho
+ + cat - /dev/fd/63
++ echo -n a
./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m24.220s
user	0m23.194s
sys	0m3.358s
+ test ./pegh.libsodium ./pegh.openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
+ set +eu
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ '[' 0 '!=' 1 ']'
+ ./pegh.openssl -d 6gjuvi5vjcho
+ echo a
+ ./pegh.libsodium -v 0 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
skipping this test because libsodium doesn't support AES on this CPU
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.040s
user	0m0.027s
sys	0m0.037s
+ test ./pegh.libsodium ./pegh.openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
++ echo a
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
encrypting then decrypting with the same key should succeed
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium -v 1 6gjuvi5vjcho
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.332s
user	0m21.541s
sys	0m3.038s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.libsodium 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium 6gjuvi5vjcho
++ echo a
++ ./pegh.libsodium 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ + cmp - /tmp/randombytes100./pegh.libsodium -e 6gjuvi5vjcho
+ 
./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ ./pegh.libsodium 6gjuvi5vjcho
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.083s
user	0m21.883s
sys	0m3.477s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium + ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
-v 0 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
skipping this test because libsodium doesn't support AES on this CPU
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.032s
user	0m0.047s
sys	0m0.006s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
++ echo a
++ echo a
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e + cmp - /tmp/randombytes100
-v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium -v 1 6gjuvi5vjcho
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.439s
user	0m21.524s
sys	0m3.136s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
+ echo testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.libsodium 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ++ echo a
./pegh.libsodium ++ ./pegh.libsodium 6gjuvi5vjcho
6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -f /tmp/leading_zero_key
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e + ./pegh.libsodium-openssl -d 6gjuvi5vjcho-wrongkey
6gjuvi5vjcho -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
bad decryption bytes are never output, file should be 0 bytes
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.315s
user	0m22.426s
sys	0m3.050s
+ test ./pegh.libsodium ./pegh.libsodium-openssl -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ ./pegh.libsodium -v 0 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
skipping this test because libsodium doesn't support AES on this CPU
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
+ return 0

real	0m0.037s
user	0m0.040s
sys	0m0.022s
+ test ./pegh.libsodium ./pegh.libsodium-openssl -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
++ ++ ./pegh.libsodium -v 1 6gjuvi5vjcho
echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d + 6gjuvi5vjcho-wrongkey
cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
+ ./pegh.libsodium -v 1 6gjuvi5vjcho
+ ./pegh.libsodium-openssl -d 6gjuvi5vjcho -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.461s
user	0m21.389s
sys	0m3.414s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ echo a
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium 6gjuvi5vjcho
++ echo a
++ ./pegh.libsodium 6gjuvi5vjcho
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ + ./pegh.static.libsodium -d -f /tmp/leading_zero_key
./pegh.libsodium -e -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.static.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e 6gjuvi5vjcho -i /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m23.187s
user	0m22.248s
sys	0m3.169s
+ test ./pegh.libsodium ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium -v 0 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ echo a
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.027s
user	0m0.038s
sys	0m0.009s
+ test ./pegh.libsodium ./pegh.static.libsodium -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
encrypting then decrypting with the same key should succeed
+ echo 'encrypting then decrypting with the same key should succeed'
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho
+ ./pegh.static.libsodium -d 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ + ./pegh.static.libsodium -d -f /tmp/leading_zero_key
./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.static.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ + ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ ./pegh.libsodium -v 1 6gjuvi5vjcho
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.557s
user	0m21.370s
sys	0m3.409s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.libsodium
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ ./pegh.libsodium 6gjuvi5vjcho
+ echo a
+ ./pegh.libsodium -d 6gjuvi5vjcho
+ '[' 0 -eq 19 -o 0 -eq 19 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium 6gjuvi5vjcho
++ echo a
++ ./pegh.libsodium 6gjuvi5vjcho
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e 6gjuvi5vjcho
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d 6gjuvi5vjcho
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ ./pegh.libsodium + ./pegh.libsodium -e -f /tmp/leading_zero_key
-d -f /tmp/leading_zero_key+ cmp - /tmp/randombytes100

+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
encrypting/decrypting with key in file where last byte is different should fail
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
+ ./pegh.libsodium -e -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ + ./pegh.libsodium -d 6gjuvi5vjcho -o bla.txt
+ ./pegh.libsodium 6gjuvi5vjcho
echo 'hopefully this doesnt make it to disk'
+ cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ '[' -s bla.txt ']'
+ set -e

real	0m23.238s
user	0m22.138s
sys	0m3.541s
+ test ./pegh.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.libsodium -v 0 6gjuvi5vjcho
+ echo a
+ ./pegh.libsodium -d 6gjuvi5vjcho
Error: libsodium does not support AES-256-GCM on this CPU, compile/use openssl version?
usage: pegh [options...] password
 password:     minimum required length is 12
 -e            encrypt input to output, default mode
 -d            decrypt input to output
 -i <filename> file to use for input, - means stdin, default stdin
 -o <filename> file to use for output, - means stdout, default stdout
 -a            append to -o instead of truncate
 -v            pegh file format version to output,
               either 0 (AES-256-GCM) or 1 (Chacha20-Poly1305),
               default: 0 if AES is hardware accelerated, 1 otherwise
 -c <mb>       chunk size for encryption, while decrypting/encrypting twice
               this ram will be used, the same amount will be needed for
               decryption as encryption. This value is saved in the file
               format, so decryption will fail if this isn't set high enough,
               these are only allocated after scrypt is finished so max usage
               will be the highest of these only, not both combined,
               max: 65535 (AES-256-GCM) or 262143 (Chacha20-Poly1305),
               default: 32
 -m <max_mb>   maximum megabytes of ram to use when deriving key from password
               with scrypt, applies for encryption AND decryption, must
               almost linearly scale with -N, if too low operation will fail,
               default: 64
 -f <filename> read password from file instead of argument, - means stdin
 -g            prompt for password, confirm on encryption, max characters: 64
 -N <num>      scrypt parameter N, only applies for encryption, default 32768
               this is rounded up to the next highest power of 2
 -r <num>      scrypt parameter r, only applies for encryption, default 8
 -p <num>      scrypt parameter p, only applies for encryption, default 1
 -s <num>      multiplication factor to apply to both -N and -m for easy
               work scaling, rounded up to the next highest power of 2,
               BEWARE: -s 32 requires 2G ram, -s 64 requires 4G and so on,
               default: 1
 -h            print this usage text
 -q            do not print error output to stderr
 -V            show version number and format version support then quit

For additional info on scrypt params refer to:
    https://blog.filippo.io/the-scrypt-parameters/
    https://tools.ietf.org/html/rfc7914#section-2

File too small for decryption, invalid header?
+ '[' 19 -eq 19 -o 1 -eq 19 ']'
+ set -eu
+ echo 'skipping this test because libsodium doesn'\''t support AES on this CPU'
skipping this test because libsodium doesn't support AES on this CPU
+ return 0

real	0m0.037s
user	0m0.041s
sys	0m0.017s
+ test ./pegh.libsodium ./pegh.libsodium -v 1
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ set +eu
+ '[' 1 '!=' 1 ']'
+ set -eu
+ echo 'encrypting same data with same key should result in different ciphertext'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
++ ./pegh.libsodium -v 1 6gjuvi5vjcho
++ echo a
++ echo a
/dev/fd/63 /dev/fd/62 differ: char 12, line 1
+ true
+ echo 'encrypting then decrypting with the same key should succeed'
encrypting then decrypting with the same key should succeed
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho
encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline
+ echo 'encrypting/decrypting with key in file should work, even when key has leading 0s and a trailing newline'
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key
+ ./pegh.libsodium -d -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ set +e
+ echo 'encrypting with one key and decrypting with another should fail'
encrypting with one key and decrypting with another should fail
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho -i /tmp/randombytes100
+ ./pegh.libsodium -d 6gjuvi5vjcho-wrongkey
+ cmp - /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'encrypting/decrypting with key in file where last byte is different should fail'
encrypting/decrypting with key in file where last byte is different should fail
+ ./pegh.libsodium -e -v 1 -f /tmp/leading_zero_key_a
+ + ./pegh.libsodium -d -f cmp /tmp/leading_zero_key_b
- /tmp/randombytes100
decryption failed
cmp: EOF on -
+ echo 'large values of N without enough memory should fail'
large values of N without enough memory should fail
+ ./pegh.libsodium -e -v 1 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d 6gjuvi5vjcho -N 2000000 -i /tmp/randombytes100
Error: unsupported file format version 116, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/CPU
+ echo 'bad decryption bytes are never output, file should be 0 bytes'
bad decryption bytes are never output, file should be 0 bytes
+ echo 'hopefully this doesnt make it to disk'
+ ./pegh.libsodium -v 1 6gjuvi5vjcho
+ ./pegh.libsodium -d 6gjuvi5vjcho -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m22.487s
user	0m21.363s
sys	0m3.393s
+ echo 'successful test run!'
successful test run!
+ echo 'successfully built and tested static pegh against libsodium and openssl!'
successfully built and tested static pegh against libsodium and openssl!
+ mkdir -p release
+ mv pegh.static.libsodium ./release/pegh-linux-ppc64le-libsodium
+ '[' ppc64le '==' aarch64 ]
+ mv pegh.static.openssl ./release/pegh-linux-ppc64le-openssl
+ mv pegh.static.libsodium-openssl ./release/pegh-linux-ppc64le-libsodium-openssl
+ '[' ppc64le '==' amd64 ]
+ '[' ppc64le '==' amd64 ]
+ '[' ppc64le '==' i386 ]
+ '[' -e .ci/release.sh ']'
+ '[' -d release ']'
+ ci-release-helper.sh standard_pre_release
Everything up-to-date
Everything up-to-date
deleting github release_id: 41341650
deleting gitea release_id: 347233
+ cd release
+ find -type f '!' -path ./sha256sum.txt -print0
+ xargs -0 sha256sum
+ gpg --clearsign sha256sum.txt
+ ci-release-helper.sh standard_multi_release sha256sum.txt text/plain
all tags:
beta
{
  "url": "https://api.github.com/repos/moparisthebest/pegh/releases/43406674",
  "assets_url": "https://api.github.com/repos/moparisthebest/pegh/releases/43406674/assets",
  "upload_url": "https://uploads.github.com/repos/moparisthebest/pegh/releases/43406674/assets{?name,label}",
  "html_url": "https://github.com/moparisthebest/pegh/releases/tag/beta",
  "id": 43406674,
  "author": {
    "login": "moparisthebest",
    "id": 363760,
    "node_id": "MDQ6VXNlcjM2Mzc2MA==",
    "avatar_url": "https://avatars.githubusercontent.com/u/363760?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/moparisthebest",
    "html_url": "https://github.com/moparisthebest",
    "followers_url": "https://api.github.com/users/moparisthebest/followers",
    "following_url": "https://api.github.com/users/moparisthebest/following{/other_user}",
    "gists_url": "https://api.github.com/users/moparisthebest/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/moparisthebest/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/moparisthebest/subscriptions",
    "organizations_url": "https://api.github.com/users/moparisthebest/orgs",
    "repos_url": "https://api.github.com/users/moparisthebest/repos",
    "events_url": "https://api.github.com/users/moparisthebest/events{/privacy}",
    "received_events_url": "https://api.github.com/users/moparisthebest/received_events",
    "type": "User",
    "site_admin": false
  },
  "node_id": "MDc6UmVsZWFzZTQzNDA2Njc0",
  "tag_name": "beta",
  "target_commitish": "master",
  "name": null,
  "draft": false,
  "prerelease": false,
  "created_at": "2020-11-28T04:00:27Z",
  "published_at": "2021-05-22T09:00:13Z",
  "assets": [

  ],
  "tarball_url": "https://api.github.com/repos/moparisthebest/pegh/tarball/beta",
  "zipball_url": "https://api.github.com/repos/moparisthebest/pegh/zipball/beta",
  "body": null
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333671","id":37333671,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjcx","name":"sha256sum.txt","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"text/plain","state":"uploaded","size":2050,"download_count":0,"created_at":"2021-05-22T09:00:13Z","updated_at":"2021-05-22T09:00:13Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/sha256sum.txt"}{"id":347233,"tag_name":"beta","target_commitish":"","name":"","body":"","url":"https://code.moparisthebest.com/api/v1/repos/moparisthebest/pegh/releases/347233","html_url":"https://code.moparisthebest.com/moparisthebest/pegh/releases/tag/beta","tarball_url":"https://code.moparisthebest.com/moparisthebest/pegh/archive/beta.tar.gz","zipball_url":"https://code.moparisthebest.com/moparisthebest/pegh/archive/beta.zip","draft":false,"prerelease":false,"created_at":"2020-11-27T23:00:27-05:00","published_at":"2020-11-27T23:00:27-05:00","author":{"id":1,"login":"moparisthebest","full_name":"Travis Burtrum","email":"admin.code@moparisthebest.com","avatar_url":"https://code.moparisthebest.com/user/avatar/moparisthebest/-1","language":"en-US","is_admin":true,"last_login":"2021-05-12T01:04:07-04:00","created":"2018-07-01T22:04:44-04:00","username":"moparisthebest"},"assets":[]}uploading file to gitea release_id: 347233
{"id":2562,"name":"sha256sum.txt","size":2050,"download_count":0,"created_at":"2021-05-22T05:00:14-04:00","uuid":"8e24735c-a012-40f8-902f-b5ac1837e569","browser_download_url":"https://code.moparisthebest.com/attachments/8e24735c-a012-40f8-902f-b5ac1837e569"}+ ci-release-helper.sh standard_multi_release sha256sum.txt.asc text/plain
all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333672","id":37333672,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjcy","name":"sha256sum.txt.asc","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"text/plain","state":"uploaded","size":2327,"download_count":0,"created_at":"2021-05-22T09:00:15Z","updated_at":"2021-05-22T09:00:15Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/sha256sum.txt.asc"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2563,"name":"sha256sum.txt.asc","size":2327,"download_count":0,"created_at":"2021-05-22T05:00:15-04:00","uuid":"ff607efd-f031-4f38-809b-b3b5cb15c9a4","browser_download_url":"https://code.moparisthebest.com/attachments/ff607efd-f031-4f38-809b-b3b5cb15c9a4"}+ rm -f sha256sum.txt sha256sum.txt.asc
+ find -type f -print0
+ xargs -0n1 -I '{}' ci-release-helper.sh standard_multi_release '{}' application/octet-stream
xargs: warning: options --max-args and --replace/-I/-i are mutually exclusive, ignoring previous --max-args value
all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333674","id":37333674,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjc0","name":"pegh-linux-amd64-libsodium","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":272936,"download_count":0,"created_at":"2021-05-22T09:00:17Z","updated_at":"2021-05-22T09:00:18Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-amd64-libsodium"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2564,"name":"pegh-linux-amd64-libsodium","size":272936,"download_count":0,"created_at":"2021-05-22T05:00:19-04:00","uuid":"feda4753-4c6f-4c7d-ad14-f68bef6d02a6","browser_download_url":"https://code.moparisthebest.com/attachments/feda4753-4c6f-4c7d-ad14-f68bef6d02a6"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333676","id":37333676,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjc2","name":"pegh-linux-amd64-openssl","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":2031912,"download_count":0,"created_at":"2021-05-22T09:00:20Z","updated_at":"2021-05-22T09:00:21Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-amd64-openssl"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2565,"name":"pegh-linux-amd64-openssl","size":2031912,"download_count":0,"created_at":"2021-05-22T05:00:21-04:00","uuid":"a15e2da1-0402-4705-8546-884d23654490","browser_download_url":"https://code.moparisthebest.com/attachments/a15e2da1-0402-4705-8546-884d23654490"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333677","id":37333677,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjc3","name":"pegh-linux-amd64-libsodium-openssl","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":2249736,"download_count":0,"created_at":"2021-05-22T09:00:21Z","updated_at":"2021-05-22T09:00:22Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-amd64-libsodium-openssl"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2566,"name":"pegh-linux-amd64-libsodium-openssl","size":2249736,"download_count":0,"created_at":"2021-05-22T05:00:22-04:00","uuid":"a4da0130-f612-4a3c-bfd5-60665206fca9","browser_download_url":"https://code.moparisthebest.com/attachments/a4da0130-f612-4a3c-bfd5-60665206fca9"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333678","id":37333678,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjc4","name":"pegh-source.zip","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":32076,"download_count":0,"created_at":"2021-05-22T09:00:23Z","updated_at":"2021-05-22T09:00:23Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-source.zip"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2567,"name":"pegh-source.zip","size":32076,"download_count":0,"created_at":"2021-05-22T05:00:24-04:00","uuid":"b870f7a0-6dff-4637-9b4b-5fae2f547a30","browser_download_url":"https://code.moparisthebest.com/attachments/b870f7a0-6dff-4637-9b4b-5fae2f547a30"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333679","id":37333679,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjc5","name":"pegh-source.tar.gz","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":29709,"download_count":0,"created_at":"2021-05-22T09:00:24Z","updated_at":"2021-05-22T09:00:24Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-source.tar.gz"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2568,"name":"pegh-source.tar.gz","size":29709,"download_count":0,"created_at":"2021-05-22T05:00:25-04:00","uuid":"cbcd74b3-0282-40b1-9411-8dee79fbd9fb","browser_download_url":"https://code.moparisthebest.com/attachments/cbcd74b3-0282-40b1-9411-8dee79fbd9fb"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333680","id":37333680,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjgw","name":"pegh-windows-amd64-libsodium-openssl.exe","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":2715648,"download_count":0,"created_at":"2021-05-22T09:00:26Z","updated_at":"2021-05-22T09:00:29Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-windows-amd64-libsodium-openssl.exe"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2569,"name":"pegh-windows-amd64-libsodium-openssl.exe","size":2715648,"download_count":0,"created_at":"2021-05-22T05:00:29-04:00","uuid":"175649bb-9828-4c9e-8fce-ad3bb798c945","browser_download_url":"https://code.moparisthebest.com/attachments/175649bb-9828-4c9e-8fce-ad3bb798c945"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333681","id":37333681,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjgx","name":"pegh-windows-amd64-libsodium.exe","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":306688,"download_count":0,"created_at":"2021-05-22T09:00:30Z","updated_at":"2021-05-22T09:00:30Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-windows-amd64-libsodium.exe"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2570,"name":"pegh-windows-amd64-libsodium.exe","size":306688,"download_count":0,"created_at":"2021-05-22T05:00:31-04:00","uuid":"6d5c33df-b81c-45ed-947b-9222e72c470b","browser_download_url":"https://code.moparisthebest.com/attachments/6d5c33df-b81c-45ed-947b-9222e72c470b"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333683","id":37333683,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjgz","name":"pegh-windows-amd64-openssl.exe","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":2456064,"download_count":0,"created_at":"2021-05-22T09:00:31Z","updated_at":"2021-05-22T09:00:33Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-windows-amd64-openssl.exe"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2571,"name":"pegh-windows-amd64-openssl.exe","size":2456064,"download_count":0,"created_at":"2021-05-22T05:00:33-04:00","uuid":"40a2d059-e422-48da-b80b-efacfd7a7469","browser_download_url":"https://code.moparisthebest.com/attachments/40a2d059-e422-48da-b80b-efacfd7a7469"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333685","id":37333685,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjg1","name":"pegh-linux-i386-libsodium","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":329156,"download_count":0,"created_at":"2021-05-22T09:00:34Z","updated_at":"2021-05-22T09:00:34Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-i386-libsodium"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2572,"name":"pegh-linux-i386-libsodium","size":329156,"download_count":0,"created_at":"2021-05-22T05:00:34-04:00","uuid":"5d4b81a5-a3f3-496a-8324-b8e66c0e7da5","browser_download_url":"https://code.moparisthebest.com/attachments/5d4b81a5-a3f3-496a-8324-b8e66c0e7da5"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333687","id":37333687,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjg3","name":"pegh-linux-i386-openssl","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":2048532,"download_count":0,"created_at":"2021-05-22T09:00:35Z","updated_at":"2021-05-22T09:00:36Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-i386-openssl"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2573,"name":"pegh-linux-i386-openssl","size":2048532,"download_count":0,"created_at":"2021-05-22T05:00:36-04:00","uuid":"fa035ae1-a90d-4c62-8c7f-ea4d26aac80f","browser_download_url":"https://code.moparisthebest.com/attachments/fa035ae1-a90d-4c62-8c7f-ea4d26aac80f"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333691","id":37333691,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjkx","name":"pegh-linux-i386-libsodium-openssl","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":2310864,"download_count":0,"created_at":"2021-05-22T09:00:37Z","updated_at":"2021-05-22T09:00:38Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-i386-libsodium-openssl"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2574,"name":"pegh-linux-i386-libsodium-openssl","size":2310864,"download_count":0,"created_at":"2021-05-22T05:00:38-04:00","uuid":"85b5897b-4920-4dc8-9027-8d6641734962","browser_download_url":"https://code.moparisthebest.com/attachments/85b5897b-4920-4dc8-9027-8d6641734962"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333693","id":37333693,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjkz","name":"pegh-windows-i386-libsodium-openssl.exe","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":2335744,"download_count":0,"created_at":"2021-05-22T09:00:39Z","updated_at":"2021-05-22T09:00:39Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-windows-i386-libsodium-openssl.exe"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2575,"name":"pegh-windows-i386-libsodium-openssl.exe","size":2335744,"download_count":0,"created_at":"2021-05-22T05:00:40-04:00","uuid":"a6b4fac2-b97c-4321-b493-43f4ac9b45d0","browser_download_url":"https://code.moparisthebest.com/attachments/a6b4fac2-b97c-4321-b493-43f4ac9b45d0"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333694","id":37333694,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjk0","name":"pegh-windows-i386-libsodium.exe","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":357888,"download_count":0,"created_at":"2021-05-22T09:00:41Z","updated_at":"2021-05-22T09:00:41Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-windows-i386-libsodium.exe"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2576,"name":"pegh-windows-i386-libsodium.exe","size":357888,"download_count":0,"created_at":"2021-05-22T05:00:41-04:00","uuid":"fbf87915-b1d0-44fb-9ed2-220e471c216e","browser_download_url":"https://code.moparisthebest.com/attachments/fbf87915-b1d0-44fb-9ed2-220e471c216e"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333696","id":37333696,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjk2","name":"pegh-windows-i386-openssl.exe","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":2019840,"download_count":0,"created_at":"2021-05-22T09:00:42Z","updated_at":"2021-05-22T09:00:43Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-windows-i386-openssl.exe"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2577,"name":"pegh-windows-i386-openssl.exe","size":2019840,"download_count":0,"created_at":"2021-05-22T05:00:43-04:00","uuid":"f93fb081-573e-481e-abc7-4bfa35a2927d","browser_download_url":"https://code.moparisthebest.com/attachments/f93fb081-573e-481e-abc7-4bfa35a2927d"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333697","id":37333697,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjk3","name":"pegh-linux-aarch64-libsodium","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":178296,"download_count":0,"created_at":"2021-05-22T09:00:44Z","updated_at":"2021-05-22T09:00:44Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-aarch64-libsodium"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2578,"name":"pegh-linux-aarch64-libsodium","size":178296,"download_count":0,"created_at":"2021-05-22T05:00:45-04:00","uuid":"f378aaa2-db50-43fe-bac9-7acc3aefd324","browser_download_url":"https://code.moparisthebest.com/attachments/f378aaa2-db50-43fe-bac9-7acc3aefd324"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333698","id":37333698,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNjk4","name":"pegh-linux-armv7-libsodium","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":161264,"download_count":0,"created_at":"2021-05-22T09:00:45Z","updated_at":"2021-05-22T09:00:46Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-armv7-libsodium"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2579,"name":"pegh-linux-armv7-libsodium","size":161264,"download_count":0,"created_at":"2021-05-22T05:00:46-04:00","uuid":"9fa7f1e2-3bba-4488-8fc7-4538ef14cf70","browser_download_url":"https://code.moparisthebest.com/attachments/9fa7f1e2-3bba-4488-8fc7-4538ef14cf70"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333700","id":37333700,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNzAw","name":"pegh-linux-armv7-openssl","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":1216648,"download_count":0,"created_at":"2021-05-22T09:00:46Z","updated_at":"2021-05-22T09:00:47Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-armv7-openssl"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2580,"name":"pegh-linux-armv7-openssl","size":1216648,"download_count":0,"created_at":"2021-05-22T05:00:47-04:00","uuid":"022c2843-08c9-4dea-955a-f3cd42a5028e","browser_download_url":"https://code.moparisthebest.com/attachments/022c2843-08c9-4dea-955a-f3cd42a5028e"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333701","id":37333701,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNzAx","name":"pegh-linux-armv7-libsodium-openssl","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":1335588,"download_count":0,"created_at":"2021-05-22T09:00:48Z","updated_at":"2021-05-22T09:00:49Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-armv7-libsodium-openssl"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2581,"name":"pegh-linux-armv7-libsodium-openssl","size":1335588,"download_count":0,"created_at":"2021-05-22T05:00:49-04:00","uuid":"3981094e-c5cb-423f-b326-4b7657a86fbd","browser_download_url":"https://code.moparisthebest.com/attachments/3981094e-c5cb-423f-b326-4b7657a86fbd"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333702","id":37333702,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNzAy","name":"pegh-linux-ppc64le-libsodium","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":198856,"download_count":0,"created_at":"2021-05-22T09:00:50Z","updated_at":"2021-05-22T09:00:50Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-ppc64le-libsodium"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2582,"name":"pegh-linux-ppc64le-libsodium","size":198856,"download_count":0,"created_at":"2021-05-22T05:00:50-04:00","uuid":"4657e524-2b6c-4bd9-8aa8-d83de8b432c6","browser_download_url":"https://code.moparisthebest.com/attachments/4657e524-2b6c-4bd9-8aa8-d83de8b432c6"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333703","id":37333703,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNzAz","name":"pegh-linux-ppc64le-openssl","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":2039160,"download_count":0,"created_at":"2021-05-22T09:00:51Z","updated_at":"2021-05-22T09:00:52Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-ppc64le-openssl"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2583,"name":"pegh-linux-ppc64le-openssl","size":2039160,"download_count":0,"created_at":"2021-05-22T05:00:52-04:00","uuid":"e60bf985-ecaa-4b86-92f5-9ae3a4ba86a0","browser_download_url":"https://code.moparisthebest.com/attachments/e60bf985-ecaa-4b86-92f5-9ae3a4ba86a0"}all tags:
beta
{
  "message": "Validation Failed",
  "errors": [
    {
      "resource": "Release",
      "code": "already_exists",
      "field": "tag_name"
    }
  ],
  "documentation_url": "https://docs.github.com/rest/reference/repos#create-a-release"
}
uploading file to github release_id: 43406674
{"url":"https://api.github.com/repos/moparisthebest/pegh/releases/assets/37333704","id":37333704,"node_id":"MDEyOlJlbGVhc2VBc3NldDM3MzMzNzA0","name":"pegh-linux-ppc64le-libsodium-openssl","label":"","uploader":{"login":"moparisthebest","id":363760,"node_id":"MDQ6VXNlcjM2Mzc2MA==","avatar_url":"https://avatars.githubusercontent.com/u/363760?v=4","gravatar_id":"","url":"https://api.github.com/users/moparisthebest","html_url":"https://github.com/moparisthebest","followers_url":"https://api.github.com/users/moparisthebest/followers","following_url":"https://api.github.com/users/moparisthebest/following{/other_user}","gists_url":"https://api.github.com/users/moparisthebest/gists{/gist_id}","starred_url":"https://api.github.com/users/moparisthebest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moparisthebest/subscriptions","organizations_url":"https://api.github.com/users/moparisthebest/orgs","repos_url":"https://api.github.com/users/moparisthebest/repos","events_url":"https://api.github.com/users/moparisthebest/events{/privacy}","received_events_url":"https://api.github.com/users/moparisthebest/received_events","type":"User","site_admin":false},"content_type":"application/octet-stream","state":"uploaded","size":2170512,"download_count":0,"created_at":"2021-05-22T09:00:53Z","updated_at":"2021-05-22T09:00:53Z","browser_download_url":"https://github.com/moparisthebest/pegh/releases/download/beta/pegh-linux-ppc64le-libsodium-openssl"}{"message":"Release is has no Tag","url":"https://code.moparisthebest.com/api/swagger"}uploading file to gitea release_id: 347233
{"id":2584,"name":"pegh-linux-ppc64le-libsodium-openssl","size":2170512,"download_count":0,"created_at":"2021-05-22T05:00:54-04:00","uuid":"690c7bbd-32be-4628-8f3a-27b2c8971493","browser_download_url":"https://code.moparisthebest.com/attachments/690c7bbd-32be-4628-8f3a-27b2c8971493"}+ exit 0
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Email)
[Pipeline] step
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
+ ./bin/build.sh docker-chown
+ BUILD_SCRIPT=docker-chown
+ shift
+ '[' '' == docker-chown ']'
+ '[' docker-chown == docker-chown ']'
++ pwd
++ id -g
+ docker run --rm -v /var/lib/jenkins/workspace/moparisthebest_pegh_master:/tmp alpine chown -R 971:971 /tmp
+ exit 0
[Pipeline] deleteDir
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
[Gitea] Notifying branch build status: SUCCESS This commit looks good
[Gitea] Notified
Finished: SUCCESS