TrustCore SDK Crypto Interface API reference  version 2.0
crypto_interface_aes_xts.h File Reference

Cryptographic Interface header file for declaring AES-XTS methods. More...

Go to the source code of this file.

Functions

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESXTSDecrypt (MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *pCtx, ubyte pTweak[AES_BLOCK_SIZE], ubyte *pCipher, ubyte4 cipherLen)
 Performs the AES-XTS cipher operation to do an inplace decryption. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESXTSDecryptExt (MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *pCtx, ubyte pTweak[AES_BLOCK_SIZE], ubyte *pCipher, ubyte4 cipherLen, void *pExtCtx)
 Performs the AES-XTS cipher operation to do an inplace decryption. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESXTSEncrypt (MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *pCtx, ubyte pTweak[AES_BLOCK_SIZE], ubyte *pPlain, ubyte4 plainLen)
 Performs the AES-XTS cipher operation to do an inplace encryption. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESXTSEncryptExt (MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *pCtx, ubyte pTweak[AES_BLOCK_SIZE], ubyte *pPlain, ubyte4 plainLen, void *pExtCtx)
 Performs the AES-XTS cipher operation to do an inplace encryption. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_CloneAESXTSCtx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx)
 Clones an AES-XTS context. More...
 
MOC_EXTERN BulkCtx CRYPTO_INTERFACE_CreateAESXTSCtx (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *pKeyMaterial, sbyte4 keyLength, sbyte4 encrypt)
 Creates and initializes a new AES-XTS context. More...
 
MOC_EXTERN BulkCtx CRYPTO_INTERFACE_CreateAESXTSCtxExt (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *pKeyMaterial, sbyte4 keyLength, sbyte4 encrypt, void *pExtCtx)
 Creates and initializes a new AES-XTS context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DeleteAESXTSCtx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ppCtx)
 Deletes an AES-XTS context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DeleteAESXTSCtxExt (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ppCtx, void *pExtCtx)
 Deletes an AES-XTS context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DoAESXTS (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pData, sbyte4 dataLen, sbyte4 encrypt, ubyte *pTweak)
 Performs the AES-XTS cipher operation to do an inplace encryption or decryption. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DoAESXTSExt (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pData, sbyte4 dataLen, sbyte4 encrypt, ubyte *pTweak, void *pExtCtx)
 Performs the AES-XTS cipher operation to do an inplace encryption or decryption. More...
 

Detailed Description

Add details here.

crypto_interface_aes_xts.h

Function Documentation

◆ CRYPTO_INTERFACE_AESXTSDecrypt()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESXTSDecrypt ( MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *  pCtx,
ubyte  pTweak[AES_BLOCK_SIZE],
ubyte *  pCipher,
ubyte4  cipherLen 
)
Parameters
pCtxA pointer to a previously inialized context.
pTweakThe 16 byte tweak.
pCipherThe ciphertext to decrypt.
cipherLenLength in bytes of pCipher. Does not have to be a multiple of the AES block size (16).
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h

◆ CRYPTO_INTERFACE_AESXTSDecryptExt()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESXTSDecryptExt ( MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *  pCtx,
ubyte  pTweak[AES_BLOCK_SIZE],
ubyte *  pCipher,
ubyte4  cipherLen,
void *  pExtCtx 
)
Parameters
pCtxA pointer to a previously inialized context.
pTweakThe 16 byte tweak.
pCipherThe ciphertext to decrypt.
cipherLenLength in bytes of pCipher. Does not have to be a multiple of the AES block size (16).
pExtCtxAn extended context reserved for future use.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h

◆ CRYPTO_INTERFACE_AESXTSEncrypt()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESXTSEncrypt ( MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *  pCtx,
ubyte  pTweak[AES_BLOCK_SIZE],
ubyte *  pPlain,
ubyte4  plainLen 
)
Parameters
pCtxA pointer to a previously inialized context.
pTweakThe 16 byte tweak.
pPlainThe plaintext to encrypt.
plainLenLength in bytes of pPlain. Does not have to be a multiple of the AES block size (16).
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h

