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

Cryptographic Interface header file for declaring RC4 methods. More...

Go to the source code of this file.

Functions

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_CloneRC4Ctx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx)
 Clone RC4 context previously created with CRYPTO_INTERFACE_CreateRC4Ctx. More...
 
MOC_EXTERN BulkCtx CRYPTO_INTERFACE_CreateRC4Ctx (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *pKeyMaterial, sbyte4 keyLen, sbyte4 encrypt)
 Create a new RC4 context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DeleteRC4Ctx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ppCtx)
 Deletes and frees memory allocated within an RC4 context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DoRC4 (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pData, sbyte4 dataLen, sbyte4 encrypt, ubyte *pIv)
 Performs the RC4 cipher operation in-place. More...
 

Detailed Description

Add details here.

crypto_interface_arc4.h

Function Documentation

◆ CRYPTO_INTERFACE_CloneRC4Ctx()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_CloneRC4Ctx ( MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx  pCtx,
BulkCtx *  ppNewCtx 
)
Parameters
pCtxPointer to a BulkCtx returned by CRYPTO_INTERFACE_CreateRC4Ctx.
ppNewCtxDouble pointer to the BulkCtx to be created and populated with the key data from the source key.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_CreateRC4Ctx()

MOC_EXTERN BulkCtx CRYPTO_INTERFACE_CreateRC4Ctx ( MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *  pKeyMaterial,
sbyte4  keyLen,
sbyte4  encrypt 
)

Note it is the callers responsibility to free this object after use by calling CRYPTO_INTERFACE_DeleteRC4Ctx. Once created, you can use this context as input to CRYPTO_INTERFACE_DoRC4 to encrypt, decrypt, or use as a stream cipher.

Parameters
pKeyMaterialKey material to use for the cipher operation.
keyLenLength in bytes of the key material.
encryptUNUSED.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_DeleteRC4Ctx()

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

◆ CRYPTO_INTERFACE_DoRC4()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DoRC4 ( MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx  pCtx,
ubyte *  pData,
sbyte4  dataLen,
sbyte4  encrypt,
ubyte *  pIv 
)
Parameters
pCtxA previously created RC4 context.
pDataThe buffer of data to be transformed in-place.
dataLenLength of the buffer pData in bytes.
encryptUNUSED. The encryption operation is the same as the decryption operation.
pIvUNUSED.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.