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

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

Go to the source code of this file.

Functions

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA384_cloneCtx (MOC_HASH(hwAccelDescr hwAccelCtx) SHA384_CTX *pDest, SHA384_CTX *pSrc)
 Makes a clone of a previously allocated SHA384_CTX. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA384_completeDigest (MOC_HASH(hwAccelDescr hwAccelCtx) const ubyte *pData, ubyte4 dataLen, ubyte *pShaOutput)
 Perform a SHA384 digest in one step. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA384_finalDigest (MOC_HASH(hwAccelDescr hwAccelCtx) SHA384_CTX *pContext, ubyte *pOutput)
 Finalize a digest operation and recieve the result. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA384_initDigest (MOC_HASH(hwAccelDescr hwAccelCtx) SHA384_CTX *pContext)
 Initialize a SHA384 context for a new digest operation. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_allocDigest (MOC_HASH(hwAccelDescr hwAccelCtx) BulkCtx *pp_context)
 Allocate a new SHA context. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_cloneCtx (MOC_HASH(hwAccelDescr hwAccelCtx) SHA512_CTX *pDest, SHA512_CTX *pSrc)
 Makes a clone of a previously allocated SHA512_CTX. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_completeDigest (MOC_HASH(hwAccelDescr hwAccelCtx) const ubyte *pData, ubyte4 dataLen, ubyte *pShaOutput)
 Perform a SHA512 digest in one step. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_finalDigest (MOC_HASH(hwAccelDescr hwAccelCtx) SHA512_CTX *pContext, ubyte *pOutput)
 Finalize a digest operation and recieve the result. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_freeDigest (MOC_HASH(hwAccelDescr hwAccelCtx) BulkCtx *pp_context)
 Free a SHA384 or SHA512 context previously allocated with CRYPTO_INTERFACE_SHA1_allocDigest. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_initDigest (MOC_HASH(hwAccelDescr hwAccelCtx) SHA512_CTX *pContext)
 Initialize a SHA512 context for a new digest operation. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_updateDigest (MOC_HASH(hwAccelDescr hwAccelCtx) SHA512_CTX *pContext, const ubyte *pData, ubyte4 dataLen)
 Update a digest operation. More...
 

Detailed Description

Add details here.

crypto_interface_sha512.h

Function Documentation

◆ CRYPTO_INTERFACE_SHA384_cloneCtx()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA384_cloneCtx ( MOC_HASH(hwAccelDescr hwAccelCtx) SHA384_CTX *  pDest,
SHA384_CTX *  pSrc 
)
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_SHA384_completeDigest()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA384_completeDigest ( MOC_HASH(hwAccelDescr hwAccelCtx) const ubyte *  pData,
ubyte4  dataLen,
ubyte *  pShaOutput 
)
Parameters
pDataData to digest.
dataLenLength in bytes of the data to digest.
pShaOutputBuffer of size SHA384_RESULT_SIZE that will recieve the digest.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_SHA384_finalDigest()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA384_finalDigest ( MOC_HASH(hwAccelDescr hwAccelCtx) SHA384_CTX *  pContext,
ubyte *  pOutput 
)
Parameters
pContextThe digest context used to update the data.
pOutputBuffer of size SHA384_RESULT_SIZE that will recieve the digest.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_SHA384_initDigest()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA384_initDigest ( MOC_HASH(hwAccelDescr hwAccelCtx) SHA384_CTX *  pContext)
Parameters
pContextThe SHA384 context to initialize.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_SHA512_allocDigest()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_allocDigest ( MOC_HASH(hwAccelDescr hwAccelCtx) BulkCtx *  pp_context)

Note that SHA384 and SHA512 share this function. It is the callers responsibility to free this object after use by calling CRYPTO_INTERFACE_SHA512_freeDigest.

Parameters
pp_contextOn return, pointer to the address of the allocated context.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_SHA512_cloneCtx()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_cloneCtx ( MOC_HASH(hwAccelDescr hwAccelCtx) SHA512_CTX *  pDest,
SHA512_CTX *  pSrc 
)
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_SHA512_completeDigest()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_completeDigest ( MOC_HASH(hwAccelDescr hwAccelCtx) const ubyte *  pData,
ubyte4  dataLen,
ubyte *  pShaOutput 
)
Parameters
pDataData to digest.
dataLenLength in bytes of the data to digest.
pShaOutputBuffer of size SHA512_RESULT_SIZE that will recieve the digest.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_SHA512_finalDigest()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_finalDigest ( MOC_HASH(hwAccelDescr hwAccelCtx) SHA512_CTX *  pContext,
ubyte *  pOutput 
)
Parameters
pContextThe digest context used to update the data.
pOutputBuffer of size SHA512_RESULT_SIZE that will recieve the digest.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_SHA512_freeDigest()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_freeDigest ( MOC_HASH(hwAccelDescr hwAccelCtx) BulkCtx *  pp_context)
Parameters
pp_contextContext to be freed.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_SHA512_initDigest()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_initDigest ( MOC_HASH(hwAccelDescr hwAccelCtx) SHA512_CTX *  pContext)
Parameters
pContextThe SHA512 context to initialize.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.

◆ CRYPTO_INTERFACE_SHA512_updateDigest()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_SHA512_updateDigest ( MOC_HASH(hwAccelDescr hwAccelCtx) SHA512_CTX *  pContext,
const ubyte *  pData,
ubyte4  dataLen 
)

Note that SHA384 and SHA512 share this function.

Parameters
pContextThe digest context to be updated.
pDataThe data to update the context with.
dataLenLength in bytes of the update data.
Returns
OK (0) if successful, otherwise a negative number error code from merrors.h.