Cleanup, MIT license

This commit is contained in:
Jōshin 2018-12-27 11:43:48 -08:00
parent 4d89cad020
commit 38cf11ed34
3 changed files with 42 additions and 6 deletions

20
LICENSE Normal file
View File

@ -0,0 +1,20 @@
Copyright 2018 Steven Dee
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,4 +1,8 @@
libent is a simple cross-platform entropy gathering library. It tries
to use the best available source of randomness, and is meant to be used
in applications that need high-quality entropy, e.g. for generating
cryptographic keys.
libent is a cross-platform wrapper around `getentropy(2)`. It exports
one symbol, `ent_getentropy`, which expands to `getentropy` if the
latter is available. Otherwise, it tries to use the next best source of
entropy -- /dev/urandom on *nix, BCryptGenRandom on Windows.
References:
* [OpenBSD getentropy](https://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/getentropy.2)
* [djb on entropy gathering](https://blog.cr.yp.to/20140205-entropy.html)

View File

@ -1,10 +1,10 @@
#ifndef _ENT_H
#define _ENT_H
#include <ent/config.h>
#include <stddef.h>
#include <ent/config.h>
#if defined(ENT_GETENTROPY)
# if defined(ENT_GE_SYSRANDOM)
# include <inttypes.h> /* OSX sys/random.h needs Availability.h from this */
@ -32,4 +32,16 @@ ent_getentropy(void* buf, size_t buflen);
# error "libent: platform not supported"
#endif
#ifdef ENT_GETENTROPY
#undef ENT_GETENTROPY
#endif
#ifdef ENT_GE_SYSRANDOM
#undef ENT_GE_SYSRANDOM
#endif
#ifdef ENT_GE_UNISTD
#undef ENT_GE_UNISTD
#endif
#endif /* _ENT_H */