![]() |
TrustCore SDK NanoCrypto API reference
version 7.0
|
Go to the source code of this file.
Functions | |
MOC_EXTERN MSTATUS | AESXTSDecrypt (MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *pCtx, ubyte pTweak[AES_BLOCK_SIZE], ubyte *pCipher, ubyte4 cipherLen) |
Decrypt some data using AES in XTS mode. More... | |
MOC_EXTERN MSTATUS | AESXTSDecryptExt (MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *pCtx, ubyte pTweak[AES_BLOCK_SIZE], ubyte *pCipher, ubyte4 cipherLen, void *pExtCtx) |
MOC_EXTERN MSTATUS | AESXTSEncrypt (MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *pCtx, ubyte pTweak[AES_BLOCK_SIZE], ubyte *pPlain, ubyte4 plainLen) |
Encrypt some data using AES in XTS mode. More... | |
MOC_EXTERN MSTATUS | AESXTSEncryptExt (MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *pCtx, ubyte pTweak[AES_BLOCK_SIZE], ubyte *pPlain, ubyte4 plainLen, void *pExtCtx) |
MOC_EXTERN MSTATUS | AESXTSInit (MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *pCtx, const ubyte *pKey1, const ubyte *pKey2, sbyte4 keyLength, sbyte4 encrypt) |
Initialize a previously allocated AES-XTS context. More... | |
MOC_EXTERN MSTATUS | AESXTSInitExt (MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext *pCtx, const ubyte *pKey1, const ubyte *pKey2, sbyte4 keyLength, sbyte4 encrypt, void *pExtCtx) |
MOC_EXTERN MSTATUS | CloneAESXTSCtx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx) |
Clone an AES-XTS context. More... | |
MOC_EXTERN BulkCtx | CreateAESXTSCtx (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pKeyMaterial, sbyte4 keyLength, sbyte4 encrypt) |
Create a new AES-XTS context. More... | |
MOC_EXTERN BulkCtx | CreateAESXTSCtxExt (MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pKeyMaterial, sbyte4 keyLength, sbyte4 encrypt, void *pExtCtx) |
MOC_EXTERN MSTATUS | DeleteAESXTSCtx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *pCtx) |
Delete an existing AES-XTS context. More... | |
MOC_EXTERN MSTATUS | DeleteAESXTSCtxExt (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *pCtx, void *pExtCtx) |
MOC_EXTERN MSTATUS | DoAESXTS (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pData, sbyte4 dataLen, sbyte4 encrypt, ubyte *pTweak) |
Encrypt or decrypt data using AES in XTS mode. More... | |
MOC_EXTERN MSTATUS | DoAESXTSExt (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pData, sbyte4 dataLen, sbyte4 encrypt, ubyte *pTweak, void *pExtCtx) |
AES developer API header. This header file contains definitions, enumerations, structures, and function declarations used for AES encryption and decryption.
! Flags There are no flag dependencies to enable the functions in this header file.
! External Functions This file contains the following public ($extern$) function declarations:
MOC_EXTERN MSTATUS AESXTSDecrypt | ( | MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext * | pCtx, |
ubyte | pTweak[AES_BLOCK_SIZE], | ||
ubyte * | pCipher, | ||
ubyte4 | cipherLen | ||
) |
Note this operation is in place.
pCtx | The AES-XTS context to use to decrypt the data. |
pTweak | The tweak value for this decryption operation. |
pCipher | The data to be decrypted. |
cipherLen | Size in bytes of the data to be decrypted. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. MOC_EXTERN MSTATUS AESXTSEncrypt | ( | MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext * | pCtx, |
ubyte | pTweak[AES_BLOCK_SIZE], | ||
ubyte * | pPlain, | ||
ubyte4 | plainLen | ||
) |
Note this operation is in place.
pCtx | The AES-XTS context to use to encrypt the data. |
pTweak | The tweak value for this encryption operation. |
pPlain | The plaintext to be encrypted. |
plainLen | Size in bytes of the plaintext data. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. MOC_EXTERN MSTATUS AESXTSInit | ( | MOC_SYM(hwAccelDescr hwAccelCtx) aesXTSCipherContext * | pCtx, |
const ubyte * | pKey1, | ||
const ubyte * | pKey2, | ||
sbyte4 | keyLength, | ||
sbyte4 | encrypt | ||
) |
pCtx | Caller allocated context to be keyed. |
pKey1 | Key 1 to use for this operation. |
pKey2 | Key 2 to use for this operation. |
keyLength | Length of a single key, must be either 128 or 256. |
encrypt | TRUE to encrypt data, FALSE to decrypt data. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. MOC_EXTERN MSTATUS CloneAESXTSCtx | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
BulkCtx * | ppNewCtx | ||
) |
pCtx | Pointer to an instantiated BulkCtx. |
ppNewCtx | Double pointer to the BulkCtx to be created and populated with the data from the source context. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. MOC_EXTERN BulkCtx CreateAESXTSCtx | ( | MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte * | pKeyMaterial, |
sbyte4 | keyLength, | ||
sbyte4 | encrypt | ||
) |
pKeyMaterial | Pointer to the buffer containing the concatenation of key1 and key2. |
keyLength | The total length of the keyMaterial, or the length of both key1 and key2. For AES-128 use 256, for AES-256 use 512, no other values will be accepted. |
encrypt | TRUE to encrypt data, FALSE otherwise. |
NULL
if any error; otherwise pointer to created AES-XTS context. MOC_EXTERN MSTATUS DeleteAESXTSCtx | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx * | pCtx | ) |
pCtx | Pointer to the AES-XTS context to delete. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. MOC_EXTERN MSTATUS DoAESXTS | ( | MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx | pCtx, |
ubyte * | pData, | ||
sbyte4 | dataLen, | ||
sbyte4 | encrypt, | ||
ubyte * | pTweak | ||
) |
Note this function operates on the data in place.
pCtx | AES-XTS to use for this operation. |
pData | Buffer containing the data to encrypt or decrypt. The operation is in place so it will contain the result upon return. |
dataLen | The number of bytes to encrypt or decrypt. |
encrypt | TRUE to encrypt data, FALSE to decrypt data. |
pTweak | Initialization vector, ie tweak valuem, for the operation, must be exactly 16 bytes. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h.