Synergy Software Package User's Manual

#include <sf_crypto_cipher_api.h>

Data Fields

ssp_err_t(* open )(sf_crypto_cipher_ctrl_t *const p_ctrl, sf_crypto_cipher_cfg_t const *const p_cfg)
 Opens SSP Crypto Cipher framework. This function initializes a control block of the framework module based on the configuration parameters such as the key type, key size and chaining mode. The module allows users to have multiple instances with different control blocks, if required. More...
 
ssp_err_t(* cipherInit )(sf_crypto_cipher_ctrl_t *const p_ctrl, sf_crypto_cipher_op_mode_t cipher_operation_mode, sf_crypto_key_t const *const p_key, sf_crypto_cipher_algorithm_init_params_t *const p_algorithm_specific_params)
 Initializes a cipher operation. Must be called after open() or cipherFinal() is called, to initialize a new cipher operation. Unless a different key type or key size or chaining mode is used, users do not need to close the module for a new cipher operation but can call this function to restart another cipher operation. More...
 
ssp_err_t(* cipherUpdate )(sf_crypto_cipher_ctrl_t *const p_ctrl, sf_crypto_data_handle_t const *const p_data_in, sf_crypto_data_handle_t *const p_data_out)
 Encrypts / decrypts input data and writes it to the output buffer. Can be called multiple times for additional blocks of data. If input length is 0 this method does nothing. There may be 0 to (input length+block size - 1) bytes of data for AES operations. For RSA operation there will be no output until cipherFinal() is called. RSA Encryption is only supported with the RSA Public Key. RSA Decryption is only supported with the RSA Private Key. More...
 
ssp_err_t(* cipherFinal )(sf_crypto_cipher_ctrl_t *const p_ctrl, sf_crypto_data_handle_t const *const p_data_in, sf_crypto_data_handle_t *const p_data_out)
 Encrypts/decrypts all/last block of data and writes to the output buffer. Once cipherFinal() is called, no additional call of cipherUpdate() is allowed but cipherInit() can be called to initialize a new cipher operation unless another key type / key size/chaining mode is needed. In such a case a call to close() and open() is required. For AES operations, the number of bytes output into output data buffer may be larger or smaller than input length or even 0. RSA Encryption is only supported with the RSA Public Key. RSA Decryption is only supported with the RSA Private Key. More...
 
ssp_err_t(* cipherAadUpdate )(sf_crypto_cipher_ctrl_t *const p_ctrl, sf_crypto_data_handle_t const *const p_aad)
 Updates AAD (Additional Authenticated Data) for AES GCM operation. Can be called multiple times for additional blocks of data. This is ONLY to provide AAD for AES GCM operation. Not applicable to any other algorithms or modes. This has to be called prior to processing any plain text / cipher text data. In other words, before any call to cipherUpdate() or cipherFinal() is made. More...
 
ssp_err_t(* close )(sf_crypto_cipher_ctrl_t *const p_ctrl)
 Closes SSP Crypto Cipher framework. This function resets a control block of the framework module and allows users to re-configure the module differently. For instance, users can close the module and re-open it with different key type or key size or chaining mode / algorithm for a new cipher operation. More...
 
ssp_err_t(* versionGet )(ssp_version_t *const p_version)
 Get version of SSP Crypto Cipher framework. More...
 

Detailed Description

Shared Interface definition for the SSP Crypto Cipher framework module

Field Documentation

◆ cipherAadUpdate

ssp_err_t(* sf_crypto_cipher_api_t::cipherAadUpdate) (sf_crypto_cipher_ctrl_t *const p_ctrl, sf_crypto_data_handle_t const *const p_aad)

Updates AAD (Additional Authenticated Data) for AES GCM operation. Can be called multiple times for additional blocks of data. This is ONLY to provide AAD for AES GCM operation. Not applicable to any other algorithms or modes. This has to be called prior to processing any plain text / cipher text data. In other words, before any call to cipherUpdate() or cipherFinal() is made.

Implemented as
Parameters
[in]p_ctrlPointer to Crypto Cipher Framework control block structure.
[in]p_aadPointer to an input data buffer containing AAD and the AAD length.
Note
Data buffer must be WORD aligned.

◆ cipherFinal

ssp_err_t(* sf_crypto_cipher_api_t::cipherFinal) (sf_crypto_cipher_ctrl_t *const p_ctrl, sf_crypto_data_handle_t const *const p_data_in, sf_crypto_data_handle_t *const p_data_out)

