Skip to content

Support for multi-part operations #250

@jacobprudhomme

Description

@jacobprudhomme

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions