aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2013-05-16 20:04:24 +0200
committerIngela Anderton Andin <[email protected]>2013-05-22 10:51:18 +0200
commit16d06da9fb425fe652f3826275f3f9bf87c881f0 (patch)
treed800970cb14e172725d52b50504652864ceef008 /lib/inets
parent355e919653c8178b9144db9e0fa01c329e077de4 (diff)
downloadotp-16d06da9fb425fe652f3826275f3f9bf87c881f0.tar.gz
otp-16d06da9fb425fe652f3826275f3f9bf87c881f0.tar.bz2
otp-16d06da9fb425fe652f3826275f3f9bf87c881f0.zip
crypto,ssh, netconf, inets: binary_to_integer -> bytes_to_integer
Diffstat (limited to 'lib/inets')
-rw-r--r--lib/inets/test/erl_make_certs.erl8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/inets/test/erl_make_certs.erl b/lib/inets/test/erl_make_certs.erl
index be1253bfb8..4ca2907a73 100644
--- a/lib/inets/test/erl_make_certs.erl
+++ b/lib/inets/test/erl_make_certs.erl
@@ -398,17 +398,13 @@ gen_dsa2(LSize, NSize) ->
Y = crypto:mod_pow(G, X, P), %% Calculate y = g^x mod p.
#'DSAPrivateKey'{version=0, p = P, q = Q,
- g = crypto:binary_to_integer(G), y = crypto:binary_to_integer(Y), x = X}
+ g = crypto:bytes_to_integer(G), y = crypto:bytes_to_integer(Y), x = X}
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% EC key generation (OBS: for testing only)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-int2list(I) ->
- L = (length(integer_to_list(I, 16)) + 1) div 2,
- binary_to_list(<<I:(L*8)>>).
-
gen_ec2(CurveId) ->
{PrivKey, PubKey} = crypto:generate_key(ecdh, CurveId),
@@ -446,7 +442,7 @@ is_prime(_, 0) -> true;
is_prime(Candidate, Test) ->
CoPrime = odd_rand(10000, Candidate),
Result = crypto:mod_pow(CoPrime, Candidate, Candidate) ,
- is_prime(CoPrime, crypto:binary_to_integer(Result), Candidate, Test).
+ is_prime(CoPrime, crypto:bytes_to_integer(Result), Candidate, Test).
is_prime(CoPrime, CoPrime, Candidate, Test) ->
is_prime(Candidate, Test-1);