xaptum / ecdaa

A C implementation of elliptic-curve-based Direct Anonymous Attestation (DAA) signatures. Created to support the Xaptum Edge Network Fabric, an IoT Network Solution.
https://www.xaptum.com
Apache License 2.0
45 stars 8 forks source link

Take randomness from system, as function pointer #106

Closed zanebeckwith closed 6 years ago

zanebeckwith commented 6 years ago

This removes the ecdaa_prng user-space cryptographically-secure random number generator (which was just a wrapper around AMCL's csprng), in favor of taking a function-pointer from the user that gives us random numbers directly. The intention (and what is illustrated in the examples) is that this function will use the system's source of randomness (e.g. getrandom on Linux, or just /dev/urandom).

This is done for two reasons:

Fixes #96 Also, because we no longer use randombytes_buf in our tests, and thus no longer check that the system's csprng has been properly seeded (we have a warning about this in the README), we shouldn't get the intermittent errors in travis-ci that we had before. So, this Fixes #88.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.0009%) to 93.329% when pulling 7945878560fb6509dab604d94b831968f8fb533d on zanebeckwith:no-userspace-csprng into 677c12a5814dba7441c8354f82f54ed6c728ac7d on xaptum:master.

zanebeckwith commented 6 years ago

@drbild I shortened the names, and moved the pool-related stuff into a separate file, under common/internal-utilities.

Let me know what you think.

drbild commented 6 years ago

Looks like the README needs the ecdaa_randomness_func_t to ecdaa_rand_func change too.

Also, should the pool stuff become ecdaa_rand_pool rather than ecdaa_randomness_pool, etc?

zanebeckwith commented 6 years ago

Rargh, good catch on the names.

Alright, now, fixed. Sorry.