bnlib is a multi-precision math library designed to be very portable, reasonably clean and easy to use, have very liberal bounds on the sizes of numbers that can be represented, but above all to perform extremely fast modular exponentiation. It has some limitations, such as representing positive numbers only, and supporting only odd moduli, which simplify it without impairing this ability. A second speed goal which has had considerable effort applied to it is prime number generation. It is written in C, and should compile on any platform with an ANSI C compiler and 16 and 32-bit unsigned data types, but various primitives can be replaced with assembly versions in a great variety of ways for greater speedup. Notes: * bnlib is also incorporated into the cryptlib toolkit, located at: http://www.cs.auckland.ac.nz/~pgut001/cryptlib/ * The bnlib homepage no longer exists. * Debian GNU/Linux maintains a version of bnlib that builds on the Linux operating system.