Dual-function cryptographic functions support

Since version 3.19, openCryptoki supports several functions to perform two cryptographic operations simultaneously within a session. These functions are provided so as to avoid unnecessarily passing data back and forth to and from a token.

The following dual-function operations are provided:

Table 1. Dual-function cryptographic functions

Table with 2 columns that contain information about dual-function cryptographic functions.

Function Purpose
C_DigestEncryptUpdate() continues multiple-part digest and encryption operations, processing another data part. Digest and encryption operations must both be active (they must have been initialized with C_DigestInit() and C_EncryptInit(), respectively). This function may be called any number of times in succession, and may be interspersed with C_DigestUpdate() and C_EncryptUpdate() calls.
C_DecryptDigestUpdate() continues a multiple-part combined decryption and digest operation, processing another data part. Decryption and digesting operations must both be active (they must have been initialized with C_DecryptInit() and C_DigestInit(), respectively). This function may be called any number of times in succession, and may be interspersed with C_DecryptUpdate() and C_DigestUpdate() calls.
C_SignEncryptUpdate() continues a multiple-part combined signature and encryption operation, processing another data part. Signature and encryption operations must both be active (they must have been initialized with C_SignInit() and C_EncryptInit(), respectively). This function may be called any number of times in succession, and may be interspersed with C_SignUpdate() and C_EncryptUpdate() calls
C_DecryptVerifyUpdate() continues a multiple-part combined decryption and verification operation, processing another data part. Decryption and signature operations must both be active (they must have been initialized with C_DecryptInit() and C_VerifyInit(), respectively). This function may be called any number of times in succession, and may be interspersed with C_DecryptUpdate() and C_VerifyUpdate() calls.

You can find detailed information about dual-function cryptographic functions, illustrated with code samples, in PKCS #11 Specification Version 3.1.