First version using GMP libraries