BSD Licensed Bignum Library
C C++
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
arch Fix warning on strcmp May 4, 2014
profile Added mulmid and div/divrem/divapprox profiling code. Apr 15, 2013
rand fix for malloc.h include to compile on OSX Jan 16, 2014
test zz_powi Jan 30, 2018
.gitignore remove unused assembler files Oct 4, 2010
CHANGES Moved test for nn_mullow to t-nn.c and added test for nn_mullow_m. May 16, 2013
LICENSE Fix LICENSE. Mar 11, 2013
Makefile.unix Fix typo in Makefile on Mac OS X Sep 7, 2017
README Update contributers Jan 30, 2018
configure fix installation of headers Jan 2, 2014
helper.c Fixed various warnings and incompatibilities for netbsd. Dec 31, 2013
helper.h nn_popcount, nn_scan1, nn_hamdist_m Jan 29, 2018
nn.c Fixed a couple of compiler warnings. Dec 31, 2013
nn.h nn_get_str_raw, nn_set_str_raw Jan 30, 2018
nn_linear.c nn_popcount, nn_scan1, nn_hamdist_m Jan 29, 2018
nn_quadratic.c nn_get_str_raw, nn_set_str_raw Jan 30, 2018
nn_subquadratic.c Put ASSERTs in nn_add/sub_c. Fix bug in nn_mul_kara. Fix compiler Jan 29, 2018
rand.h Added C++ guards to .h files. Dec 29, 2013
sha1.c Monor cleanup of sha1. Mar 11, 2013
sha1.h Added C++ guards to .h files. Dec 29, 2013
test.c Fixed numerous C++ warnings and errors. Dec 29, 2013
test.h Added C++ guards to .h files. Dec 29, 2013
tuning.h Fixed numerous C++ warnings and errors. Dec 29, 2013
zz.c zz_powi: better behavior for (illegal) b < 0 Jan 31, 2018
zz.h zz_powi Jan 30, 2018
zz0.c Added some test code for zz0 and fixed some bugs. Added simple zz.h s… Dec 28, 2013
zz0.h Added C++ guards to .h files. Dec 29, 2013


BSDNT version 1.0

BSDNT is a BSD licensed bignum library, suitable for use by languages which
need to provide bignum support and for other projects requiring relatively
fast bignums.

The primary goal of the project is to have clean, comprehensible, 
well-documented code, whilst retaining reasonable performance. It is not
a goal to insanely optimise where that would make the code less readable
and maintainable.


* Support for Linux, OSX, BSD, MinGW32, Cygwin, Cygwin64
* Inline assembly optimisation for 64 bit Intel and AMD x86_64 processors
* Low level multiprecision natural numbers interface (nn.h)
* High level multiprecision integer interface (zz.h)
* Very extensive test code
* SHA1 implementation
* KISS / SuperKISS / Mersenne_twister pseudorandom number generators


Currently we require bash, gnu make and gcc 4 or later or clang.


To build bsdnt and run the test code

$ cd bsdnt
$ ./configure
$ make check


The user will most likely use the interfaces in nn.h and zz.h.

All of the functions are documented in those two files.

Future improvements

* Unroll assembly loops
* Assembly support for more processors
* Multiprecision rational number interface
* Multiprecision floating point interface
* Simplify and merge the BSD licensed fft found here:
* Asymptotically fast algorithms for GCD, get_str, set_str, division (??)
* Square root and n-th root code


William Hart, Brian Gladman, Antony Vennard, Gonzalo Tornaria, Howard Mao,
Lee Wei Yeong, Ryan Goulden.

See the LICENSE file for legal info and warranty information.

Contributions are welcome. There is a Google group here:!forum/bsdnt-devel


William Hart - 1-1-2014