-
Notifications
You must be signed in to change notification settings - Fork 87
Description
Hello Cryptoki team!
Is there any plan to add bindings for the multi-part operations (C_{Digest,Encrypt,Decrypt,Sign,Verify}{Init,Update,Final}) to the library?
If so, I already have some code written for the digest operations that I can contribute immediately. I would be happy to take on adding support for the others too.
Getting ahead of myself here, but in writing this, would it be preferred to keep the implementation as bare as possible to conform to the spec (i.e. letting the device return CKR_OPERATION_NOT_INITIALIZED if a user tries to call an update function without having first called an init one, essentially leaving it up to human error)? Or is there some benefit in having some form of internal state machine to a Session so that we don't allow users to call an update or final function if the corresponding init function has not been called, disallowing these kinds of errors at compile-time instead of runtime?
I'm not sure where to stand on this, as it makes for better developer experience, but also strays from the exact expected behaviour of these functions as defined in the spec, and obviates the need for certain errors.