Cryptographic Interface header file for declaring Poly1305 functions.
More...
Go to the source code of this file.
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_Poly1305_cloneCtx (MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx *pDest, Poly1305Ctx *pSrc) |
| Makes a clone of a previously allocated Poly1305Ctx . More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_Poly1305_completeDigest (MOC_HASH(hwAccelDescr hwAccelCtx) ubyte pMac[16], const ubyte *pM, ubyte4 bytes, const ubyte pKey[32]) |
| Calculate the MAC value in one function call. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_Poly1305Final (MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx *pCtx, ubyte pMac[16]) |
| Calculate the final MAC value, and return it through the pMac parameter. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_Poly1305Init (MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx *pCtx, const ubyte pKey[32]) |
| Initialize a Poly1305 context, and load in the provided key. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_Poly1305Update (MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx *pCtx, const ubyte *pM, ubyte4 bytes) |
| Update the intermediate MAC value in a Poly1305 context. More...
|
|
crypto_interface_poly1305.h
Copyright 2019-2024 DigiCert, Inc. All Rights Reserved. Proprietary and Confidential Material.
◆ CRYPTO_INTERFACE_Poly1305_cloneCtx()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_Poly1305_cloneCtx |
( |
MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx * |
pDest, |
|
|
Poly1305Ctx * |
pSrc |
|
) |
| |
Makes a clone of a previously allocated Poly1305Ctx
.
- Parameters
-
pDest | Pointer to an already allocated destination context. |
pSrc | Pointer to the context to be copied. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_Poly1305_completeDigest()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_Poly1305_completeDigest |
( |
MOC_HASH(hwAccelDescr hwAccelCtx) ubyte |
pMac[16], |
|
|
const ubyte * |
pM, |
|
|
ubyte4 |
bytes, |
|
|
const ubyte |
pKey[32] |
|
) |
| |
This function simply contains the calls to Init, Update & Final. The MAC value is returned through the pMac
parameter.
- Parameters
-
pMac | On return, pointer to resultant MAC value. |
pM | Pointer to input data. |
bytes | Length of the input data buffer. |
pKey | Key material used for the MAC operation. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h
◆ CRYPTO_INTERFACE_Poly1305Final()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_Poly1305Final |
( |
MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx * |
pCtx, |
|
|
ubyte |
pMac[16] |
|
) |
| |
- Parameters
-
pCtx | Pointer to the Poly1305 context. |
pMac | On return, pointer to resultant MAC value. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h
◆ CRYPTO_INTERFACE_Poly1305Init()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_Poly1305Init |
( |
MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx * |
pCtx, |
|
|
const ubyte |
pKey[32] |
|
) |
| |
Once initialized, you can use this context as input to CRYPTO_INTERFACE_Poly1305Update & CRYPTO_INTERFACE_Poly1305Final to create a MAC.
- Parameters
-
pCtx | Pointer to the Poly1305 context to be initialized. |
pKey | Key material used for the MAC operation. |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h
◆ CRYPTO_INTERFACE_Poly1305Update()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_Poly1305Update |
( |
MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx * |
pCtx, |
|
|
const ubyte * |
pM, |
|
|
ubyte4 |
bytes |
|
) |
| |
Applications can repeatedly call this function to calculate a MAC for different data items.
- Parameters
-
pCtx | Pointer to the Poly1305 context. |
pM | Pointer to input data. |
bytes | Number of bytes of input data to read (text ). |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h