Header file for the NanoCrypto RC4 APIs.
More...
Go to the source code of this file.
|
| MOC_EXTERN MSTATUS | CloneRC4Ctx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx) |
| | Clone RC4 context previously created with CreateRC4Ctx. More...
|
| |
| MOC_EXTERN BulkCtx | CreateRC4Ctx (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *keyMaterial, sbyte4 keyLength, sbyte4 encrypt) |
| | Creates and initializes a new RC4 context. More...
|
| |
| MOC_EXTERN MSTATUS | DeleteRC4Ctx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ctx) |
| | Deletes an RC4 context. More...
|
| |
| MOC_EXTERN MSTATUS | DoRC4 (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx ctx, ubyte *data, sbyte4 dataLength, sbyte4 encrypt, ubyte *iv) |
| | Performs the RC4 stream cipher operation to encrypt or decrypt a buffer of data. More...
|
| |
This file contains the NanoCrypto RC4 API methods.
rc4algo.h
◆ CloneRC4Ctx()
| MOC_EXTERN MSTATUS CloneRC4Ctx |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx |
pCtx, |
|
|
BulkCtx * |
ppNewCtx |
|
) |
| |
- Parameters
-
| pCtx | Pointer to a BulkCtx returned by CreateRC4Ctx. |
| ppNewCtx | Double 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.
◆ CreateRC4Ctx()
| MOC_EXTERN BulkCtx CreateRC4Ctx |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) ubyte * |
keyMaterial, |
|
|
sbyte4 |
keyLength, |
|
|
sbyte4 |
encrypt |
|
) |
| |
Creates and initializes a new RC4 context.
- Parameters
-
| keyMaterial | Buffer of the input key material. |
| keyLength | The length of the input key material. |
| encrypt | Unused. RC4 is a stream cipher. |
- Returns
- If successful, pointer to a new RC4 context cast as a
BulkCtx. Otherwise NULL is returned.
rc4algo.h
◆ DeleteRC4Ctx()
| MOC_EXTERN MSTATUS DeleteRC4Ctx |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx * |
ctx | ) |
|
Deletes and frees memory allocated for an RC4 context.
- Parameters
-
| ctx | Pointer to the location of the context to be deleted. |
- Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h.
rc4algo.h
◆ DoRC4()
| MOC_EXTERN MSTATUS DoRC4 |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx |
ctx, |
|
|
ubyte * |
data, |
|
|
sbyte4 |
dataLength, |
|
|
sbyte4 |
encrypt, |
|
|
ubyte * |
iv |
|
) |
| |
Performs the RC4 stream cipher operation to encrypt or decrypt a buffer of data.
- Parameters
-
| ctx | Pointer to a previously created RC4 context. |
| data | The buffer of data to be encrypted or decrypted in-place. |
| dataLength | The length of data in bytes. |
| encrypt | Unused. RC4 is a stream cipher. |
| iv | Unused. No initialization vector is needed. |
- Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h.
rc4algo.h