Skip to content

Redesign Symmetric types#401

Open
kyay10 wants to merge 8 commits intoa-sit-plus:nextfrom
kyay10:redesign
Open

Redesign Symmetric types#401
kyay10 wants to merge 8 commits intoa-sit-plus:nextfrom
kyay10:redesign

Conversation

@kyay10
Copy link
Copy Markdown

@kyay10 kyay10 commented Jan 21, 2026

The key trick is to use SymmetricEncryptionAlgorithm to hold the type parameters (i.e. Auth and Nonce). Then, the sealed hierarchies no longer rely on interfaces, instead, they provide extensions that when over the relevant inheritors, and use absurd when an inheritor cannot possibly be called on this method.

@kyay10
Copy link
Copy Markdown
Author

kyay10 commented Jan 21, 2026

There's one test in ValidationApiTest that seems broken due to a certificate expiry. I get the failure without my changes, so it's not my code that caused it lol

Copy link
Copy Markdown
Collaborator

@JesusMcCloud JesusMcCloud left a comment

Choose a reason for hiding this comment

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

Looks really good! Much simpler Code and it still seems impossible to wire sealed boxes, algorithms and keys in an illegal way. I do need to tinker with it a bit in my IDE, to double-check. @iaik-jheher what is your take on this?

@kyay10 kyay10 requested a review from JesusMcCloud January 27, 2026 15:52
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