Take a look at the GMP library: www.gmplib.org
Quote from function categories:
A low-level positive integer, hard-to-reach, very low function overheads are in the mpn category. No memory management is performed; The caller must provide enough space for the results. (...)
This is similar to what you need.
Nils pipenbrinck
source share