ed448-goldilocks: `SigningKey::sign_ctx` docs say "Ed448ph", but it signs with Ed448 (phflag 0)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 80/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
src/sign/signing_key.rs、src/sign/context.rs、src/sign/verifying_key.rs のコメントを読み、引用されている trait の実装とテストを確認して、各 trait がどのモードを使用するかを確かめてください。ドキュメントを更新し、context 付き Ed448 と Ed448ph を区別してください。必要に応じて、src/sign.rs にある context なしの鍵用 trait のモードも明確にしてください。コメントが一貫して各モードを説明し、引用されたコードと一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
SigningKey::sign_ctx has this doc comment: "Sign a message in the given context with this [SigningKey] using the Ed448ph algorithm" (src/sign/signing_key.rs:444-445). The function calls ExpandedSecretKey::sign_ctx, which is self.sign_inner(0, ctx, m) (src/sign/expanded.rs:94-96). phflag 0 is Ed448 (PureEdDSA) with a context, as the inner doc comment says (expanded.rs:89-93). The tests agree with the code: the RFC 8032 Ed448 vector with context "foo" is checked through sign_ctx (src/sign/verifying_key.rs:349-356, :410-411), and the Ed448ph vectors go through sign_prehashed (:367-380, :401-409). The verifier counterpart verify_ctx is already documented as "Ed448" mode (verifying_key.rs:225-230).
Two related comments describe the context type as Ed448ph only, although the same type is also used for Ed448 with a context:
SigningKey::with_context(signing_key.rs:425-426): "Create a signing context that can be used for Ed448ph with [signature::DigestSigner]". The returnedContextalso implementssignature::Signer(:282-287), which callssign_ctx(Ed448).DigestSignerandPrehashSigneron it (:257-280) are Ed448ph.Context(src/sign/context.rs:1): "Ed448 contexts as used by Ed448ph." On the verifier side,Verifier for Context<VerifyingKey>callsverify_ctx, which is Ed448 (verifying_key.rs:80-84), andDigestVerifieris Ed448ph (:86-100).VerifyingKey::with_context(verifying_key.rs:200) mentions onlyDigestVerifier.
These are the same in 0.14.0-pre.15 (latest on crates.io) and on master (af04a147).
Suggested wording:
--- a/ed448-goldilocks/src/sign/signing_key.rs
- /// Create a signing context that can be used for Ed448ph with
- /// [`signature::DigestSigner`]
+ /// Create a signing context. With [`signature::Signer`] it signs with Ed448
+ /// (PureEdDSA) using this context; with [`signature::DigestSigner`] or
+ /// [`signature::hazmat::PrehashSigner`] it signs with Ed448ph (HashEdDSA) using this context.
@@
- /// Sign a `message` in the given `context` with this [`SigningKey`] using the Ed448ph algorithm
- /// defined in [RFC8032 §5.2](https://datatracker.ietf.org/doc/html/rfc8032#section-5.2).
+ /// Sign a `message` in the given `context` with this [`SigningKey`] using the Ed448 algorithm
+ /// (PureEdDSA, not Ed448ph) defined in [RFC8032 §5.2](https://datatracker.ietf.org/doc/html/rfc8032#section-5.2).
--- a/ed448-goldilocks/src/sign/context.rs
-/// Ed448 contexts as used by Ed448ph.
+/// Ed448 contexts, used by both Ed448 (with context) and Ed448ph.
--- a/ed448-goldilocks/src/sign/verifying_key.rs
- /// Create a context for this verifying key that can be used with [`signature::DigestVerifier`].
+ /// Create a context for this verifying key. [`signature::Verifier`] verifies Ed448 (PureEdDSA)
+ /// with this context; [`signature::DigestVerifier`] verifies Ed448ph with this context.
Optionally, the module docs (src/sign.rs:35-41) could also say which mode each trait uses on the bare keys. Signer/Verifier are Ed448 with an empty context (signing_key.rs:250-255, verifying_key.rs:59-63). DigestSigner, PrehashSigner and DigestVerifier are Ed448ph with an empty context (signing_key.rs:228-248, verifying_key.rs:65-78). That difference is easy to miss when the code is written against the signature traits.
- 主要言語
- Rust
- スター
- 884
- フォーク
- 319
- 平均マージ
- 18時間 34分
- マージ済み PR(30日)
- 7
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RustCrypto/elliptic-curves のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
RustCrypto/elliptic-curves#1989 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
ed448-goldilocks: `MontgomeryPoint * Scalar` returns [k+1]P for odd k (Montgomery ladder is missing the final conditional swap)対応中かも @lyn1dev が 12 日前に担当しました。 オープン
難易度 4/5 1〜2日 初心者へのやさしさ 55/100
RustCrypto/elliptic-curves#1988 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
RustCrypto/elliptic-curves#1982 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
RustCrypto/elliptic-curves#1972 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
ed448-goldilocks: decompress_unchecked ignores bits 448–454 and does not check y < p (RFC 8032 §5.2.3), so Wycheproof #63–65 verify and y + p decodes対応中かも @DefaultMo が 44 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
RustCrypto/elliptic-curves#1970 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
RustCrypto/elliptic-curves の issue をすべて見る
似ている issue
-
The new tests repeat each other and one only checks a two-line helper再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンinfra
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
storytold/wordcraft#9405 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
in-progress
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
area: ai-assistants documentation help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
BetaBots-LLC/latticegate#17 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
storytold/craft-libs#5594 ·
メンテナーはふだん 1 日以内に返信
-
available documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Nixitov/Riptide-Native#932 ·
メンテナーはふだん 1 日以内に返信