diff --git a/software/build-scripts/build.sh b/software/build-scripts/build.sh index 1654fc2..158d889 100755 --- a/software/build-scripts/build.sh +++ b/software/build-scripts/build.sh @@ -30,7 +30,7 @@ if [ ! -e build/usr/sbin/infnoise ] ; then exit 1; fi -fakeroot dpkg -b build/ infnoise_${VERSION}_${ARCH}.deb +fakeroot dpkg-deb -Zxz -b build/ infnoise_${VERSION}_${ARCH}.deb ### build infnoise-tools ### rm -rf build @@ -54,7 +54,7 @@ cp ../build-scripts/control.debian.tools build/DEBIAN/control echo "Version: $VERSION" >> build/DEBIAN/control echo "Architecture: $ARCH" >> build/DEBIAN/control -fakeroot dpkg -b build/ infnoise-tools_${VERSION}_${ARCH}.deb +fakeroot dpkg-deb -Zxz -b build/ infnoise-tools_${VERSION}_${ARCH}.deb rm -rf build cd .. @@ -75,6 +75,6 @@ cp build-scripts/control.debian.lib build/DEBIAN/control echo "Version: $VERSION" >> build/DEBIAN/control echo "Architecture: $ARCH" >> build/DEBIAN/control -fakeroot dpkg -b build/ libinfnoise_${VERSION}_${ARCH}.deb +fakeroot dpkg-deb -Zxz -b build/ libinfnoise_${VERSION}_${ARCH}.deb rm -rf build diff --git a/software/libinfnoise.h b/software/libinfnoise.h index 335094e..93be369 100644 --- a/software/libinfnoise.h +++ b/software/libinfnoise.h @@ -15,6 +15,10 @@ // We also write this in one go to the Keccak sponge, which is at most 1600 bits #define BUFLEN 512u +#ifdef __cplusplus +extern "C" { +#endif + #if !defined(_WIN32) struct infnoise_context { struct ftdi_context ftdic; @@ -86,4 +90,8 @@ void deinitInfnoise(struct infnoise_context *context); */ uint32_t readData(struct infnoise_context *context, uint8_t *result, bool raw, uint32_t outputMultiplier); +#ifdef __cplusplus +} +#endif + #endif diff --git a/software/libinfnoise.version b/software/libinfnoise.version index c4c671a..84ceead 100644 --- a/software/libinfnoise.version +++ b/software/libinfnoise.version @@ -1,5 +1,5 @@ libinfnoise { - global: listUSBDevices; initInfnoise; readRawData; readData; # explicitly list symbols to be exported + global: listUSBDevices; initInfnoise; deinitInfnoise; readRawData; readData; # explicitly list symbols to be exported local: *; # hide everything else }; diff --git a/software/tools/findlongest.c b/software/tools/findlongest.c old mode 100644 new mode 100755 index c4a961a..f4dc44b --- a/software/tools/findlongest.c +++ b/software/tools/findlongest.c @@ -98,7 +98,7 @@ int main(int argc, char **argv) { } else { data = readDataFromFile(argv[1], &dataLen); } - uint8_t *stringsSeen = calloc((uint64_t)1 << (MAX_STRING_SIZE-3u), sizeof(uint8_t)); + uint8_t *stringsSeen = calloc((uint64_t)1 << (MAX_STRING_SIZE-4u), sizeof(uint8_t)); uint32_t len; for(len = 4u; len <= MAX_STRING_SIZE; len++) { if(!hasSubstringOfLength(len, data, dataLen, stringsSeen)) { diff --git a/software/writeentropy.c b/software/writeentropy.c index 952123a..379a04f 100644 --- a/software/writeentropy.c +++ b/software/writeentropy.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include @@ -25,7 +25,7 @@ static uint32_t readNumberFromFile(char *fileName) { exit(1); } uint32_t value = 0u; - char c; + int32_t c; while( (c = getc(file)) != EOF && '0' <= c && c <= '9' ) { value *= 10;