waywardgeek / infnoise

The world's easiest TRNG to get right
Creative Commons Zero v1.0 Universal
723 stars 99 forks source link

ADDR0 .. ADDR3 are undefined #59

Closed MartyMacGyver closed 5 years ago

MartyMacGyver commented 6 years ago

I'm attempting to build the Visual Studio project (considering modernizing / improving it) but I cannot because ADDR0 .. ADDR3 are undefined.

It looks like the definitions for these were removed some time ago - before I start working on a fix, is there some outside dependency involved now for these, or is this actually a bug?

manuel-domke commented 6 years ago

Hi, thanks for considering to update the Windows binary. Its also been on my todo list for a while.

These definitions must have been removed from infnoise.h at some point because they're only required for the Windows build and no-one cared about it.

I found them in an earlier revision - and we should get them back (but mark 'em or make another header file for the windows binary:

https://github.com/waywardgeek/infnoise/blob/bb14828ea142dffeb9cb37bcc341177eb6c4e288/software/infnoise.h

Feel free to update the infnoise_win.c as you like, but please keep in mind I will get back to the libinfnoise thing (#51), and plan to migrate this binary too!

Manuel

gregsskyles commented 6 years ago

+1 for adding these back into the build. Should there be an infnoise_win.h which is conditionally included?

manuel-domke commented 6 years ago

There is an updated fork from @jj1bdx for Windows : https://github.com/jj1bdx/infnoise-windows

I'm currently reorganizing some stuff to build with the CMake tools on (hopefully) all platforms (Linux, Mac, FreeBSD and Windows) So it's worth keeping an eye on my fork: https://github.com/13-37-org/infnoise

Until now there is "only" the refactoring for a shared lib, libinfnoise - and some merged contributions.

edit: its not much so far - but I've now commited the current state (wip): https://github.com/13-37-org/infnoise/tree/cmake/software

I'm very thankful for all the information and pull requests to build for MacOS, FreeBSD and Windows - that I received over the last two weeks - and will try to adopt all of them.

MartyMacGyver commented 5 years ago

I've been poking around at https://github.com/jj1bdx/infnoise-windows lately, mainly because it builds in VS 2019 and it's giving me a chance to work on some theories - such as pipe capability, which was actually quite simple to add and allows me to feed the output directly to other scripts and programs.

That said, it's nice to have everything in one place, and I'm thinking about how to unify the two. First, is there any interest? Second, what happened to the cmake idea? What's there isn't any more buildable under VS than the original, so I'm guessing not much ever changed there, but I'm not sure if you still plan to go in that direction. I'd suspect the changes I'd need to make would end up working with either though...

jj1bdx commented 5 years ago

@MartyMacGyver I'd be glad if you could merge my code to the base repository here.

MartyMacGyver commented 5 years ago

@jj1bdx Well, here's what I have so far, based on both the mainline and yours and my own changes and cleanups:

Edit: this is the PR branch: https://github.com/MartyMacGyver/infnoise/tree/mff-update-windows-build-and-functionality

Further WIP will be on: https://github.com/MartyMacGyver/infnoise/tree/mff-dev

I'll need to clean it up a bit to actually make a PR though (there's some test code, etc.)

However, as-is it works quite well. I tested it with PractRand (which I've mirrored at https://github.com/MartyMacGyver/PractRand). With the 64-bit builds of each other:

infnoise_win.exe | RNG_test.exe stdin

tested the TRNG's output quite nicely.