/* ** Creates the metatables for the objects and registers the ** driver open method. */ LUACRYPTO_API int luaopen_crypto(lua_State *L) { struct luaL_reg core[] = { {NULL, NULL}, }; OpenSSL_add_all_digests(); create_metatables (L); luaL_openlib (L, LUACRYPTO_CORENAME, core, 0); luacrypto_set_info (L); return 1; }
/* ** Creates the metatables for the objects and registers the ** driver open method. */ LUACRYPTO_API int luaopen_crypto(lua_State *L) { #if CRYPTO_OPENSSL if (OPENSSL_VERSION_NUMBER < 0x000907000L) return luaL_error(L, "OpenSSL version is too old; requires 0.9.7 or higher"); OpenSSL_add_all_digests(); #elif CRYPTO_GCRYPT gcry_check_version("1.2.2"); gcry_control (GCRYCTL_DISABLE_SECMEM, 0); gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); #endif struct luaL_reg core[] = { {NULL, NULL}, }; create_metatables (L); luaL_openlib (L, LUACRYPTO_CORENAME, core, 0); luacrypto_set_info (L); return 1; }