our own copy of libsodium
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
543 B

#! /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 | sort -u); do
func=$(echo "$macro" | tr A-Z a-z)
echo " assert($func() == $macro);" >> "$CT"
done
echo "return 0; }" >> "$CT"
CPPFLAGS="${CPPFLAGS} -Wno-deprecated-declarations"
${CC:-cc} "$CT" $CPPFLAGS $CFLAGS $LDFLAGS -lsodium || exit 1
./a.out || exit 1
rm -f a.out "$CT"