Handling of algorithms which support variable key sizes
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- rust
- 領域
- cryptography
調査の方向性
まず、KeyInit、KeyIvInit、InnerInit trait の定義と、リンクされている RustCrypto/block-ciphers の issue を読みます。提案されている 2 つの API の方向性を比較し、ocb3 などの上位クレートへの影響も含めます。完了には、採用するアプローチの決定、trait のドキュメントまたは実装の更新、可変キーサイズの初期化に対するカバレッジが必要です。
索引モデルが issue の本文から書いたものです。
説明
This issue a follow up on https://github.com/RustCrypto/block-ciphers/issues/495
Right now API of the KeyInit/KeyIvInit/InnerInit traits support algorithms with variable key sizes (block ciphers and other algorithms built on top of them) using the new_from_slice(s) methods. For example, Blowfish supports key sizes from 4 to 56 bytes. The idea here is that the KeySize associated type indicates the "default" key size (usually the biggest key size), but if necessary algorithms could be initialized with key sizes which vary at runtime. The important difference between Blowfish and ciphers like AES (where we introduce separate block cipher types for each supported key size) is that for ciphers with variable key size support encryption/decryption does not depend on key size.
As argued by @tarcieri in the discussion, this approach may cause confusion when users want to support several key sizes, but do not know about the fact that we implemented support for them using the new_from_slice(s) methods. There is also a problem with some higher-level crates which do not properly account for variable key sizes. For example, ocb3 implements KeyInit directly without accounting for new_from_slice. Arguably, it should instead implement the InnerInit trait and rely on the blanket impls.
We have two options:
- Keep the current API and intent behind it intact. Improve docs to better explain how to deal with variable key sizes. Fix the higher-level crates.
- Make implementations generic over key sizes with appropriate trait bounds. It would make it clearer for users that the algorithm supports different key sizes. We would lose support for initializing algorithms with key sizes variable at runtime, but it's arguably an anti-pattern and not that important in practice. With this option it also may be reasonable to remove the
new_from_slice(s)methods from our traits.
Personally, I lean towards the first option, but it's not a strong opinion.
- 主要言語
- Rust
- スター
- 760
- フォーク
- 258
- 平均マージ
- 2時間 53分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RustCrypto/traits のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
RustCrypto/traits#2487 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
RustCrypto/traits#2482 · コメント 5 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 32/100
RustCrypto/traits#2478 · コメント 5 件 ·
-
cipher
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
RustCrypto/traits#2424 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
RustCrypto/traits#2401 ·
RustCrypto/traits の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
needs: triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
area:docs documentation P3
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Raaif-Yousuf/Wingman#837 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
storytold/photocraft#6759 ·
メンテナーはふだん 1 日以内に返信