Implement gmp_import() and gmp_export()