BeamMCP.Signer.Ed25519.sign/2 is tested with fixed inputs. A property test would cover many inputs at once:
- For random bytes and a freshly generated key, the signature always verifies with
:crypto.verify/5 against the matching public key.
- The signature never verifies over bytes that differ in any way.
- The key passed as a function,
private_key: fn -> key end, signs identically to the same key passed as bytes.
What to change:
- Add StreamData as a test-only dependency:
{:stream_data, "~> 1.4", only: :test}.
- Add a property test under
test/beam_mcp/signer/. The existing ed25519_test.exs shows how keys are generated in tests (:crypto.generate_key(:eddsa, :ed25519)). No key is ever written to the tree.
Done when:
mix test passes, including the new property.
mix credo --strict and mix format --check-formatted are clean.
- You have shown the property can fail: break the signing in a throwaway copy (for example, sign different bytes), show the property turn red, then restore it. Mention this in the PR.
How to contribute: see CONTRIBUTING.md. Sign off your commit with git commit -s.
BeamMCP.Signer.Ed25519.sign/2is tested with fixed inputs. A property test would cover many inputs at once::crypto.verify/5against the matching public key.private_key: fn -> key end, signs identically to the same key passed as bytes.What to change:
{:stream_data, "~> 1.4", only: :test}.test/beam_mcp/signer/. The existinged25519_test.exsshows how keys are generated in tests (:crypto.generate_key(:eddsa, :ed25519)). No key is ever written to the tree.Done when:
mix testpasses, including the new property.mix credo --strictandmix format --check-formattedare clean.How to contribute: see CONTRIBUTING.md. Sign off your commit with
git commit -s.