Console Output

Branch indexing
Looking up repository moparisthebest/pegh
Querying the current revision of branch master...
Current revision of branch master is 6e690553fffc7d3b413a094e844c883125485c99
Obtained .ci/Jenkinsfile from 6e690553fffc7d3b413a094e844c883125485c99
[Pipeline] Start of Pipeline
[Pipeline] properties
[Pipeline] node
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.42.0'
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 6e690553fffc7d3b413a094e844c883125485c99 (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 6e690553fffc7d3b413a094e844c883125485c99 # timeout=10
Commit message: "scrypt_max_mem needs to be uint64_t"
 > git rev-list --no-walk c38dbae2f12bd3a2b95fb890c6267f183ef3d82b # timeout=10
[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 'origin/master'.
+ git reset --hard origin/master
HEAD is now at 6e69055 scrypt_max_mem needs to be uint64_t
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build + Deploy)
[Pipeline] sh
+ bash
+ curl --compressed -sL https://code.moparisthebest.com/moparisthebest/self-ci/raw/branch/master/build-ci.sh
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:/var/lib/jenkins/.cargo/bin:/var/lib/jenkins/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin
+ PATH=/var/lib/jenkins/workspace/moparisthebest_pegh_master/bin:/var/lib/jenkins/.cargo/bin:/var/lib/jenkins/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/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
time="2023-08-29T00:38:57-04:00" level=warning msg="The cgroupv2 manager is set to systemd but there is no systemd user session available"
time="2023-08-29T00:38:57-04:00" level=warning msg="For using systemd, you may need to log in using a user session"
time="2023-08-29T00:38:57-04:00" level=warning msg="Alternatively, you can enable lingering with: `loginctl enable-linger 971` (possibly as root)"
time="2023-08-29T00:38:57-04:00" level=warning msg="Falling back to --cgroup-manager=cgroupfs"
time="2023-08-29T00:38:57-04:00" level=warning msg="The cgroupv2 manager is set to systemd but there is no systemd user session available"
time="2023-08-29T00:38:57-04:00" level=warning msg="For using systemd, you may need to log in using a user session"
time="2023-08-29T00:38:57-04:00" level=warning msg="Alternatively, you can enable lingering with: `loginctl enable-linger 971` (possibly as root)"
time="2023-08-29T00:38:57-04:00" level=warning msg="Falling back to --cgroup-manager=cgroupfs"
Resolved "alpine" as an alias (/etc/containers/registries.conf.d/00-shortnames.conf)
Trying to pull docker.io/library/alpine:latest...
Getting image source signatures
Copying blob sha256:7264a8db6415046d36d16ba98b79778e18accee6ffa71850405994cffa9be7de
Copying config sha256:7e01a0d0a1dcd9e539f8e9bbd80106d59efbdf97293b3d38f5d7a34501526cdb
Writing manifest to image destination
+ apk add build-base clang bash libsodium-dev libsodium-static openssl-dev openssl-libs-static
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
(1/38) Installing ncurses-terminfo-base (6.4_p20230506-r0)
(2/38) Installing libncursesw (6.4_p20230506-r0)
(3/38) Installing readline (8.2.1-r1)
(4/38) Installing bash (5.2.15-r5)
Executing bash-5.2.15-r5.post-install
(5/38) Installing libgcc (12.2.1_git20220924-r10)
(6/38) Installing libstdc++ (12.2.1_git20220924-r10)
(7/38) Installing zstd-libs (1.5.5-r4)
(8/38) Installing binutils (2.40-r7)
(9/38) Installing libmagic (5.45-r0)
(10/38) Installing file (5.45-r0)
(11/38) Installing libgomp (12.2.1_git20220924-r10)
(12/38) Installing libatomic (12.2.1_git20220924-r10)
(13/38) Installing gmp (6.2.1-r3)
(14/38) Installing isl26 (0.26-r1)
(15/38) Installing mpfr4 (4.2.0_p12-r0)
(16/38) Installing mpc1 (1.3.1-r1)
(17/38) Installing gcc (12.2.1_git20220924-r10)
(18/38) Installing libstdc++-dev (12.2.1_git20220924-r10)
(19/38) Installing musl-dev (1.2.4-r1)
(20/38) Installing libc-dev (0.7.2-r5)
(21/38) Installing g++ (12.2.1_git20220924-r10)
(22/38) Installing make (4.4.1-r1)
(23/38) Installing fortify-headers (1.1-r3)
(24/38) Installing patch (2.7.6-r10)
(25/38) Installing build-base (0.5-r3)
(26/38) Installing libffi (3.4.4-r2)
(27/38) Installing xz-libs (5.4.3-r0)
(28/38) Installing libxml2 (2.11.4-r0)
(29/38) Installing llvm16-libs (16.0.6-r1)
(30/38) Installing clang16-libs (16.0.6-r1)
(31/38) Installing clang16-libclang (16.0.6-r1)
(32/38) Installing clang16 (16.0.6-r1)
(33/38) Installing libsodium (1.0.18-r3)
(34/38) Installing pkgconf (1.9.5-r0)
(35/38) Installing libsodium-dev (1.0.18-r3)
(36/38) Installing libsodium-static (1.0.18-r3)
(37/38) Installing openssl-dev (3.1.2-r0)
(38/38) Installing openssl-libs-static (3.1.2-r0)
Executing busybox-1.36.1-r2.trigger
OK: 515 MiB in 53 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      559.4K Aug 29 04:40 pegh.static.libsodium
-rwxrwxrwx    1 root     root       12.5M Aug 29 04:40 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root       12.2M Aug 29 04:40 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      262.7K Aug 29 04:40 pegh.static.libsodium
-rwxrwxrwx    1 root     root        3.7M Aug 29 04:40 pegh.static.libsodium-openssl
-rwxrwxrwx    1 root     root        3.5M Aug 29 04:40 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, BuildID[sha1]=2ac6e1cb5a8ba643aeb23c6be38f0cbb7f87e62d, stripped
pegh.static.libsodium-openssl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=579e1f46e7216ccc4ecb28778d62a16acce26408, stripped
pegh.static.openssl:           ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=637990c7f156c3e1a27e0bf39481d22a36518ee8, 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
++ head -c12
++ tr -dc a-z0-9
+ export key=a0iyplxj8lgp
+ key=a0iyplxj8lgp
+ echo 'key: a0iyplxj8lgp'
key: a0iyplxj8lgp
+ '[' -e /tmp/leading_zero_key ']'
++ dd if=/dev/zero bs=1M count=1
+ cat /dev/fd/63 /dev/fd/62
++ echo a0iyplxj8lgp
1+0 records in
1+0 records out
+ '[' -e /tmp/leading_zero_key_a ']'
+ cat /tmp/leading_zero_key /dev/fd/63
++ echo -n a
+ '[' -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
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./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 ']'
+ echo a
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ ./pegh.static.openssl a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.openssl a0iyplxj8lgp
/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 -e a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
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
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ + ./pegh.static.openssl -d a0iyplxj8lgp-wrongkey
./pegh.static.openssl -e a0iyplxj8lgp -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.static.openssl -d -f /tmp/leading_zero_key_b
+ cmp - /tmp/randombytes100
-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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
+ cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m6.019s
user	0m4.672s
sys	0m2.003s
+ 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.openssl -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp
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.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 + a0iyplxj8lgp-wrongkey
cmp - /tmp/randombytes100
+ ./pegh.static.openssl -e -v 0 a0iyplxj8lgp -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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.925s
user	0m4.748s
sys	0m1.839s
+ 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
++ echo a
++ ./pegh.static.openssl -v 1 a0iyplxj8lgp
++ ./pegh.static.openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp
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.static.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.openssl -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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.static.openssl -v 1 a0iyplxj8lgp
/dev/fd/63
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.769s
user	0m4.474s
sys	0m1.997s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.openssl ./pegh.openssl
+ 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
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.openssl -d a0iyplxj8lgp
+ ./pegh.static.openssl a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.openssl a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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.openssl cmp -d - -f /tmp/randombytes100/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 a0iyplxj8lgp-wrongkey
+ ./pegh.static.openssl -e + a0iyplxj8lgp cmp -i - /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.static.openssl -e -f + cmp - /tmp/randombytes100
/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.static.openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - ++ echo -n a
+ ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
/dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.942s
user	0m4.713s
sys	0m1.925s
+ 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'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ '[' 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 ++ echo 0 a0iyplxj8lgp
a
++ echo a
++ ./pegh.static.openssl -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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.openssl + -d -f cmp /tmp/leading_zero_key- 
/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.openssl + ./pegh.openssl -d a0iyplxj8lgp-wrongkey
+ cmp - /tmp/randombytes100
-e -v 0 a0iyplxj8lgp -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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ++ ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m6.421s
user	0m4.881s
sys	0m2.107s
+ test ./pegh.static.openssl ./pegh.openssl -v 1
+ 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
+ '[' 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.openssl -v 1 a0iyplxj8lgp
++ ./pegh.static.openssl -v 1 a0iyplxj8lgp
++ 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 a0iyplxj8lgp
./pegh.static.openssl -e -v 1 a0iyplxj8lgp
+ 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 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.static.openssl -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d a0iyplxj8lgp-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
+ 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 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 
a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.668s
user	0m4.423s
sys	0m1.937s
+ 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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.openssl a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ 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.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 -d a0iyplxj8lgp-wrongkey
+ ./pegh.static.openssl -e a0iyplxj8lgp -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 -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.openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
+ cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.567s
user	0m4.277s
sys	0m1.962s
+ 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'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -v 0 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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
++ ./pegh.static.openssl -v 0 a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.static.openssl -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ 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.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 0 a0iyplxj8lgp -i /tmp/randombytes100
./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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
+ 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 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
++ echo + -n a
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.352s
user	0m4.161s
sys	0m1.842s
+ test ./pegh.static.openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.static.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 1 '!=' 1 ']'
+ 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.openssl -v 1 a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.static.openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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 -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.openssl -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.514s
user	0m4.323s
sys	0m1.860s
+ 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'
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium-openssl
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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.static.openssl a0iyplxj8lgp
++ echo a
++ ./pegh.static.openssl a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ + ./pegh.libsodium-openssl cmp -d a0iyplxj8lgp
- /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.static.openssl -e a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp-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 -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.openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
+ cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.387s
user	0m4.258s
sys	0m1.801s
+ 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.libsodium-openssl -d a0iyplxj8lgp
+ ./pegh.static.openssl -v 0 a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp++ 
echo a
++ echo a
++ ./pegh.static.openssl -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ 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
+ ./pegh.libsodium-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.openssl -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp-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.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 -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 + + ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
0 a0iyplxj8lgp
++ echo -n a
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.464s
user	0m4.116s
sys	0m2.047s
+ 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
++ echo a++ 
./pegh.static.openssl -v 1 a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
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
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.static.openssl + cmp - /tmp/randombytes100
-e -v 1 a0iyplxj8lgp + ./pegh.libsodium-openssl -d a0iyplxj8lgp-wrongkey
-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-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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 + cat - /dev/fd/63
+ -v 1 a0iyplxj8lgp
./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.372s
user	0m4.192s
sys	0m1.879s
+ 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 ']'
+ echo a
+ ./pegh.static.openssl a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ '[' 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.openssl a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.static.openssl a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ 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.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 a0iyplxj8lgp -i /tmp/randombytes100
+ + ./pegh.static.libsodium -d a0iyplxj8lgp-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 -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.openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.403s
user	0m4.215s
sys	0m1.811s
+ 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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ '[' 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 -v 0 a0iyplxj8lgp
++ ++ ./pegh.static.openssl echo a
-v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ 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
+ ./pegh.static.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.static.openssl -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 -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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.397s
user	0m4.022s
sys	0m2.033s
+ 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
++ echo a
++ ./pegh.static.openssl -v 1 a0iyplxj8lgp
++ echo a
++ ./pegh.static.openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ echo encrypting/decrypting with key in file should work, even when key has 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
+ 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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 -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 -
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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ + cat - /dev/fd/63
./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.573s
user	0m4.428s
sys	0m1.838s
+ 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ ./pegh.static.openssl a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ + ./pegh.libsodium -d a0iyplxj8lgp
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 -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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d + cmp - /tmp/randombytes100
a0iyplxj8lgp-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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
++ + cat echo -n a
- /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh.static.openssl bin_decrypt: ./pegh.libsodium

real	0m5.418s
user	0m4.147s
sys	0m1.905s
+ 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 ']'
+ echo a
+ ./pegh.libsodium -d a0iyplxj8lgp
+ ./pegh.static.openssl -v 0 a0iyplxj8lgp
+ '[' 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 -v 0 a0iyplxj8lgp
++ echo a
++ ./pegh.static.openssl -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ 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
+ ./pegh.libsodium -d + cmp - /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 -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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.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.openssl -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.222s
user	0m4.145s
sys	0m1.923s
+ 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.openssl -v 1 a0iyplxj8lgp
++ 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 -e -v 1 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
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
+ 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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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 -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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
F843780000000000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.478s
user	0m4.312s
sys	0m1.836s
+ 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
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ ./pegh.openssl a0iyplxj8lgp
+ '[' 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
++ ++ ./pegh.openssl a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
echo a
++ echo a
++ ./pegh.openssl a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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
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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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.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.openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
486BD8EF097F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.884s
user	0m4.679s
sys	0m1.891s
+ 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 ']'
+ echo a
+ ./pegh.openssl -v 0 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ '[' 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'
++ ++ ./pegh.openssl -v 0 a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
echo a
++ echo a
++ ./pegh.openssl -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ 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 0 -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.openssl -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
488B1CBF7C7F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m6.061s
user	0m4.661s
sys	0m2.055s
+ test ./pegh.openssl ./pegh.static.openssl -v 1
+ bin=./pegh.openssl
+ shifttesting binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.openssl

+ 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
'encrypting same data with same key should result in different ciphertext'
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 1 a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.openssl -v 1 a0iyplxj8lgp
/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 -e -v 1 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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 ./pegh.static.openssl 1 -f -d -f /tmp/leading_zero_key
/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 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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
+ ./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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
48CB39F3C97F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.712s
user	0m4.525s
sys	0m1.830s
+ 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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
echo a
++ echo a
++ ./pegh.openssl a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.openssl -e + cmp - /tmp/randombytes100
a0iyplxj8lgp
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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.openssl -d a0iyplxj8lgp-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
+ + cmp - /tmp/randombytes100
./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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
48FBF9D4107F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 ./pegh.openssl -d a0iyplxj8lgp a0iyplxj8lgp-o 
bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m6.012s
user	0m4.723s
sys	0m1.922s
+ test ./pegh.openssl ./pegh.openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.openssl
+ shift
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.openssl -v 0 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ '[' 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
++ ++ ./pegh.openssl -v 0 a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
echo a
++ echo a
++ ./pegh.openssl -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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.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 a0iyplxj8lgp -i /tmp/randombytes100
+ + cmp - /tmp/randombytes100
./pegh.openssl -d a0iyplxj8lgp-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 0 -f /tmp/leading_zero_key_a
+ ./pegh.openssl -d + cmp - /tmp/randombytes100
-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 -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
48CB8C873D7F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ + ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.764s
user	0m4.552s
sys	0m1.878s
+ 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 ++ ./pegh.openssl -v 1 aa0iyplxj8lgp

++ ./pegh.openssl ++ -v 1 a0iyplxj8lgpecho 
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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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.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.openssl -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.openssl -d a0iyplxj8lgp-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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
482BB74D6D7F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp+ 
./pegh.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.832s
user	0m4.593s
sys	0m1.925s
+ 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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp

+ '[' 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 a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.openssl a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ 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-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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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.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.openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
48FB57CF427F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp+ echo 'hopefully this doesnt make it to disk'

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

real	0m5.519s
user	0m4.243s
sys	0m1.896s
+ test ./pegh.openssl ./pegh.static.libsodium-openssl -v 0
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ ./pegh.openssl -v 0 a0iyplxj8lgp
+ 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
++ echo a+ 
cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 0 a0iyplxj8lgp
++ echo a
++ ./pegh.openssl -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ + cmp - /tmp/randombytes100
./pegh.openssl -e -v 0 a0iyplxj8lgp
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.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 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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 + ./pegh.openssl -e -v 0 -f /tmp/leading_zero_key_a
- /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.openssl -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
483B802AF87F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.322s
user	0m4.046s
sys	0m1.936s
+ test ./pegh.openssl ./pegh.static.libsodium-openssl -v 1
+ bin=./pegh.openssl
+ shift
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium-openssl
+ 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'
encrypting same data with same key should result in different ciphertext
++ echo a
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.openssl -v 1 a0iyplxj8lgp
++ ./pegh.openssl -v 1 a0iyplxj8lgp
++ 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 -v 1 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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
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 a0iyplxj8lgp-wrongkey
+ ./pegh.openssl -e -v 1 a0iyplxj8lgp -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 -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.openssl -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
48BB47E41C7F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ + cat - /dev/fd/63
./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.191s
user	0m4.119s
sys	0m1.860s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.libsodium-openssl
+ bin=./pegh.openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.openssl a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.openssl a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ 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 + ./pegh.libsodium-openssl -d -f /tmp/leading_zero_key
-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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp-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 -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.openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
48EBFD22D17F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.731s
user	0m4.402s
sys	0m2.043s
+ 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 a0iyplxj8lgp
+ echo a
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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 -v ++ echo a
0 a0iyplxj8lgp
++ ./pegh.openssl -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.openssl -e -v 0 a0iyplxj8lgp
+ 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
+ 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.openssl -e -v 0 a0iyplxj8lgp + -i /tmp/randombytes100
./pegh.libsodium-openssl -d a0iyplxj8lgp-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.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.openssl -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
484B7B09EE7F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 0 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.210s
user	0m3.989s
sys	0m1.906s
+ test ./pegh.openssl ./pegh.libsodium-openssl -v 1
testing binaries bin: ./pegh.openssl bin_decrypt: ./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 '!=' 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 a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.openssl -v 1 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
./pegh.libsodium-openssl -d a0iyplxj8lgp
+ 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.libsodium-openssl -d -f + /tmp/leading_zero_keycmp - 
/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 a0iyplxj8lgp -i /tmp/randombytes100
+ + ./pegh.libsodium-openssl cmp -d a0iyplxj8lgp-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.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.openssl -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
480B0AB9F97F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.441s
user	0m4.178s
sys	0m1.930s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.openssl ./pegh.static.libsodium
+ bin=./pegh.openssl
+ shift
testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ echo 'testing binaries bin: ./pegh.openssl bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ ./pegh.openssl a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ ./pegh.openssl a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ ./pegh.openssl -e a0iyplxj8lgp
+ 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
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.openssl -e a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 -f /tmp/leading_zero_key_a
./pegh.static.libsodium -d + cmp - /tmp/randombytes100
-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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
482BB647C97F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
++ + echo -n a
./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.633s
user	0m4.405s
sys	0m1.931s
+ 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.static.libsodium -d a0iyplxj8lgp
./pegh.openssl -v 0 a0iyplxj8lgp
+ '[' 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'
++ ++ ./pegh.openssl -v 0 a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
echo a
++ echo a
++ ./pegh.openssl -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.openssl -e -v 0 a0iyplxj8lgp
+ 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.static.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.openssl -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp + ./pegh.static.libsodium -d a0iyplxj8lgp-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.openssl -e -v 0 -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 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
48DB9ED9257F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.336s
user	0m4.130s
sys	0m1.877s
+ 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

++ echo a+ 
cmp /dev/fd/63 /dev/fd/62
++ ++ echo a
./pegh.openssl -v 1 a0iyplxj8lgp
++ ./pegh.openssl -v 1 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.libsodium + -d cmp - /tmp/randombytes100
a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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 -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 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 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 -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.openssl -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
486B4244FE7E0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium + cat - /dev/fd/63
-d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.516s
user	0m4.282s
sys	0m1.934s
+ 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 ']'
+ echo a
+ ./pegh.openssl a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ ./pegh.openssl a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ + cmp - /tmp/randombytes100
./pegh.libsodium -d a0iyplxj8lgp
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.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.openssl -e a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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 -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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
48EBEBF9D67F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.392s
user	0m4.163s
sys	0m1.883s
+ 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 a0iyplxj8lgp
./pegh.openssl -v 0 a0iyplxj8lgp
+ '[' 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 -v 0 a0iyplxj8lgp
++ ./pegh.openssl -v 0 a0iyplxj8lgp
++ 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 0 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ 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'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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 0 -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 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
480B6D2FA77F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 0 a0iyplxj8lgp
+ ./pegh.libsodium + cat - /dev/fd/63
-d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.426s
user	0m4.123s
sys	0m1.984s
+ 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
++ ./pegh.openssl -v 1 a0iyplxj8lgp
++ echo a
++ ./pegh.openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp
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'
encrypting with one key and decrypting with another should fail
+ ./pegh.openssl -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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
+ ./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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error
489B3493F17F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:providers/implementations/kdfs/scrypt.c:521:
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ + cat - /dev/fd/63
++ echo -n a
./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.592s
user	0m4.357s
sys	0m1.920s
+ 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
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
+ '[' '' '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ '[' 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'
++ echo a
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium-openssl a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ + cmp - /tmp/randombytes100
./pegh.static.openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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
+ 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 a0iyplxj8lgp -i /tmp/randombytes100
+ + cmp ./pegh.static.openssl -d a0iyplxj8lgp-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
+ ./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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ + ./pegh.static.openssl -d a0iyplxj8lgp -o cat - /dev/fd/63
bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.330s
user	0m4.153s
sys	0m1.785s
+ test ./pegh.static.libsodium-openssl ./pegh.static.openssl -v 0
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./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
+ '[' 0 '!=' 1 ']'
+ echo a+ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp

+ ./pegh.static.openssl -d a0iyplxj8lgp
+ '[' 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
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
++ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ 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 /tmp/leading_zero_key
+ ./pegh.static.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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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 -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'
large values of N without enough memory should fail
+ ./pegh.static.libsodium-openssl -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat + ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
- /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.444s
user	0m4.109s
sys	0m1.966s
+ 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
++ ./pegh.static.libsodium-openssl -v 1 a0iyplxj8lgp++ 
echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -e -v 1 a0iyplxj8lgp
+ 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
+ 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 -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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.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-openssl -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.openssl + -d a0iyplxj8lgp -o cat bla.txt- 
/dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.605s
user	0m4.247s
sys	0m1.942s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.openssl
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./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
+ ./pegh.static.libsodium-openssl a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ '[' 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'
++ ./pegh.static.libsodium-openssl a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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 a0iyplxj8lgp + -i /tmp/randombytes100
./pegh.openssl -d + cmp - a0iyplxj8lgp-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.static.libsodium-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.static.libsodium-openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
++ + cat - echo -n a
+ ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
/dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.493s
user	0m4.103s
sys	0m2.021s
+ 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'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 + ./pegh.openssl -d a0iyplxj8lgp
a0iyplxj8lgp
+ '[' 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'
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 + ./pegh.openssl -d a0iyplxj8lgp
a0iyplxj8lgp
+ 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.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 + ./pegh.openssl -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
-d a0iyplxj8lgp-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 -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.static.libsodium-openssl -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.252s
user	0m3.850s
sys	0m1.955s
+ test ./pegh.static.libsodium-openssl ./pegh.openssl -v 1
+ 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 '!=' 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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.openssl -d + cmp - /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.libsodium-openssl -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100+ 
+ cmp - /tmp/randombytes100
./pegh.openssl -d a0iyplxj8lgp-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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 + ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
a0iyplxj8lgp
+ + echo cat - /dev/fd/63
'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.600s
user	0m4.375s
sys	0m1.806s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium-openssl
+ bin=./pegh.static.libsodium-openssl
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./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 ']'
+ + ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
echo a
+ ./pegh.static.libsodium-openssl a0iyplxj8lgp
+ '[' 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 
a0iyplxj8lgp
++ ./pegh.static.libsodium-openssl a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
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
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 + cmp + ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-wrongkey
- /tmp/randombytes100
a0iyplxj8lgp -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.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-openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ ++ echo cat -n a
- /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.913s
user	0m3.612s
sys	0m1.917s
+ 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 +eutesting binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.static.libsodium-openssl

+ '[' 0 '!=' 1 ']'
+ + ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl echo a-v 0 
a0iyplxj8lgp
+ '[' 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
++ ++ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
+ echo cmp /dev/fd/63 /dev/fd/62
a
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ + cmp - /tmp/randombytes100
./pegh.static.libsodium-openssl -d a0iyplxj8lgp
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.libsodium-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 a0iyplxj8lgp + ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-wrongkey
-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 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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp -o bla.txt
+ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.827s
user	0m3.518s
sys	0m1.901s
+ 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
++ ./pegh.static.libsodium-openssl -v 1 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ 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
+ 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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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 -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-openssl -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.174s
user	0m3.950s
sys	0m1.823s
+ 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
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 ']'
+ echo a
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium-openssl a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ 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.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 a0iyplxj8lgp -i /tmp/randombytes100
+ + ./pegh.libsodium-openssl -d a0iyplxj8lgp-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
+ ./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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.705s
user	0m3.511s
sys	0m1.906s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 0
+ bin=./pegh.static.libsodium-openssl
+ shift
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ 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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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
+ ++ ./pegh.static.libsodium-openssl cmp -v 0 a0iyplxj8lgp/dev/fd/63 
/dev/fd/62
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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.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 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp-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 -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 -
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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp+ 
./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.906s
user	0m3.589s
sys	0m1.872s
+ test ./pegh.static.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.static.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
testing binaries bin: ./pegh.static.libsodium-openssl 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'
encrypting same data with same key should result in different ciphertext
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium-openssl -v 1 a0iyplxj8lgp
++ echo ++ a
echo a
++ ./pegh.static.libsodium-openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
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
+ 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-openssl -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp-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 -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.static.libsodium-openssl -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
+ cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.159s
user	0m4.025s
sys	0m1.818s
+ 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 -d a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -e a0iyplxj8lgp
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 + -d cmp -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-openssl -e + a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 -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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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-openssl a0iyplxj8lgp
'hopefully this doesnt make it to disk'
+ ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.972s
user	0m3.692s
sys	0m1.848s
+ test ./pegh.static.libsodium-openssl ./pegh.static.libsodium -v 0
+ 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
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp
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.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.static.libsodium-openssl -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 -v 0 -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-openssl -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp

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

real	0m4.925s
user	0m3.591s
sys	0m1.856s
+ 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
++ ./pegh.static.libsodium-openssl -v 1 a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.static.libsodium-openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ 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 + ./pegh.static.libsodium -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-openssl -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 -v + 1 ./pegh.static.libsodium -d -f -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.libsodium-openssl -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.233s
user	0m3.970s
sys	0m1.844s
+ 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ ./pegh.static.libsodium-openssl a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ 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
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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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
+ 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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.899s
user	0m3.595s
sys	0m1.885s
+ 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 ']'
+ + ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
echo a
+ ./pegh.libsodium -d a0iyplxj8lgp
+ '[' 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.libsodium-openssl -v 0 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium-openssl -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
./pegh.static.libsodium-openssl + cmp - /tmp/randombytes100
-e -v 0 a0iyplxj8lgp
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 -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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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 -v 0 -f /tmp/leading_zero_key_a
+ ./pegh.libsodium -d -f + cmp - /tmp/randombytes100
/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 -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
++ echo -n a
+ cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.868s
user	0m3.541s
sys	0m1.893s
+ 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'
testing binaries bin: ./pegh.static.libsodium-openssl bin_decrypt: ./pegh.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'
++ echo + a++ cmp /dev/fd/63 /dev/fd/62./pegh.static.libsodium-openssl 
-v 1 a0iyplxj8lgp

++ echo a
++ ./pegh.static.libsodium-openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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
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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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 -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 -
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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ + cat - /dev/fd/63
./pegh.libsodium -d a0iyplxj8lgp ++ -o bla.txt
echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.662s
user	0m4.274s
sys	0m2.024s
+ 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 ']'
+ echo a
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ ./pegh.libsodium-openssl a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
echo a
++ ./pegh.libsodium-openssl a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ 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
+ 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-openssl -e a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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 + cmp - /tmp/randombytes100
-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.libsodium-openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.281s
user	0m4.021s
sys	0m2.011s
+ 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 ']'
+ echo a
+ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ '[' 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
++ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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
+ ./pegh.static.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.libsodium-openssl -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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
+ 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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.451s
user	0m4.157s
sys	0m1.855s
+ test ./pegh.libsodium-openssl ./pegh.static.openssl -v 1
+ 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
+ '[' 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-openssl -v 1 a0iyplxj8lgp
echo a
++ ./pegh.libsodium-openssl -v 1 a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -e -v 1 a0iyplxj8lgp
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.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 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.567s
user	0m4.302s
sys	0m1.921s
+ 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 ']'
+ echo a
+ ./pegh.libsodium-openssl a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ '[' 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'
++ echo + acmp /dev/fd/63 /dev/fd/62

++ echo a
++ ./pegh.libsodium-openssl a0iyplxj8lgp
++ ./pegh.libsodium-openssl a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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.libsodium-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.openssl -d a0iyplxj8lgp-wrongkey
+ ./pegh.libsodium-openssl -e a0iyplxj8lgp -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 -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.libsodium-openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.322s
user	0m3.901s
sys	0m1.920s
+ 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 ']'
+ echo a
+ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ '[' 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'
++ ++ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
echo a
++ echo a
++ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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
+ 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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.openssl + cmp - /tmp/randombytes100
-d a0iyplxj8lgp-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 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.libsodium-openssl -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp -o bla.txt
+ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.309s
user	0m3.896s
sys	0m1.995s
+ 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 echo /dev/fd/63 /dev/fd/62
./pegh.libsodium-openssl -v 1 a0iyplxj8lgp
a
++ echo a
++ ./pegh.libsodium-openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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 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-openssl -e -v + 1 a0iyplxj8lgp -i /tmp/randombytes100
./pegh.openssl -d + a0iyplxj8lgp-wrongkeycmp 
- /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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 + ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
-v 1 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.533s
user	0m4.215s
sys	0m1.951s
+ 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 ']'
+ echo a
+ + ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
./pegh.libsodium-openssl a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ ./pegh.libsodium-openssl a0iyplxj8lgp
++ 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 + ./pegh.libsodium-openssl -e a0iyplxj8lgp
- /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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
'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium-openssl -e a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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 + cmp - /tmp/randombytes100
-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-openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp -o bla.txt
./pegh.libsodium-openssl a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.933s
user	0m3.567s
sys	0m1.935s
+ 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 ']'
+ echo a
+ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ 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
+ ./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 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl + cmp - /tmp/randombytes100
-d a0iyplxj8lgp-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 0 -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'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.919s
user	0m3.571s
sys	0m1.906s
+ test ./pegh.libsodium-openssl ./pegh.static.libsodium-openssl -v 1
+ 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 '!=' 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 a0iyplxj8lgp
++ ./pegh.libsodium-openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ + cmp ./pegh.libsodium-openssl - -e /tmp/randombytes100
-v 1 a0iyplxj8lgp
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 + cmp - /tmp/randombytes100
-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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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 + ./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.libsodium-openssl -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.269s
user	0m4.024s
sys	0m1.804s
+ 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 ']'
+ echo a
+ ./pegh.libsodium-openssl + ./pegh.libsodium-openssl -d a0iyplxj8lgp
a0iyplxj8lgp
+ '[' 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'
++ echo a
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl a0iyplxj8lgp
++ echo a
++ ./pegh.libsodium-openssl a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -e a0iyplxj8lgp
+ 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
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 a0iyplxj8lgp -i /tmp/randombytes100
./pegh.libsodium-openssl -d a0iyplxj8lgp-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
+ ./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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.958s
user	0m3.641s
sys	0m1.923s
+ 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 ']'
+ echo a
+ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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 ++ echo a
/dev/fd/62
./pegh.libsodium-openssl ++ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
-v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ 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.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 0 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp-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 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.libsodium-openssl -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.023s
user	0m3.704s
sys	0m1.929s
+ test ./pegh.libsodium-openssl ./pegh.libsodium-openssl -v 1
+ bin=./pegh.libsodium-openssl
+ shift
+ bin_decrypt=./pegh.libsodium-openssl
+ shift
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium-openssl
+ 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'
encrypting same data with same key should result in different ciphertext
+ ++ cmp /dev/fd/63 /dev/fd/62
./pegh.libsodium-openssl -v 1 a0iyplxj8lgp
++ echo a
++ ++ echo ./pegh.libsodium-openssl a
-v 1 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 1 a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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 -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp-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.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-openssl -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.209s
user	0m3.902s
sys	0m1.928s
+ 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.libsodium-openssl a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ '[' 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'
++ echo a
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl a0iyplxj8lgp
++ echo a
++ ./pegh.libsodium-openssl a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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 + ./pegh.static.libsodium -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.libsodium-openssl -e a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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
+ ./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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.863s
user	0m3.541s
sys	0m1.889s
+ 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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ '[' 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
++ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -e -v 0 a0iyplxj8lgp
+ 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.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.libsodium-openssl -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium + cmp - /tmp/randombytes100
-d a0iyplxj8lgp-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 0 -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 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp+ ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt

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

real	0m4.813s
user	0m3.449s
sys	0m1.948s
+ 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 ']'
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.libsodium-openssl -v 1 a0iyplxj8lgp
++ echo a
++ ./pegh.libsodium-openssl -v 1 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -e -v 1 a0iyplxj8lgp
+ 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.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-openssl -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 + ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
-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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.225s
user	0m3.955s
sys	0m1.856s
+ 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ '[' 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
++ ./pegh.libsodium-openssl a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium-openssl a0iyplxj8lgp
/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 + ./pegh.libsodium-openssl -e a0iyplxj8lgp
-d + cmp - /tmp/randombytes100
a0iyplxj8lgp
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
+ 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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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
+ ./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.libsodium-openssl -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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.libsodium-openssl a0iyplxj8lgp
++ echo -n a
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.858s
user	0m3.579s
sys	0m1.881s
testing binaries bin: ./pegh.libsodium-openssl bin_decrypt: ./pegh.libsodium
+ 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 a0iyplxj8lgp
+ echo a
+ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
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 a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -e -v 0 a0iyplxj8lgp
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-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 + a0iyplxj8lgp -i /tmp/randombytes100./pegh.libsodium 
-d a0iyplxj8lgp-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 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'
large values of N without enough memory should fail
+ ./pegh.libsodium-openssl -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp -o bla.txt
+ ./pegh.libsodium-openssl -v 0 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.830s
user	0m3.410s
sys	0m1.861s
+ 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
++ echo a
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium-openssl -v 1 a0iyplxj8lgp
++ echo a
++ ./pegh.libsodium-openssl -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp
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+ cmp - /tmp/randombytes100

+ ./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 -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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 ./pegh.libsodium -f -d /tmp/leading_zero_key_a-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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.249s
user	0m3.987s
sys	0m1.849s
+ 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.static.libsodium a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ 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.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 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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 + ./pegh.static.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.static.libsodium -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 + a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp -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	0m5.361s
user	0m3.952s
sys	0m1.922s
+ 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ '[' 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 -v 0 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ 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 0 -f /tmp/leading_zero_key
+ ./pegh.static.openssl + cmp - /tmp/randombytes100
-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 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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 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 -
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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.305s
user	0m4.061s
sys	0m1.801s
+ 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
+ echo 'testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.static.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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium -v 1 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ 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.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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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 - /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 -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ + cat ./pegh.static.openssl - /dev/fd/63
-d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.539s
user	0m4.223s
sys	0m1.892s
+ 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.static.libsodium a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ '[' 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'
++ echo + cmp /dev/fd/63 /dev/fd/62
a
++ ./pegh.static.libsodium a0iyplxj8lgp
++ ./pegh.static.libsodium a0iyplxj8lgp
++ 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 -e a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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.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 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d a0iyplxj8lgp-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
+ cmp + ./pegh.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.static.libsodium -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
++ echo -n a
./pegh.openssl -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.297s
user	0m3.836s
sys	0m2.051s
+ 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'
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.static.libsodium -v 0 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ '[' 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.static.libsodium -v 0 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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.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 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.openssl -d a0iyplxj8lgp-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.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 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ + ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.387s
user	0m4.077s
sys	0m1.887s
+ test ./pegh.static.libsodium ./pegh.openssl -v 1
+ 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
+ '[' 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 a0iyplxj8lgp
++ ./pegh.static.libsodium -v 1 a0iyplxj8lgp
++ 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.static.libsodium -e -v 1 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d a0iyplxj8lgp
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.static.libsodium -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.libsodium -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.openssl -d a0iyplxj8lgp-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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.356s
user	0m4.161s
sys	0m1.754s
+ 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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ ++ echo a
++ ./pegh.static.libsodium a0iyplxj8lgp
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 a0iyplxj8lgp
+ ./pegh.static.libsodium -e a0iyplxj8lgp
+ 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
+ cmp - /tmp/randombytes100
+ ./pegh.static.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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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 -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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ ++ cat echo -n - a
/dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.719s
user	0m3.502s
sys	0m1.834s
+ 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 ']'
+ echo a+ ./pegh.static.libsodium -v 0 a0iyplxj8lgp

+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo ++ ./pegh.static.libsodium -v 0 a0iyplxj8lgp
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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ 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 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
+ ./pegh.static.libsodium -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d + a0iyplxj8lgp-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
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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ + ./pegh.static.libsodium -v 0 a0iyplxj8lgp
echo -n a
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	0m4.858s
user	0m3.523s
sys	0m1.812s
+ 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium -v 1 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ 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-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 a0iyplxj8lgp -i + cmp - /tmp/randombytes100
/tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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 -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'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.337s
user	0m3.968s
sys	0m1.706s
+ 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.static.libsodium a0iyplxj8lgp
./pegh.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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/62echo 
a
++ ./pegh.static.libsodium a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium a0iyplxj8lgp
/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 a0iyplxj8lgp
+ + cmp - /tmp/randombytes100
./pegh.libsodium-openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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
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 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp-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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
testing binaries bin: ./pegh.static.libsodium bin_decrypt: ./pegh.libsodium-openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m4.711s
user	0m3.281s
sys	0m1.511s
+ 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.libsodium-openssl -d a0iyplxj8lgp
+ ./pegh.static.libsodium -v 0 a0iyplxj8lgp
+ '[' 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 -v 0 a0iyplxj8lgp
echo a
++ echo a
++ ./pegh.static.libsodium -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ 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 + ./pegh.static.libsodium -e -v 0 -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.libsodium -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ + ./pegh.libsodium-openssl -d a0iyplxj8lgp-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
+ + 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 -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 0 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.974s
user	0m3.453s
sys	0m1.772s
+ test ./pegh.static.libsodium ./pegh.libsodium-openssl -v 1
+ 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
+ '[' 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium -v 1 a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ 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.libsodium-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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp-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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -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	0m5.418s
user	0m4.035s
sys	0m1.808s
+ 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 a0iyplxj8lgp
+ ./pegh.static.libsodium a0iyplxj8lgp
+ 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'
++ ++ ./pegh.static.libsodium a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
echo a
++ echo a
++ ./pegh.static.libsodium a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp
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.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
+ ./pegh.static.libsodium + ./pegh.static.libsodium -d a0iyplxj8lgp-wrongkey
-e a0iyplxj8lgp -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 + ./pegh.static.libsodium -e -f /tmp/leading_zero_key_a
/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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d a0iyplxj8lgp ++ echo -n a
-o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.020s
user	0m3.527s
sys	0m2.015s
+ 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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
echo a
++ echo a
++ ./pegh.static.libsodium -v 0 a0iyplxj8lgp
/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 0 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ 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.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 + a0iyplxj8lgp-wrongkey
+ cmp - /tmp/randombytes100
./pegh.static.libsodium -e -v 0 a0iyplxj8lgp -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 -v 0 -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 -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.980s
user	0m3.556s
sys	0m2.018s
+ 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
+ encrypting same data with same key should result in different ciphertext
echo 'encrypting same data with same key should result in different ciphertext'
++ echo a+ cmp /dev/fd/63 /dev/fd/62

++ ./pegh.static.libsodium -v 1 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium -v 1 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ 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
+ 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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 -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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo + -n ./pegh.static.libsodium a-d 
a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.321s
user	0m3.980s
sys	0m1.905s
+ 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.libsodium -d a0iyplxj8lgp
+ ./pegh.static.libsodium a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp
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
+ 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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d + a0iyplxj8lgp-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_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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.893s
user	0m3.608s
sys	0m1.842s
+ 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 ']'
+ echo a
+ ./pegh.static.libsodium -v 0 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ '[' 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
++ ./pegh.static.libsodium -v + cmp /dev/fd/63 /dev/fd/62
0 a0iyplxj8lgp
++ echo a
++ ./pegh.static.libsodium -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ 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 0 -f /tmp/leading_zero_key
+ cmp - /tmp/randombytes100
+ ./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.static.libsodium -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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
+ 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.libsodium -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.035s
user	0m3.652s
sys	0m1.934s
+ 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
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
++ ++ ./pegh.static.libsodium -v 1 a0iyplxj8lgp
echo a
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.static.libsodium -v 1 a0iyplxj8lgp
++ 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 -e -v 1 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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 -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 a0iyplxj8lgp-wrongkey
+ ./pegh.static.libsodium -e -v 1 a0iyplxj8lgp -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 -e -v 1 -f + cmp - /tmp/randombytes100
/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'
large values of N without enough memory should fail
+ ./pegh.static.libsodium -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.openssl
+ '[' -s bla.txt ']'
+ set -e

real	0m5.189s
user	0m3.931s
sys	0m1.852s
+ 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 a0iyplxj8lgp
+ echo a
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ '[' 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++ ./pegh.libsodium a0iyplxj8lgp
+ 
cmp /dev/fd/63 /dev/fd/62
++ echo a
++ ./pegh.libsodium a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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
encrypting with one key and decrypting with another should fail
+ echo 'encrypting with one key and decrypting with another should fail'
+ ./pegh.libsodium -e + ./pegh.static.openssl -d a0iyplxj8lgp-wrongkey
a0iyplxj8lgp -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.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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.407s
user	0m4.105s
sys	0m1.861s
+ 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 ']'
+ echo a
+ ./pegh.libsodium -v 0 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ '[' 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
+ ++ ./pegh.libsodium -v 0 a0iyplxj8lgp
++ echo a
++ ./pegh.libsodium -v 0 a0iyplxj8lgp
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.libsodium -e -v 0 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ 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 -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 -e -v + ./pegh.static.openssl -d a0iyplxj8lgp-wrongkey
0 a0iyplxj8lgp -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 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.libsodium -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 0 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.452s
user	0m4.084s
sys	0m1.958s
+ 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 echo /dev/fd/63 a/dev/fd/62

++ ./pegh.libsodium -v 1 a0iyplxj8lgp
++ echo a++ ./pegh.libsodium -v 1 a0iyplxj8lgp

/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp
+ 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 + ./pegh.static.openssl -d -f /tmp/leading_zero_key
-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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.openssl -d a0iyplxj8lgp-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 1 -f /tmp/leading_zero_key_a
+ ./pegh.static.openssl + cmp - -d /tmp/randombytes100
-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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 + cat - /dev/fd/63
++ echo -n a
-v 1 a0iyplxj8lgp
+ ./pegh.static.openssl -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.607s
user	0m4.265s
sys	0m1.869s
+ 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 a0iyplxj8lgp
./pegh.libsodium a0iyplxj8lgp
+ '[' 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 ++ echo a
a0iyplxj8lgp
++ ++ echo a
./pegh.libsodium a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.libsodium -e a0iyplxj8lgp
+ 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.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 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - + ./pegh.openssl -d a0iyplxj8lgp-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 -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.libsodium -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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.libsodium a0iyplxj8lgp
++ echo -n a
+ ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.375s
user	0m4.057s
sys	0m1.904s
+ 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'
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.openssl
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -v 0 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ '[' 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.libsodium -v 0 a0iyplxj8lgp
./pegh.libsodium -v 0 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp
+ 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 -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.libsodium -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d a0iyplxj8lgp-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 -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.libsodium -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.324s
user	0m3.971s
sys	0m1.977s
+ 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'
++ ++ ./pegh.libsodium -v 1 a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
echo a
++ echo a
++ ./pegh.libsodium -v 1 a0iyplxj8lgp
/dev/fd/63 /dev/fd/62 differ: 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.openssl -d a0iyplxj8lgp
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 + ./pegh.openssl -d -f /tmp/leading_zero_key
-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 a0iyplxj8lgp -i /tmp/randombytes100
+ + cmp - /tmp/randombytes100./pegh.openssl 
-d a0iyplxj8lgp-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 -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.libsodium -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ++ echo -n a
./pegh.openssl -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.692s
user	0m4.257s
sys	0m1.990s
+ for bin_decrypt in $TEST_BINS
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium-openssl
+ shift
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium-openssl'
+ set +eu
+ '[' '' '!=' 1 ']'
+ echo a
+ + ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
./pegh.libsodium a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ ./pegh.libsodium a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
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 ./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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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.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.libsodium -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ + cat - /dev/fd/63
./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.941s
user	0m3.516s
sys	0m1.968s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 0
testing binaries bin: ./pegh.libsodium bin_decrypt: ./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
+ '[' 0 '!=' 1 ']'
+ + ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ echo ./pegh.libsodium a-v 
0 a0iyplxj8lgp
+ '[' 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
./pegh.libsodium -v + cmp /dev/fd/63 /dev/fd/62
0 a0iyplxj8lgp
++ echo a
++ ./pegh.libsodium -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
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 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
+ ./pegh.libsodium -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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 ./pegh.static.libsodium-openssl -d -e -f /tmp/leading_zero_key_b-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.libsodium -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 0 a0iyplxj8lgp
+ cat - /dev/fd/63
++ echo -n a
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.038s
user	0m3.563s
sys	0m2.044s
+ test ./pegh.libsodium ./pegh.static.libsodium-openssl -v 1
testing binaries bin: ./pegh.libsodium bin_decrypt: ./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 '!=' 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 a0iyplxj8lgp
++ echo a
++ echo a
++ ./pegh.libsodium -v 1 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp
+ 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.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.libsodium -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ cmp - /tmp/randombytes100
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp-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 -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.libsodium -e -v 1 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 ./pegh.libsodium -v 1 a0iyplxj8lgp
+ ./pegh.static.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
- /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium-openssl

real	0m5.161s
user	0m3.877s
sys	0m1.862s
+ 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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ 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'
++ echo a
+ cmp /dev/fd/63 /dev/fd/62
++ ./pegh.libsodium a0iyplxj8lgp
++ ./pegh.libsodium a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100+ 
./pegh.libsodium-openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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
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 a0iyplxj8lgp -i /tmp/randombytes100
+ + ./pegh.libsodium-openssl cmp -d - a0iyplxj8lgp-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 -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.libsodium -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ + cat - /dev/fd/63
./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.057s
user	0m3.531s
sys	0m2.152s
+ 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 ']'
+ echo a
+ ./pegh.libsodium -v 0 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ '[' 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 a0iyplxj8lgp
++ echo a
++ ./pegh.libsodium -v 0 a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.libsodium -e -v 0 a0iyplxj8lgp
+ 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 -v 0 -f /tmp/leading_zero_key
+ ./pegh.libsodium-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.libsodium -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
+ + cmp - /tmp/randombytes100./pegh.libsodium-openssl 
-d a0iyplxj8lgp-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 -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 -
large values of N without enough memory should fail
+ echo 'large values of N without enough memory should fail'
+ ./pegh.libsodium -e -v 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp -o bla.txt
./pegh.libsodium -v 0 a0iyplxj8lgp
+ cat - /dev/fd/63
+ echo 'hopefully this doesnt make it to disk'
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.857s
user	0m3.444s
sys	0m2.032s
+ 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
++ + ++ ./pegh.libsodium -v 1 cmp a0iyplxj8lgp
/dev/fd/63 /dev/fd/62
echo a
++ ./pegh.libsodium -v 1 a0iyplxj8lgp
++ 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 a0iyplxj8lgp+ cmp - /tmp/randombytes100

+ ./pegh.libsodium-openssl -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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-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.libsodium -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp-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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.libsodium-openssl -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
echo ++ echo -n a
'hopefully this doesnt make it to disk'
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.245s
user	0m3.944s
sys	0m1.960s
+ 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 ']'
+ echo a
+ ./pegh.libsodium a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ '[' 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 ++ ./pegh.libsodium a0iyplxj8lgp
a
++ echo a
++ ./pegh.libsodium a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.static.libsodium -d a0iyplxj8lgp
+ 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.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.libsodium -e a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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.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.libsodium -e a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ + ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.103s
user	0m3.609s
sys	0m2.031s
+ test ./pegh.libsodium ./pegh.static.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.static.libsodium
+ shift
+ testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium
echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.static.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ + ./pegh.libsodium ./pegh.static.libsodium -v -d 0 a0iyplxj8lgpa0iyplxj8lgp

+ '[' 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.libsodium -v 0 a0iyplxj8lgp
++ ./pegh.libsodium -v 0 a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 0 a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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 -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 0 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 -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 0 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 0 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.static.libsodium ++ echo -n a
-d a0iyplxj8lgp -o bla.txt
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.971s
user	0m3.520s
sys	0m1.846s
+ 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
./pegh.libsodium -v 1 a0iyplxj8lgp
++ echo a
++ ./pegh.libsodium -v 1 a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ ./pegh.static.libsodium + -d a0iyplxj8lgp
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 -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.libsodium -e -v 1 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.static.libsodium -d a0iyplxj8lgp-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 cmp -v - /tmp/randombytes100
+ ./pegh.static.libsodium -d -f /tmp/leading_zero_key_b
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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.static.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ cat - /dev/fd/63
+ ./pegh.static.libsodium -d a0iyplxj8lgp -o bla.txt
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m5.382s
user	0m4.022s
sys	0m1.908s
+ 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 ']'
+ echo a
+ ./pegh.libsodium a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ '[' 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'
++ ./pegh.libsodium a0iyplxj8lgp
+ cmp /dev/fd/63 /dev/fd/62
++ echo a
++ echo a
++ ./pegh.libsodium a0iyplxj8lgp
/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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ 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
+ ./pegh.libsodium -e a0iyplxj8lgp + -i /tmp/randombytes100
./pegh.libsodium -d a0iyplxj8lgp-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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
+ ++ echo -n a
cat - /dev/fd/63
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.889s
user	0m3.554s
sys	0m1.939s
+ test ./pegh.libsodium ./pegh.libsodium -v 0
+ bin=./pegh.libsodium
+ shift
+ bin_decrypt=./pegh.libsodium
+ shift
testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium
+ echo 'testing binaries bin: ./pegh.libsodium bin_decrypt: ./pegh.libsodium'
+ set +eu
+ '[' 0 '!=' 1 ']'
+ echo a
+ ./pegh.libsodium -v + 0 ./pegh.libsodium a0iyplxj8lgp-d a0iyplxj8lgp

+ '[' 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 a0iyplxj8lgp
++ ++ ./pegh.libsodium -v 0 a0iyplxj8lgp
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 -e -v 0 a0iyplxj8lgp
+ cmp - /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp
+ echo 'encrypting/decrypting with key in file should work, even when key has 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
+ 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 + cmp - /tmp/randombytes100
+ ./pegh.libsodium -e -v 0 a0iyplxj8lgp -i /tmp/randombytes100
-d a0iyplxj8lgp-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 -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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, we only support version 0 (AES-256-GCM) and 1 (Chacha20-Poly1305)
Error: decryption aborting, this file cannot be decrypted with this version/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 0 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat - /dev/fd/63
++ echo -n a
decryption failed
+ '[' -s bla.txt ']'
+ set -e

real	0m4.798s
user	0m3.382s
sys	0m1.911s
+ 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
encrypting same data with same key should result in different ciphertext
+ echo 'encrypting same data with same key should result in different ciphertext'
+ ++ cmp echo /dev/fd/63 a/dev/fd/62

++ ./pegh.libsodium -v 1 a0iyplxj8lgp
++ ./pegh.libsodium -v 1 a0iyplxj8lgp
++ 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp
+ 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 -v + ./pegh.libsodium -d -f /tmp/leading_zero_key
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 a0iyplxj8lgp -i /tmp/randombytes100
+ ./pegh.libsodium -d a0iyplxj8lgp-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_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 a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
scrypt key derivation error, needed memory 2049 mb, allowed memory 64 mb, increase -m
+ ./pegh.libsodium -d a0iyplxj8lgp -N 2000000 -i /tmp/randombytes100
next_highest_power_of_2 out: 2097151
Error: unsupported file format version 155, 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 a0iyplxj8lgp
+ ./pegh.libsodium -d a0iyplxj8lgp -o bla.txt
+ cat ++ echo -n a
- /dev/fd/63
decryption failed
successful test run!
successfully built and tested static pegh against libsodium and openssl!
+ '[' -s bla.txt ']'
+ set -e

real	0m5.490s
user	0m4.034s
sys	0m2.081s
+ 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/9) Installing ca-certificates (20230506-r0)
(2/9) Installing brotli-libs (1.0.9-r14)
(3/9) Installing libunistring (1.1-r1)
(4/9) Installing libidn2 (2.3.4-r1)
(5/9) Installing nghttp2-libs (1.55.1-r0)
(6/9) Installing libcurl (8.2.1-r0)
(7/9) Installing libexpat (2.5.0-r1)
(8/9) Installing pcre2 (10.42-r1)
(9/9) Installing git (2.40.1-r0)
Executing busybox-1.36.1-r2.trigger
Executing ca-certificates-20230506-r0.trigger
OK: 526 MiB in 62 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
+ '[' amd64 '==' amd64 ]
going to try to build windows here...
+ echo 'going to try to build windows here...'
+ apk add mingw-w64-gcc curl wine
(1/77) Installing curl (8.2.1-r0)
(2/77) Installing mingw-w64-binutils (2.40-r1)
(3/77) Installing mingw-w64-crt (11.0.0-r0)
(4/77) Installing mingw-w64-headers (11.0.0-r0)
(5/77) Installing mingw-w64-winpthreads (11.0.0-r0)
(6/77) Installing mingw-w64-gcc (12.2.0-r3)
(7/77) Installing libxau (1.0.11-r2)
(8/77) Installing libmd (1.0.4-r2)
(9/77) Installing libbsd (0.11.7-r1)
(10/77) Installing libxdmcp (1.1.4-r2)
(11/77) Installing libxcb (1.15-r1)
(12/77) Installing libx11 (1.8.4-r4)
(13/77) Installing libxext (1.3.5-r2)
(14/77) Installing libxi (1.8.1-r0)
(15/77) Installing libxrender (0.9.11-r3)
(16/77) Installing libxrandr (1.5.3-r2)
(17/77) Installing opencl (2023.04.17-r1)
(18/77) Installing alsa-lib (1.2.9-r1)
(19/77) Installing libintl (0.21.1-r7)
(20/77) Installing libblkid (2.38.1-r8)
(21/77) Installing libmount (2.38.1-r8)
(22/77) Installing glib (2.76.4-r0)
(23/77) Installing libexif (0.6.24-r1)
(24/77) Installing libjpeg-turbo (2.1.5.1-r3)
(25/77) Installing libltdl (2.4.7-r2)
(26/77) Installing libusb (1.0.26-r2)
(27/77) Installing libgphoto2 (2.5.30-r0)
Executing libgphoto2-2.5.30-r0.pre-install
(28/77) Installing mesa (23.0.4-r0)
(29/77) Installing hwdata-pci (0.370-r0)
(30/77) Installing libpciaccess (0.17-r2)
(31/77) Installing libdrm (2.4.115-r4)
(32/77) Installing wayland-libs-server (1.22.0-r2)
(33/77) Installing mesa-gbm (23.0.4-r0)
(34/77) Installing mesa-glapi (23.0.4-r0)
(35/77) Installing wayland-libs-client (1.22.0-r2)
(36/77) Installing libxshmfence (1.3.2-r2)
(37/77) Installing mesa-egl (23.0.4-r0)
(38/77) Installing libxfixes (6.0.1-r2)
(39/77) Installing libxxf86vm (1.1.5-r3)
(40/77) Installing mesa-gl (23.0.4-r0)
(41/77) Installing libxv (1.0.12-r3)
(42/77) Installing libbz2 (1.0.8-r5)
(43/77) Installing libpng (1.6.39-r3)
(44/77) Installing freetype (2.13.0-r5)
(45/77) Installing fontconfig (2.14.2-r3)
(46/77) Installing pixman (0.42.2-r1)
(47/77) Installing cairo (1.17.8-r1)
(48/77) Installing cdparanoia-libs (10.2-r14)
(49/77) Installing graphene (1.10.8-r2)
(50/77) Installing libcap2 (2.69-r0)
(51/77) Installing gstreamer (1.22.5-r0)
(52/77) Installing libogg (1.3.5-r4)
(53/77) Installing opus (1.4-r0)
(54/77) Installing orc (0.4.34-r0)
(55/77) Installing libxft (2.3.8-r1)
(56/77) Installing fribidi (1.0.13-r0)
(57/77) Installing graphite2 (1.3.14-r5)
(58/77) Installing harfbuzz (7.3.0-r0)
(59/77) Installing pango (1.50.14-r1)
(60/77) Installing libtheora (1.1.1-r17)
(61/77) Installing libvorbis (1.3.7-r1)
(62/77) Installing wayland-libs-cursor (1.22.0-r2)
(63/77) Installing wayland-libs-egl (1.22.0-r2)
(64/77) Installing gst-plugins-base (1.22.5-r0)
(65/77) Installing libpcap (1.10.4-r1)
(66/77) Installing pcsc-lite-libs (1.9.9-r3)
(67/77) Installing libasyncns (0.8-r1)
(68/77) Installing dbus-libs (1.14.8-r0)
(69/77) Installing flac-libs (1.4.3-r0)
(70/77) Installing libsndfile (1.2.0-r2)
(71/77) Installing soxr (0.1.3-r5)
(72/77) Installing speexdsp (1.2.1-r1)
(73/77) Installing tdb-libs (1.4.8-r1)
(74/77) Installing libpulse (16.1-r10)
(75/77) Installing sane (1.1.1-r2)
Executing sane-1.1.1-r2.pre-install
(76/77) Installing eudev-libs (3.2.11-r8)
(77/77) Installing wine (8.13-r0)
Executing busybox-1.36.1-r2.trigger
Executing glib-2.76.4-r0.trigger
OK: 1304 MiB in 139 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  3851k      0 --:--:-- --:--:-- --:--:-- 3855k
  % 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     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  6156  100  6156    0     0  79543      0 --:--:-- --:--:-- --:--:-- 78923
  % 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  6156  100  6156    0     0   181k      0 --:--:-- --:--:-- --:--:--  182k
+ 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: FAILED
openssl-1.1.1h_3-win64-mingw.zip: FAILED
sha256sum: WARNING: 2 of 3 computed checksums did NOT match
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Email)
[Pipeline] step
Sending e-mails to: admin.jenkins@moparisthebest.com
[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
time="2023-08-29T00:51:59-04:00" level=warning msg="The cgroupv2 manager is set to systemd but there is no systemd user session available"
time="2023-08-29T00:51:59-04:00" level=warning msg="For using systemd, you may need to log in using a user session"
time="2023-08-29T00:51:59-04:00" level=warning msg="Alternatively, you can enable lingering with: `loginctl enable-linger 971` (possibly as root)"
time="2023-08-29T00:51:59-04:00" level=warning msg="Falling back to --cgroup-manager=cgroupfs"
time="2023-08-29T00:51:59-04:00" level=warning msg="The cgroupv2 manager is set to systemd but there is no systemd user session available"
time="2023-08-29T00:51:59-04:00" level=warning msg="For using systemd, you may need to log in using a user session"
time="2023-08-29T00:51:59-04:00" level=warning msg="Alternatively, you can enable lingering with: `loginctl enable-linger 971` (possibly as root)"
time="2023-08-29T00:51:59-04:00" level=warning msg="Falling back to --cgroup-manager=cgroupfs"
+ exit 0
[Pipeline] deleteDir
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Also:   java.nio.file.FileSystemException: /var/lib/jenkins/workspace/moparisthebest_pegh_master/.git/branches: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:285)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:258)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
Also:   java.nio.file.FileSystemException: /var/lib/jenkins/workspace/moparisthebest_pegh_master/.git/hooks/applypatch-msg.sample: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:285)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:258)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
Also:   java.nio.file.FileSystemException: /var/lib/jenkins/workspace/moparisthebest_pegh_master/.git/hooks/commit-msg.sample: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:285)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:258)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
Also:   java.nio.file.FileSystemException: /var/lib/jenkins/workspace/moparisthebest_pegh_master/.git/hooks/fsmonitor-watchman.sample: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:285)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:258)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
Also:   java.nio.file.FileSystemException: /var/lib/jenkins/workspace/moparisthebest_pegh_master/.git/hooks/post-update.sample: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:285)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:258)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
Also:   java.nio.file.FileSystemException: /var/lib/jenkins/workspace/moparisthebest_pegh_master/.git/hooks/pre-applypatch.sample: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:285)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:258)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
Also:   java.nio.file.FileSystemException: /var/lib/jenkins/workspace/moparisthebest_pegh_master/.git/hooks/pre-commit.sample: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:285)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:258)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
Also:   java.nio.file.FileSystemException: /var/lib/jenkins/workspace/moparisthebest_pegh_master/.git/hooks/pre-merge-commit.sample: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:285)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:258)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
Also:   java.nio.file.FileSystemException: /var/lib/jenkins/workspace/moparisthebest_pegh_master/.git/hooks/pre-push.sample: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:285)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:258)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
Also:   java.nio.file.FileSystemException: /var/lib/jenkins/workspace/moparisthebest_pegh_master/.git/hooks/pre-rebase.sample: Operation not permitted
		at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
		at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setMode(UnixFileAttributeViews.java:254)
		at java.base/sun.nio.fs.UnixFileAttributeViews$Posix.setPermissions(UnixFileAttributeViews.java:276)
		at java.base/java.nio.file.Files.setPosixFilePermissions(Files.java:2080)
		at jenkins.util.io.PathRemover.makeWritable(PathRemover.java:285)
		at jenkins.util.io.PathRemover.makeRemovable(PathRemover.java:258)
		at jenkins.util.io.PathRemover.removeOrMakeRemovableThenRemove(PathRemover.java:238)
		at jenkins.util.io.PathRemover.tryRemoveFile(PathRemover.java:202)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:213)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.tryRemoveDirectoryContents(PathRemover.java:224)
		at jenkins.util.io.PathRemover.tryRemoveRecursive(PathRemover.java:212)
		at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:93)
jenkins.util.io.CompositeIOException: Unable to delete '/var/lib/jenkins/workspace/moparisthebest_pegh_master'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts. (Discarded 70 additional exceptions)
	at jenkins.util.io.PathRemover.forceRemoveRecursive(PathRemover.java:96)
	at hudson.Util.deleteRecursive(Util.java:319)
	at hudson.FilePath$DeleteRecursive.invoke(FilePath.java:1444)
	at hudson.FilePath$DeleteRecursive.invoke(FilePath.java:1439)
	at hudson.FilePath.act(FilePath.java:1200)
	at hudson.FilePath.act(FilePath.java:1183)
	at hudson.FilePath.deleteRecursive(FilePath.java:1436)
	at org.jenkinsci.plugins.workflow.steps.DeleteDirStep$Execution.run(DeleteDirStep.java:77)
	at org.jenkinsci.plugins.workflow.steps.DeleteDirStep$Execution.run(DeleteDirStep.java:69)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
[Gitea] Notifying branch build status: FAILURE There was a failure building this commit
[Gitea] Notified
Finished: FAILURE