Skip to content

Commit

Permalink
Merge pull request #96 from leetronics/master
Browse files Browse the repository at this point in the history
merge with leetronics/infnoise
  • Loading branch information
manuel-domke authored Feb 11, 2023
2 parents 66075cc + 59f1214 commit 8edb00b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions software/build-scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ..
Expand All @@ -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
8 changes: 8 additions & 0 deletions software/libinfnoise.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion software/libinfnoise.version
Original file line number Diff line number Diff line change
@@ -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
};

2 changes: 1 addition & 1 deletion software/tools/findlongest.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions software/writeentropy.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/poll.h>
#include <poll.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <linux/random.h>
Expand All @@ -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;
Expand Down

0 comments on commit 8edb00b

Please sign in to comment.