Skip to content

Remove dead code in crypto and fix algo bug#322

Merged
divarvel merged 1 commit intoeclipse-biscuit:mainfrom
saoirse-a:crypto-dead-code
Apr 22, 2026
Merged

Remove dead code in crypto and fix algo bug#322
divarvel merged 1 commit intoeclipse-biscuit:mainfrom
saoirse-a:crypto-dead-code

Conversation

@saoirse-a
Copy link
Copy Markdown
Contributor

The (ultimately not public) ed25519 and p256 crypto types expose a lot of methods that are never called; dead code left over from when the abstraction over multiple signing algorithms was added.

The P256 code in several places had copy pasted code from ed25519 which incorrectly specified the algorithm as as ed25519; most of these were dead code, but one was in the Hash implementation of P256's public key, which incorrectly hashed the ed25519 identifier.

The (ultimately not public) ed25519 and p256 crypto types expose a lot
of methods that are never called; dead code left over from when the
abstraction over multiple signing algorithms was added.

The P256 code in several places had copy pasted code from ed25519 which
incorrectly specified the algorithm as as ed25519; most of these were
dead code, but one was in the Hash implementation of P256's public key,
which incorrectly hashed the ed25519 identifier.
impl Hash for PublicKey {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
(crate::format::schema::public_key::Algorithm::Ed25519 as i32).hash(state);
(crate::format::schema::public_key::Algorithm::Secp256r1 as i32).hash(state);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

highlighting this as the actual bug fix

@divarvel divarvel merged commit 7d5ba76 into eclipse-biscuit:main Apr 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants