From 3949471cf0f878b26987f7d422edb2c691f77659 Mon Sep 17 00:00:00 2001 From: 5HT Date: Tue, 29 Oct 2024 18:27:08 +0200 Subject: [PATCH] ANSI X9.142-2020 ECDSA oids --- lib/agreement/EC/curve.ex | 2 ++ lib/oid/x962.ex | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/agreement/EC/curve.ex b/lib/agreement/EC/curve.ex index 0f169e2..284455d 100644 --- a/lib/agreement/EC/curve.ex +++ b/lib/agreement/EC/curve.ex @@ -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} diff --git a/lib/oid/x962.ex b/lib/oid/x962.ex index cfd6e4a..329deb9 100644 --- a/lib/oid/x962.ex +++ b/lib/oid/x962.ex @@ -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} @@ -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}