Lack of immediate access to GenericArray to view associated functions and trait impls leads to confusion and annoyance.
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- rust
- 領域
- cryptography
調査の方向性
まず、aes-gcm と aes-gcm-siv が Nonce をどのように公開しているか、また GenericArray がどのように使われているかを確認し、その後 issue の議論を読んで合意された API の方向性を把握してください。完了条件は、maintainer が 1 つのアプローチ(GenericArray の再エクスポート、wrapper の追加、または別の設計)を選択して文書化し、互換性とユーザー向けドキュメントに対処することです。
索引モデルが issue の本文から書いたものです。
説明
It's understandable that aes-gcm and aes-gcm-siv use generic_array's GenericArray's for the Nonce type. What's less understandable though is why this is left an opaque type and not either a wrapper with its own documentation of its methods custom to the uses of ges-gcm* or that GenericArray is not re-exported both for convenience as well as documentation. As a new user, I was really confused by the fact that I could not access the documentation for the underlying type to see what associated functions/methods it supports or even how to get one besides converting from a slice (as is demonstrated by the top-level crate documentation). Not everyone knows the generic_array crate and knows what GenericArray is and I had to look through the source to find the implementations of what I thought were a private type but turned out to be an import that is used on the front end by the user despite not only not being re-exported but there being no mention in the top-level crate documentation where this type comes from.
I would personally prefer turning Nonce into a newtype custom wrapper but I understand that this can be an issue due to the fact that it fundamentally introduces breaking changes.
The second best option is to simply re-export GenericArray. After all, aes-gcm-siv re-exports the entire aead crate just like aes-gcm which also re-exports aes in addition. I think this is by far the most uncontroversial option but the seemingly random re-export seems for some reason distasteful, I propose a third proposal:
This one is a compromise between the last two: create a new type called something like NonceWrapper that does exactly what I mentioned in the first proposal and then impl From for Nonce, unwrapping it. One could then have replace all instances of taking a Nonce type with impl Into. I can't see any breakage that would come of this but obviously it would still work even without the function refactors, just less convenient.
I would be willing to make a PR if and when a solution is agreed upon. I would love to hear others' thoughts.
- 主要言語
- Rust
- スター
- 961
- フォーク
- 200
- 平均マージ
- 1時間 30分
- マージ済み PR(30日)
- 6
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RustCrypto/AEADs のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
RustCrypto/AEADs#864 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
RustCrypto/AEADs#765 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
RustCrypto/AEADs#755 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
RustCrypto/AEADs#706 · コメント 1 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
RustCrypto/AEADs#660 · コメント 7 件 ·
RustCrypto/AEADs の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
nautechsystems/nautilus_trader#5095 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
stellar/rs-soroban-env#1739 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug good first issue package: quic
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100