diff --git a/src/cutkey.erl b/src/cutkey.erl index af292d7..b4a13de 100644 --- a/src/cutkey.erl +++ b/src/cutkey.erl @@ -68,7 +68,12 @@ rsa(Bits, E, Opts) when is_integer(Bits), Bits > 0, E band 1 =:= 1 -> false -> erlang:error(badarg) end. -erlint(MPInts) -> [ crypto:erlint(X) || X <- MPInts ]. +erlint(MPInts) -> [ crypto_erlint(X) || X <- MPInts ]. + +crypto_erlint(<>) -> + Bits= MPIntSize * 8, + <> = MPIntValue, + Integer. -ifdef(TEST). @@ -81,7 +86,7 @@ bare_test_() -> [fun() -> {ok, MPInts} = cutkey:rsa(512, 65537, [{return, bare}]), 3 = length(MPInts), - Fun = fun(X) -> is_integer(crypto:erlint(X)) end, + Fun = fun(X) -> is_integer(crypto_erlint(X)) end, true = lists:all(Fun, MPInts) end, fun() -> @@ -97,7 +102,7 @@ full_test_() -> [fun() -> {ok, MPInts} = cutkey:rsa(512, 65537, [{return, full}]), 8 = length(MPInts), - Fun = fun(X) -> is_integer(crypto:erlint(X)) end, + Fun = fun(X) -> is_integer(crypto_erlint(X)) end, true = lists:all(Fun, MPInts) end, fun() ->