Encrypts/decrypts all/last block of data and writes to the output buffer. Once cipherFinal() is called, no additional call of cipherUpdate() is allowed but cipherInit() can be called to initialize a new cipher operation unless another key type / key size/chaining mode is needed. In such a case a call to close() and open() is required. For AES operations, the number of bytes output into output data buffer may be larger or smaller than input length or even 0. RSA Encryption is only supported with the RSA Public Key. RSA Decryption is only supported with the RSA Private Key.

Implemented as
Parameters
[in,out]p_ctrlPointer to Crypto Cipher Framework control block structure.
[in]p_data_inPointer to an input data buffer and the input data length.
[in,out]p_data_outPointer to the output data buffer and the buffer size on input. If there is data to be output, buffer is filled and the length is updated.
Note
Data buffers must be WORD aligned.

◆ cipherInit

ssp_err_t(* sf_crypto_cipher_api_t::cipherInit) (sf_crypto_cipher_ctrl_t *const p_ctrl, sf_crypto_cipher_op_mode_t cipher_operation_mode, sf_crypto_key_t const *const p_key, sf_crypto_cipher_algorithm_init_params_t *const p_algorithm_specific_params)

Initializes a cipher operation. Must be called after open() or cipherFinal() is called, to initialize a new cipher operation. Unless a different key type or key size or chaining mode is used, users do not need to close the module for a new cipher operation but can call this function to restart another cipher operation.

Implemented as
Parameters
[in,out]p_ctrlPointer to Crypto Cipher Framework control block structure.
[in]cipher_operation_modeSpecifies encrypt or decrypt operation.
[in]p_keyThe key to be used for the cipher operation.
[in]p_algorithm_specific_paramsAlgorithm specific parameters. Allocate and fill parameters specific to the algorithm for the key type configured at open().

◆ cipherUpdate

ssp_err_t(* sf_crypto_cipher_api_t::cipherUpdate) (sf_crypto_cipher_ctrl_t *const p_ctrl, sf_crypto_data_handle_t const *const p_data_in, sf_crypto_data_handle_t *const p_data_out)

Encrypts / decrypts input data and writes it to the output buffer. Can be called multiple times for additional blocks of data. If input length is 0 this method does nothing. There may be 0 to (input length+block size - 1) bytes of data for AES operations. For RSA operation there will be no output until cipherFinal() is called. RSA Encryption is only supported with the RSA Public Key. RSA Decryption is only supported with the RSA Private Key.

Implemented as
Parameters
[in,out]p_ctrlPointer to Crypto Cipher Framework control block structure.
[in]p_data_inPointer to an input data buffer and the input data length.
[in,out]p_data_outPointer to an output data buffer and the buffer size on input. If there is data to be output, buffer is filled and the length is updated.
Note
Data buffers must be WORD aligned.

◆ close

ssp_err_t(* sf_crypto_cipher_api_t::close) (sf_crypto_cipher_ctrl_t *const p_ctrl)

Closes SSP Crypto Cipher framework. This function resets a control block of the framework module and allows users to re-configure the module differently. For instance, users can close the module and re-open it with different key type or key size or chaining mode / algorithm for a new cipher operation.

Implemented as
Parameters
[in,out]p_ctrlPointer to Crypto Cipher Framework control block structure.

◆ open

ssp_err_t(* sf_crypto_cipher_api_t::open) (sf_crypto_cipher_ctrl_t *const p_ctrl, sf_crypto_cipher_cfg_t const *const p_cfg)

Opens SSP Crypto Cipher framework. This function initializes a control block of the framework module based on the configuration parameters such as the key type, key size and chaining mode. The module allows users to have multiple instances with different control blocks, if required.

Implemented as
Parameters
[in,out]p_ctrlPointer to Crypto Cipher Framework control block structure. Caller only needs to allocate sf_crypto_cipher_instance_ctrl_t and not fill any parameters.
[in]p_cfgPointer to sf_crypto_cipher_cfg_t configuration structure. All elements of this structure must be filled by caller.

◆ versionGet

ssp_err_t(* sf_crypto_cipher_api_t::versionGet) (ssp_version_t *const p_version)

Get version of SSP Crypto Cipher framework.

Implemented as
Parameters
[in]p_versionPointer to the memory to store the module version.

The documentation for this struct was generated from the following file: