Subject: PSARC FastTrack [04/11/2007]: Support KCF Providers with Limited Digest Capability I am self-sponsoring the following case and marking it as "closed approved automatic". It only modifies consolidation private interfaces and does so in a compatible way. Template Version: @(#)sac_nextcase 1.2 04/14/09 SMI Copyright 2007 Sun Microsystems, Inc. 1. Introduction 1.1. Project/Component Working Name: Support KCF Providers with Limited Digest Capability 1.2. Name of Document Author/Supplier: Author: Krishna Yenduri 1.3 Date of This Document: 11 April, 2007 4. Technical Description 1. Overview This document describes changes to the Solaris Kernel Cryptographic SPI to support hardware providers with limitation. The Interface taxonomy is Consolidation Private. The Release taxonomy is Patch/Micro. 2. Problem Some crypto accelerator products like Sun Crypto Accelerator 6000 have a limit on the maximum input data that they can digest and hence can not do multi-part digest (and HMAC which uses a digest) operations. They can do single-part digest operation provided the input data size is below the maximum supported value. Currently, these providers when registered with Solaris Crypto Framework can not export the digest mechanisms at all. This limitation prevents PKCS #11 applications and some kernel clients from accelerating the digest operations using the hardware. So, there is a need to solve this limitation and enable consumers to use the hardware as much as possible. 3. Solution We relax the existing constraint that a provider must support multi-part digest routines to be able to set CRYPTO_FG_DIGEST flag for a digest mechanism. A provider is now allowed to export only a single-part digest routine and still set the CRYPTO_FG_DIGEST flag. A provider with the limitation needs to do the following: 1. Set the CRYPTO_LIMITED_HASH_SUPPORT flag, in pi_flags field of the crypto_provider_info_t structure, to indicate this limitation. 2. For each digest mechanism, specify the maximum buffer length it can digest in the cm_max_input_length field in crypto_mech_info_t structure and set the CRYPTO_FG_DIGEST flag in cm_func_group_mask field. 3. Return the error code, CRYPTO_BUFFER_TOO_BIG, if it gets an input buffer greater than the maximum supported length. The framework will use only the digest_init and digest SPI routines from such a provider. It will not use the routines - digest_update, digest_key, and digest_final from the provider. 3.1. Compatibility issues The size of crypto_mech_info_t structure remains unchanged as the field cm_max_input_length is an alias for the existing field, cm_max_key_length. We can safely do this because cm_max_key_length field is unused for a digest mechanism. There is no change in use of cm_max_key_length field for a HMAC mechanism. The framework will get the limit on maximum input data from the underlying digest used by the HMAC mechanism. 4. Bug/RFE Number(s): 6473274 5. Exported Interfaces: +--------------------------------+---------------------------+--------------+ | Interface | Classification | Comments | +--------------------------------+---------------------------+--------------+ | | | | | spi.h | Consolidation | include file | | | Private | | | | | | +--------------------------------+---------------------------+--------------+ 6. Resources and Schedule 6.4. Steering Committee requested information 6.4.1. Consolidation C-team Name: ON 6.5. ARC review type: FastTrack