Skip to content

Add X448 known-answer tests and benchmark coverage#33

Merged
AeonDave merged 1 commit into
mainfrom
codex/add-curve448/x448-for-key-exchange
Oct 24, 2025
Merged

Add X448 known-answer tests and benchmark coverage#33
AeonDave merged 1 commit into
mainfrom
codex/add-curve448/x448-for-key-exchange

Conversation

@AeonDave
Copy link
Copy Markdown
Owner

Summary

  • add embedded RFC 7748 known-answer vectors for X448 and wire tests through the loader
  • cover the existing Diffie-Hellman benchmark suite with an X448 entry

Testing

  • go test ./...

https://chatgpt.com/codex/tasks/task_e_68fb54baac7c8325bbb49ff272fbc962

@AeonDave AeonDave merged commit f4952bb into main Oct 24, 2025
2 checks passed
@AeonDave AeonDave deleted the codex/add-curve448/x448-for-key-exchange branch October 24, 2025 12:30
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ecdh/x448.go
Comment on lines +199 to +205
func scalarMultX448(out *[x448PointSize]byte, scalar *[x448ScalarSize]byte, point *[x448PointSize]byte) {
var k [x448ScalarSize]byte
copy(k[:], scalar[:])
clampScalarX448(k[:])
x1 := decodeLittleEndian(point[:])
x2 := big.NewInt(1)
z2 := big.NewInt(0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Implement X448 ladder with constant‑time field arithmetic

The new X448 implementation builds the Montgomery ladder using math/big operations (scalarMultX448), which allocate and branch based on operand size. These operations are not constant‑time and leak information about the private scalar through timing differences, violating the project’s requirement for constant‑time ECDH primitives. Because the method is now exposed via NewX448 and used in Hybrid KEMs, an attacker who can measure timings during a key exchange can recover bits of the secret scalar. Consider replacing the big‑integer arithmetic with constant‑time field routines similar to the standard library’s X25519/X448 implementations.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant