Cryptographic Interface header file for declaring Blowfish methods.
More...
Go to the source code of this file.
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_CloneBlowfishCtx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, BulkCtx *ppNewCtx) |
| Clones a Blowfish context. More...
|
|
MOC_EXTERN BulkCtx | CRYPTO_INTERFACE_CreateBlowfishCtx (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte *pKeyMaterial, sbyte4 keyLen, sbyte4 encrypt) |
| Creates and initializes a new Blowfish context. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_DeleteBlowfishCtx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx *ppCtx) |
| Deletes a Blowfish context. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_DoBlowfish (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pData, sbyte4 dataLen, sbyte4 encrypt, ubyte *pIv) |
| Performs the Blowfish cipher operation in CBC mode. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_DoBlowfishEx (MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx pCtx, ubyte *pData, sbyte4 dataLen, sbyte4 encrypt, ubyte *pIv) |
| Performs the Blowfish cipher operation in CBC mode. More...
|
|
◆ CRYPTO_INTERFACE_CloneBlowfishCtx()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_CloneBlowfishCtx |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx |
pCtx, |
|
|
BulkCtx * |
ppNewCtx |
|
) |
| |
Be sure to free the new contex with a call to DeleteBlowfishCtx
.
- Parameters
-
pCtx | Source Blowfish context. |
ppNewCtx | Will point to the newly allocated copy of the source context. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h
◆ CRYPTO_INTERFACE_CreateBlowfishCtx()
MOC_EXTERN BulkCtx CRYPTO_INTERFACE_CreateBlowfishCtx |
( |
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_DeleteBlowfishCtx.
- Parameters
-
pKeyMaterial | Key material to use for the cipher operation. |
keyLen | Length in bytes of the key material. |
encrypt | UNUSED. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_DeleteBlowfishCtx()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DeleteBlowfishCtx |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx * |
ppCtx | ) |
|
- Parameters
-
ppCtx | Pointer to the BulkCtx to be deleted. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_DoBlowfish()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DoBlowfish |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx |
pCtx, |
|
|
ubyte * |
pData, |
|
|
sbyte4 |
dataLen, |
|
|
sbyte4 |
encrypt, |
|
|
ubyte * |
pIv |
|
) |
| |
Pass in the initialization vector on the first call, but subsequent calls are not guaranteed to use the pIv field. Use CRYPTO_INTERFACE_DoBlowfishEx instead if you wish to use a modified iv. Note that this operation is in place, so the pData buffer will contain the result.
- Parameters
-
pCtx | A previously initialized context. |
pData | Data to encrypt or decrypt. |
dataLen | Length in bytes of the data to process. This must be a multiple of the block size of 8 bytes. |
encrypt | TRUE to perform encryption; FALSE to perform decryption. |
pIv | The 8 byte initialization vector. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h
◆ CRYPTO_INTERFACE_DoBlowfishEx()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DoBlowfishEx |
( |
MOC_SYM(hwAccelDescr hwAccelCtx) BulkCtx |
pCtx, |
|
|
ubyte * |
pData, |
|
|
sbyte4 |
dataLen, |
|
|
sbyte4 |
encrypt, |
|
|
ubyte * |
pIv |
|
) |
| |
This function can be used to stream data. Pass in the initialization vector and it will be updated in place. Continue to pass in new data and updated initialization vector on each subsequent call. The updated iv will be written to pIv upon method completion. Note that this operation is in place, so the pData buffer will contain the result.
- Parameters
-
pCtx | A previously initialized context. |
pData | Data to encrypt or decrypt. |
dataLen | Length in bytes of the data to process. This must be a multiple of the block size of 8 bytes. |
encrypt | TRUE to perform encryption; FALSE to perform decryption. |
pIv | The 8 byte initialization vector. Upon completion of the method it will be updated to the working IV. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h