![]() |
TrustCore SDK NanoCrypto API reference
version 7.0
|
Header file for the NanoCrypto Poly1305 APIs. More...
Go to the source code of this file.
Functions | |
MOC_EXTERN MSTATUS | Poly1305_completeDigest (MOC_HASH(hwAccelDescr hwAccelCtx) ubyte mac[16], const ubyte *m, ubyte4 bytes, const ubyte key[32]) |
One shot API that will compute a poly1305 mac context free. More... | |
MOC_EXTERN MSTATUS | Poly1305Final (MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx *ctx, ubyte mac[16]) |
Finalizes a Poly1305Ctx and computes the resulting mac. More... | |
MOC_EXTERN MSTATUS | Poly1305Init (MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx *ctx, const ubyte key[32]) |
Initializes a Poly1305Ctx with a 32 byte (256 bit) key. More... | |
MOC_EXTERN MSTATUS | Poly1305Update (MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx *ctx, const ubyte *m, ubyte4 bytes) |
Updates a Poly1305Ctx with message data. More... | |
This file contains the NanoCrypto Poly1305 API methods.
To enable this file's methods define the following flag:
__ENABLE_MOCANA_POLY1305__
MOC_EXTERN MSTATUS Poly1305_completeDigest | ( | MOC_HASH(hwAccelDescr hwAccelCtx) ubyte | mac[16], |
const ubyte * | m, | ||
ubyte4 | bytes, | ||
const ubyte | key[32] | ||
) |
One shot API that will compute a poly1305 mac context free.
To enable this file's methods define the following flag:
__ENABLE_MOCANA_POLY1305__
mac | A 16 element byte array that will hold the resulting mac. |
m | A pointer to the entire input message. |
bytes | The number of bytes in the input message. |
key | The 32 byte key consisting of the 16 byte r followed by the 16 byte s. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h.MOC_EXTERN MSTATUS Poly1305Final | ( | MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx * | ctx, |
ubyte | mac[16] | ||
) |
Finalizes a Poly1305Ctx and writes the resulting 16 byte message authentication code (mac) to a buffer.
To enable this file's methods define the following flag:
__ENABLE_MOCANA_POLY1305__
ctx | Pointer to a Poly1305Ctx context previously initialized and updated. |
mac | A 16 element byte array that will hold the resulting mac. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h.MOC_EXTERN MSTATUS Poly1305Init | ( | MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx * | ctx, |
const ubyte | key[32] | ||
) |
Initializes a Poly1305Ctx with a 32 byte (256 bit) key consisting of a 16 byte r followed by a 16 byte s.
To enable this file's methods define the following flag:
__ENABLE_MOCANA_POLY1305__
ctx | A pointer to the context to be initialized. |
key | The 32 byte key consisting of the 16 byte r followed by the 16 byte s. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h.MOC_EXTERN MSTATUS Poly1305Update | ( | MOC_HASH(hwAccelDescr hwAccelCtx) Poly1305Ctx * | ctx, |
const ubyte * | m, | ||
ubyte4 | bytes | ||
) |
Updates a Poly1305Ctx with message data. This may be the entire message, or Poly1305Update may be called multiple times each with a portion of the message.
To enable this file's methods define the following flag:
__ENABLE_MOCANA_POLY1305__
ctx | Pointer to a Poly1305Ctx context previously initialized. |
m | A pointer to the message or portion of the message to be input. |
bytes | The number of bytes in the message or portion of the message input. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h.