Current section

23 Versions

Jump to

Compare versions

3 files changed
+15 additions
-4 deletions
  @@ -11,4 +11,4 @@
11 11 {<<"Info">>,<<"http://ed25519.cr.yp.to">>}]}.
12 12 {<<"name">>,<<"ed25519">>}.
13 13 {<<"requirements">>,[]}.
14 - {<<"version">>,<<"1.3.2">>}.
14 + {<<"version">>,<<"1.3.3">>}.
  @@ -118,6 +118,19 @@ defmodule Ed25519 do
118 118
119 119 defp isoncurve({x, y}), do: (-x * x + y * y - 1 - @d * x * x * y * y) |> mod(@p) == 0
120 120
121 + @doc """
122 + Returns whether a given `key` lies on the ed25519 curve.
123 + """
124 + @spec on_curve?(key) :: boolean
125 + def on_curve?(key) do
126 + try do
127 + decodepoint(key)
128 + true
129 + rescue
130 + _error -> false
131 + end
132 + end
133 +
121 134 @doc """
122 135 Sign a message
  @@ -4,7 +4,7 @@ defmodule Ed25519.Mixfile do
4 4 def project do
5 5 [
6 6 app: :ed25519,
7 - version: "1.3.2",
7 + version: "1.3.3",
8 8 elixir: "~> 1.7",
9 9 name: "Ed25519",
10 10 source_url: "https://github.com/mwmiller/ed25519_ex",
  @@ -22,9 +22,7 @@ defmodule Ed25519.Mixfile do
22 22
23 23 defp deps do
24 24 [
25 - {:earmark, "~> 1.4", only: :dev},
26 25 {:ex_doc, "~> 0.23", only: :dev},
27 - {:credo, "~> 1.4", only: [:dev, :test]}
28 26 ]
29 27 end