Merge pull request #47 from 13-37-org/master
bugfix: initialize opts.version to false
This commit is contained in:
@@ -10,10 +10,11 @@ make
|
||||
|
||||
rm -rf build
|
||||
mkdir -p build/DEBIAN
|
||||
cp build-scripts/control.debian.$ARCH build/DEBIAN/control
|
||||
cp build-scripts/control.debian.tools build/DEBIAN/control
|
||||
cp build-scripts/infnoise.postinst build/DEBIAN/postinst
|
||||
chmod 775 build/DEBIAN/postinst
|
||||
echo "Version: $VERSION" >> build/DEBIAN/control
|
||||
echo "Architecture: $ARCH" >> build/DEBIAN/control
|
||||
|
||||
mkdir -p build/usr/sbin/
|
||||
mkdir -p build/etc/udev/rules.d/
|
||||
@@ -33,4 +34,26 @@ fi
|
||||
dpkg -b build/ infnoise_${VERSION}_${ARCH}.deb
|
||||
#debbuild -uc -us
|
||||
|
||||
rm -r build
|
||||
### build infnoise-tools ###
|
||||
rm -rf build
|
||||
cd tools
|
||||
|
||||
make
|
||||
|
||||
cp passgen build/usr/bin/infnoise-passgen
|
||||
cp dice build/usr/bin/infnoise-dice
|
||||
cp entheck build/usr/bin/infnoise-entcheck
|
||||
cp healtcheck build/usr/bin/infnoise-healthcheck
|
||||
cp hex2bin build/usr/bin/infnoise-hex2bin
|
||||
cp bin2hex build/usr/bin/infnoise-bin2hex
|
||||
cp findlongest build/usr/bin/infnoise-findlongest
|
||||
cp flipbits build/usr/bin/infnoise-flipbits
|
||||
|
||||
mkdir -p build/DEBIAN
|
||||
cp build-scripts/control.debian.tools build/DEBIAN/control
|
||||
echo "Version: $VERSION" >> build/DEBIAN/control
|
||||
echo "Architecture: $ARCH" >> build/DEBIAN/control
|
||||
|
||||
dpkg -b build/ infnoise-tools_${VERSION}_${ARCH}.deb
|
||||
|
||||
rm -rf build
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Version: v0.2.1
|
||||
@@ -1,9 +0,0 @@
|
||||
Package: infnoise
|
||||
Architecture: armhf
|
||||
Essential: no
|
||||
Section: security
|
||||
Priority: optional
|
||||
Depends: libftdi1
|
||||
Maintainer: Manuel Domke
|
||||
Installed-Size: 12K
|
||||
Description: Infinite Noise TRNG driver.
|
||||
@@ -6,4 +6,4 @@ Priority: optional
|
||||
Depends: libftdi1
|
||||
Maintainer: Manuel Domke
|
||||
Installed-Size: 12K
|
||||
Description: Infinite Noise TRNG driver.
|
||||
Description: Infinite Noise TRNG driver
|
||||
@@ -1,9 +1,8 @@
|
||||
Package: infnoise
|
||||
Architecture: i386
|
||||
Package: infnoise-tools
|
||||
Essential: no
|
||||
Section: security
|
||||
Depends: infnoise
|
||||
Priority: optional
|
||||
Depends: libftdi1
|
||||
Maintainer: Manuel Domke
|
||||
Installed-Size: 12K
|
||||
Description: Infinite Noise TRNG driver.
|
||||
Description: Infinite Noise TRNG tools
|
||||
49
software/build-scripts/infnoise-tools.spec
Normal file
49
software/build-scripts/infnoise-tools.spec
Normal file
@@ -0,0 +1,49 @@
|
||||
Name: infnoise-tools
|
||||
Version: __VERSION__
|
||||
Release: __RELEASE__
|
||||
Summary: Infinite Noise TRNG
|
||||
Group: Applications/Security
|
||||
License: GPL
|
||||
URL: https://github.com/13-37-org/infnoise
|
||||
Vendor: 13-37.org
|
||||
Source: infnoise.tar.gz
|
||||
Prefix: %{_prefix}
|
||||
Packager: Manuel Domke
|
||||
BuildRoot: %{_tmppath}/%{name}-root
|
||||
|
||||
%description
|
||||
|
||||
%prep
|
||||
tar -xzf ../SOURCES/infnoise.tar.gz
|
||||
|
||||
%build
|
||||
cd tools
|
||||
make
|
||||
|
||||
%install
|
||||
#make DESTDIR=$RPM_BUILD_ROOT install
|
||||
cp passgen build/usr/bin/infnoise-passgen
|
||||
cp dice build/usr/bin/infnoise-dice
|
||||
cp healtcheck build/usr/bin/infnoise-healthcheck
|
||||
cp hex2bin build/usr/bin/infnoise-hex2bin
|
||||
cp bin2hex build/usr/bin/infnoise-bin2hex
|
||||
cp findlongest build/usr/bin/infnoise-findlongest
|
||||
cp flipbits build/usr/bin/infnoise-flipbits
|
||||
|
||||
|
||||
|
||||
install -Dvm755 "passgen" "$RPM_BUILD_ROOT/usr/bin/infnoise-passgen"
|
||||
install -Dvm755 "dice" "$RPM_BUILD_ROOT/usr/bin/infnoise-dice"
|
||||
install -Dvm755 "healthcheck" "$RPM_BUILD_ROOT/usr/bin/infnoise-entcheck"
|
||||
install -Dvm755 "entcheck" "$RPM_BUILD_ROOT/usr/bin/infnoise-healthcheck"
|
||||
install -Dvm755 "hex2bin" "$RPM_BUILD_ROOT/usr/bin/infnoise-hex2bin"
|
||||
install -Dvm755 "bin2hex" "$RPM_BUILD_ROOT/usr/bin/infnoise-bin2hex"
|
||||
install -Dvm755 "findlongest" "$RPM_BUILD_ROOT/usr/bin/infnoise-findlongest"
|
||||
install -Dvm755 "flipbits" "$RPM_BUILD_ROOT/usr/bin/infnoise-flipbits"
|
||||
|
||||
%clean
|
||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/infnoise
|
||||
@@ -354,15 +354,33 @@ static inline bool computeRandBit(double *A, double K, double noiseAmplitude) {
|
||||
return updateA(A, K, noise);
|
||||
}
|
||||
|
||||
static void initOpts(struct opt_struct *opts) {
|
||||
opts->outputMultiplier = 0u;
|
||||
opts->daemon =
|
||||
opts->debug =
|
||||
opts->devRandom =
|
||||
opts->noOutput =
|
||||
opts->listDevices =
|
||||
opts->raw = false;
|
||||
opts->version = false;
|
||||
opts->help = false;
|
||||
opts->none = false;
|
||||
opts->pidFileName =
|
||||
opts->serial = NULL;
|
||||
}
|
||||
|
||||
int main() {
|
||||
struct opt_struct opts;
|
||||
initOpts(&opts);
|
||||
//double K = sqrt(2.0);
|
||||
double K = 1.82;
|
||||
uint8_t N = 16u;
|
||||
inmHealthCheckStart(N, K, true);
|
||||
inmHealthCheckStart(N, K, &opts);
|
||||
srand(time(NULL));
|
||||
double A = (double)rand()/RAND_MAX; // Simulating INM
|
||||
double noiseAmplitude = 1.0/(1u << 10);
|
||||
uint32_t i;
|
||||
|
||||
for(i = 0u; i < 32u; i++) {
|
||||
// Throw away some initial bits.
|
||||
computeRandBit(&A, K, noiseAmplitude);
|
||||
|
||||
@@ -240,6 +240,7 @@ static void initOpts(struct opt_struct *opts) {
|
||||
opts->noOutput =
|
||||
opts->listDevices =
|
||||
opts->raw = false;
|
||||
opts->version = false;
|
||||
opts->help = false;
|
||||
opts->none = false;
|
||||
opts->pidFileName =
|
||||
|
||||
17
software/tools/README.md
Normal file
17
software/tools/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
## Infinite Tools
|
||||
|
||||
### passgen
|
||||
|
||||
### healtcheck
|
||||
|
||||
### dice
|
||||
|
||||
### findlongest
|
||||
|
||||
### hex2bin
|
||||
|
||||
### bin2hex
|
||||
|
||||
### flipbits
|
||||
|
||||
### entcheck
|
||||
Reference in New Issue
Block a user