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

Cryptographic Interface header file for declaring Poly1305 functions. More...

Go to the source code of this file.

Functions

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...
 

Detailed Description

crypto_interface_poly1305.h

Copyright 2019-2024 DigiCert, Inc. All Rights Reserved. Proprietary and Confidential Material.

Function Documentation

◆ 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
pDestPointer to an already allocated destination context.
pSrcPointer 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
pMacOn return, pointer to resultant MAC value.
pMPointer to input data.
bytesLength of the input data buffer.
pKeyKey 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
pCtxPointer to the Poly1305 context.
pMacOn 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
pCtxPointer to the Poly1305 context to be initialized.
pKeyKey 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
pCtxPointer to the Poly1305 context.
pMPointer to input data.
bytesNumber of bytes of input data to read (text).
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h