From 7e59ec8e414bfde6cd0679c2fe6622c5c508592d Mon Sep 17 00:00:00 2001 From: 5HT Date: Wed, 23 Oct 2024 20:32:10 +0300 Subject: [PATCH] secp384r1 logs cleanup --- lib/curves/ecdsa.ex | 7 +------ lib/ecdsa.ex | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/curves/ecdsa.ex b/lib/curves/ecdsa.ex index 2f3bfe6..84f7e38 100644 --- a/lib/curves/ecdsa.ex +++ b/lib/curves/ecdsa.ex @@ -17,8 +17,7 @@ defmodule CA.ECDSA do end def private(bin), do: :erlang.element(2,X509.PrivateKey.from_pem(bin)) - def public(bin), do: #:erlang.element(1,:erlang.element(2, - :public_key.pem_entry_decode(hd(:public_key.pem_decode(bin))) + def public(bin), do: :public_key.pem_entry_decode(hd(:public_key.pem_decode(bin))) def numberFromString(string) do Base.encode16(string) @@ -34,9 +33,6 @@ defmodule CA.ECDSA do xs = :binary.part(bin, 0, baseLength) ys = :binary.part(bin, baseLength, :erlang.size(bin) - baseLength) point = %CA.Point{ x: numberFromString(xs), y: numberFromString(ys)} - :io.format 'ECPoint.x: ~p~n', [xs] - :io.format 'ECPoint.y: ~p~n', [ys] - :io.format 'ECPoint: ~p~n', [point] point end @@ -47,7 +43,6 @@ defmodule CA.ECDSA do end def verify(message, {r,s}, publicKey, options) do - :io.format '{r,s}: ~p~n', [{r,s}] %{hashfunc: hashfunc} = Enum.into(options, %{hashfunc: :sha256}) number = :crypto.hash(hashfunc, message) |> numberFromString() curve = CA.KnownCurves.secp384r1() diff --git a/lib/ecdsa.ex b/lib/ecdsa.ex index b825c97..da3e582 100644 --- a/lib/ecdsa.ex +++ b/lib/ecdsa.ex @@ -24,8 +24,6 @@ defmodule CA.ECDSA.OTP do def signature(name) do {:ok, sig} = :file.read_file name {{_,[{_,r},{_,s}]},""} = :asn1rt_nif.decode_ber_tlv sig - :io.format 'r: ~p~n', [r] - :io.format 's: ~p~n', [s] { :ca_enroll.decode_integer(r), :ca_enroll.decode_integer(s) } end