mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 13:17:56 +00:00
fddd7b6640
git subtree pull --squash --prefix libsodium git@github.com:jedisct1/libsodium.git 1.0.14
20 lines
543 B
Bash
Executable File
20 lines
543 B
Bash
Executable File
#! /bin/sh
|
|
|
|
CT='ct.c'
|
|
|
|
echo '#include <assert.h>' > "$CT"
|
|
echo '#include <sodium.h>' >> "$CT"
|
|
echo 'int main(void) {' >> "$CT"
|
|
for macro in $(egrep -r '#define crypto_.*BYTES(_[A-Z]+)? ' src/libsodium/include | \
|
|
cut -d: -f2- | cut -d' ' -f2 | \
|
|
fgrep -v edwards25519sha512batch | sort -u); do
|
|
func=$(echo "$macro" | tr A-Z a-z)
|
|
echo " assert($func() == $macro);" >> "$CT"
|
|
done
|
|
echo "return 0; }" >> "$CT"
|
|
|
|
${CC:-cc} "$CT" $CPPFLAGS $CFLAGS $LDFLAGS -lsodium || exit 1
|
|
./a.out || exit 1
|
|
rm -f a.out "$CT"
|
|
|