-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add digest to interface #159
Conversation
I had this discussion with @JesusMcCloud in the past; just because every kind of signature algorithm we currently support uses a Digest, that doesn't mean that every signature algorithm we might support in the future (PQC?) will use a Digest; so I was reluctant to add it to the interface. We could maybe have a |
This is really tricky, because even signature that could have a digest, might not always come with one, so nullable and not having it at all is semantically different.
|
well, we've run into this before at various points... kotlin has no good way to express class traits, i.e., to say that "any instance of this class must have one or the other of this marker interface". This is not legal. Also, there is no way to cleanly deal with multi-trait classes. This is also not legal. So if you ever need two or more marker interfaces on the same type, it becomes a complete mess; you end up having to create new interfaces for each possible intersection you might need, and update every implementation's inheritance list. I don't think this will be an issue for |
But do we not circumvent this problem by making |
see my previous comment. nullable and no digest at all are semantically different |
True, but so is |
Any updates on this? Should this be closed? @JesusMcCloud @iaik-jheher |
I propose to add digest as a variable to the
SignatureAlgorithm
interface in order to prevent the following code snippet.@JesusMcCloud told me to ask you about it.