From 21cd1994c280c705e99d48ae09f2d94e348875a3 Mon Sep 17 00:00:00 2001 From: Doug Hogan Date: Thu, 20 Dec 2018 02:00:57 -0800 Subject: Move BN and RSA utility functions to new files --- lib/crypto/c_src/bn.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/crypto/c_src/bn.h (limited to 'lib/crypto/c_src/bn.h') diff --git a/lib/crypto/c_src/bn.h b/lib/crypto/c_src/bn.h new file mode 100644 index 0000000000..5ff1fa3ea9 --- /dev/null +++ b/lib/crypto/c_src/bn.h @@ -0,0 +1,16 @@ +#ifndef E_BN_H__ +#define E_BN_H__ 1 + +#include "common.h" + +ERL_NIF_TERM bin_from_bn(ErlNifEnv* env, const BIGNUM *bn); +ERL_NIF_TERM mod_exp_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); + +#ifdef HAVE_EC +ERL_NIF_TERM bn2term(ErlNifEnv* env, const BIGNUM *bn); +#endif + +int get_bn_from_mpint(ErlNifEnv* env, ERL_NIF_TERM term, BIGNUM** bnp); +int get_bn_from_bin(ErlNifEnv* env, ERL_NIF_TERM term, BIGNUM** bnp); + +#endif /* E_BN_H__ */ -- cgit v1.2.3