Merge pull request #96 from leetronics/master

merge with leetronics/infnoise
This commit is contained in:
Manuel Domke
2023-02-11 17:37:59 +01:00
committed by GitHub
5 changed files with 15 additions and 7 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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
software/tools/findlongest.c Normal file → Executable file
View File

@@ -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)) {

View File

@@ -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>
@@ -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;