`OpenSSL::PKey::EC::Point` should be able to get and set affine coordinates
維護者通常 1 天內回覆
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 領域
- cryptography
研究方向
未指定檔案或測試。先檢視現有的 OpenSSL::PKey::EC::Point API,以及 issue 中的壓縮點和未壓縮點範例。與維護者釐清提議的建構函式和座標存取設計,然後定義測試,顯示仿射座標擷取和點建構能如預期運作。
由索引模型根據 Issue 內容生成。
描述
It is possible using a little magic to create a point with a raw x and y:
def self.from_compressed_point(group, x, is_even)
x_value = x.to_s(2).rjust(32, "\x00")
prefix = is_even ? "\x02" : "\x03"
encoded = OpenSSL::BN.new [ prefix, x_value ].join, 2
OpenSSL::PKey::EC::Point.new(group, encoded)
end
One can similarly use some magic to get uncompressed points and turn them into two OpenSSL::BN instances
It would be better if we supported this without using compressed point form magic, like so (RBS signature with hypothetical overload):
class OpenSSL::PKey::EC::Point
# Since the OpenSSL operation returns both
def affine_coordinates -> [ OpenSSL::BN, OpenSSL::BN ]
# Convenance methods for above
attr_reader :x, :y -> OpenSSL::BN
# Choice 1 - Using Bool for Y
def initialize : (group: OpenSSL::PKey::EC::Group, x: OpenSSL::BN, even: Boolean) -> OpenSSL::PKey::EC::Point
# Choice 2 - Using a symbol for Y
def initialize : (group: OpenSSL::PKey::EC::Group, x: OpenSSL::BN, y:[ :even, :odd ]) -> OpenSSL::PKey::EC::Point
# Using X and Y directly
def initialize : (group: OpenSSL::PKey::EC::Group, x: OpenSSL::BN, y: OpenSSL::BN) -> OpenSSL::PKey::EC::Point
end
I've intentionally omitted mutating the X and Y of a point after creation. Because all of these have a different aridity they will not conflict. Similarly adding Jacobian would create an aridity == 4.
The big question is for choice 1 or 2 when creating an X and which Y value.
- 主要語言
- C
- 星號
- 276
- 分支
- 203
- 平均合併
- 1 天 7 小時
- 30 天內合併 PR
- 9
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
ruby/openssl 的其他 Issue
-
Add OpenSSL::SSL::SSLContext#client_hello_cb= (binding for SSL_CTX_set_client_hello_cb())可能已有人在做 @kou 於 5 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 53/100
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 55/100
維護者通常 1 天內回覆
-
Expose XOFs like SHAKE128 and SHAKE256可能已有人在做 @rhenium 於 102 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 48/100
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 35/100
維護者通常 1 天內回覆
-
Unchecked *_set_* calls可能已有人在做 @ndossche 於 172 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 35/100
維護者通常 1 天內回覆
相似的 Issue
-
mewencode: base256[] and base128[] are indexed out of bounds by a non-ASCII octet可能已有人在做 @kazu-yamamoto 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
kazu-yamamoto/Mew#276 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
area:gates area:gfx found-by:critic kind:gate-defect
難度 2/5 1-3 小時 新手友好度 78/100
InauguralSystems/EigenScript#1825 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 75/100
gbdev/homebrewhub-submit#20 ·