◆ CRYPTO_INTERFACE_AESXTSEncryptExt()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_AESXTSEncryptExt ( MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *  pCtx,
ubyte  pTweak[AES_BLOCK_SIZE],
ubyte *  pPlain,
ubyte4  plainLen,
void *  pExtCtx 
)
Parameters
pCtxA pointer to a previously inialized context.
pTweakThe 16 byte tweak.
pPlainThe plaintext to encrypt.
plainLenLength in bytes of pPlain. Does not have to be a multiple of the AES block size (16).
pExtCtxAn extended context reserved for future use.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h

◆ CRYPTO_INTERFACE_CloneAESXTSCtx()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_CloneAESXTSCtx ( MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx  pCtx,
BulkCtx *  ppNewCtx 
)
Parameters
pCtxPointer to an instantiated BulkCtx.
ppNewCtxDouble pointer to the BulkCtx to be created and populated with the data from the source context.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h.

◆ CRYPTO_INTERFACE_CreateAESXTSCtx()

MOC_EXTERN BulkCtx CRYPTO_INTERFACE_CreateAESXTSCtx ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *  pKeyMaterial,
sbyte4  keyLength,
sbyte4  encrypt 
)

Note it is the callers responsibility to free this object after use by calling CRYPTO_INTERFACE_DeleteAESXTSCtx.

Parameters
pKeyMaterialKey material to use for the cipher operation.
keyLengthLength in bytes of the key material. Two AES-128 or AES-256 keys will be formed hence keyLength must be either 32 or 64.
encryptTRUE to prepare the context for encryption; FALSE to prepare the context for decryption.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_CreateAESXTSCtxExt()

MOC_EXTERN BulkCtx CRYPTO_INTERFACE_CreateAESXTSCtxExt ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *  pKeyMaterial,
sbyte4  keyLength,
sbyte4  encrypt,
void *  pExtCtx 
)

Note it is the callers responsibility to free this object after use by calling CRYPTO_INTERFACE_DeleteAESXTSCtxExt.

Parameters
pKeyMaterialKey material to use for the cipher operation.
keyLengthLength in bytes of the key material. Two AES-128 or AES-256 keys will be formed hence keyLength must be either 32 or 64.
encryptTRUE to prepare the context for encryption; FALSE to prepare the context for decryption.
pExtCtxAn extended context reserved for future use.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_DeleteAESXTSCtx()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DeleteAESXTSCtx ( MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *  ppCtx)
Parameters
ppCtxPointer to the BulkCtx to be deleted.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_DeleteAESXTSCtxExt()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DeleteAESXTSCtxExt ( MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *  ppCtx,
void *  pExtCtx 
)
Parameters
ppCtxPointer to the BulkCtx to be deleted.
pExtCtxAn extended context reserved for future use.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_DoAESXTS()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DoAESXTS ( MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx  pCtx,
ubyte *  pData,
sbyte4  dataLen,
sbyte4  encrypt,
ubyte *  pTweak 
)

This is effectively a wrapper of CRYPTO_INTERFACE_AESXTSEncrypt and CRYPTO_INTERFACE_AESXTSDecrypt.

Parameters
pCtxA previously initialized context.
pDataData to encrypt or decrypt.
dataLenLength in bytes of the data to process. Does not have to be a multiple of the AES block size (16).
encryptTRUE to prepare the context for encryption; FALSE to prepare the context for decryption.
pTweakThe 16 byte tweak.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h

◆ CRYPTO_INTERFACE_DoAESXTSExt()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DoAESXTSExt ( MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx  pCtx,
ubyte *  pData,
sbyte4  dataLen,
sbyte4  encrypt,
ubyte *  pTweak,
void *  pExtCtx 
)

This is effectively a wrapper of CRYPTO_INTERFACE_AESXTSEncryptExt and CRYPTO_INTERFACE_AESXTSDecryptExt.

Parameters
pCtxA previously initialized context.
pDataData to encrypt or decrypt.
dataLenLength in bytes of the data to process. Does not have to be a multiple of the AES block size (16).
encryptTRUE to prepare the context for encryption; FALSE to prepare the context for decryption.
pTweakThe 16 byte tweak.
pExtCtxAn extended context reserved for future use.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h