Skip to content

Commit

Permalink
ANSI X9.142-2020 ECDSA oids
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Oct 29, 2024
1 parent 7f7e78e commit 3949471
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/agreement/EC/curve.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ defmodule CA.Curve do
require CA.Point
defstruct [:A, :B, :P, :N, :G, :name, :oid]

# ANSI X9.142–2020 ECDSA http://oid-info.com/get/1.3.132.0

def oid(:sect163k1), do: {1,3,132,0,1}
def oid(:sect163r2), do: {1,3,132,0,15}
def oid(:secp224r1), do: {1,3,132,0,33}
Expand Down
15 changes: 14 additions & 1 deletion lib/oid/x962.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule CA.X962 do
defmodule CA.X962 do # ALSO newer ANSI X9.142–2020 ECDSA for 1.3.132.0 curves
@moduledoc "CA ANSI X.962 OIDs."
def oid(:"id-ft-prime-field"), do: {1, 2, 840, 10045, 1, 1}
def oid(:"id-ft-characteristic-two-field"), do: {1, 2, 840, 10045, 1, 2}
Expand All @@ -15,6 +15,19 @@ defmodule CA.X962 do
def oid(:prime239v3), do: {1, 2, 840, 10045, 3, 1, 6}
def oid(:secp256r1), do: {1, 2, 840, 10045, 3, 1, 7}
def oid(:prime256v1), do: {1, 2, 840, 10045, 3, 1, 7}
def oid(:sect163k1), do: {1, 3, 132, 0, 1}
def oid(:sect163r2), do: {1, 3, 132, 0, 15}
def oid(:secp224r1), do: {1, 3, 132, 0, 33}
def oid(:sect233k1), do: {1, 3, 132, 0, 26}
def oid(:sect233r1), do: {1, 3, 132, 0, 27}
def oid(:sect283k1), do: {1, 3, 132, 0, 16}
def oid(:sect283r1), do: {1, 3, 132, 0, 17}
def oid(:secp384r1), do: {1, 3, 132, 0, 34}
def oid(:sect409k1), do: {1, 3, 132, 0, 36}
def oid(:sect409r1), do: {1, 3, 132, 0, 37}
def oid(:secp521r1), do: {1, 3, 132, 0, 35}
def oid(:sect571k1), do: {1, 3, 132, 0, 38}
def oid(:sect571r1), do: {1, 3, 132, 0, 39}
def oid(:"id-ds-ecdsa-with-SHA1"), do: {1, 2, 840, 10045, 4, 1}
def oid(:"id-ds-ecdsa-with-Recommended"), do: {1, 2, 840, 10045, 4, 2}
def oid(:"id-ds-ecdsa-with-SHA2"), do: {1, 2, 840, 10045, 4, 3}
Expand Down

0 comments on commit 3949471

Please sign in to comment.