![]() |
TrustCore SDK Crypto Interface API reference
version 2.0
|
Cryptographic Interface header file for declaring EdDSA functions. More...
Go to the source code of this file.
Functions | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_EdDSA_finalSign (MOC_ECC(hwAccelDescr hwAccelCtx) edDSA_CTX *pEdDSA_ctx, ubyte *pSignature, ubyte4 bufferSize, ubyte4 *pSignatureLen, void *pExtCtx) |
Finalizes an edDSA_CTX and outputs the signature. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_EdDSA_finalVerify (MOC_ECC(hwAccelDescr hwAccelCtx) edDSA_CTX *pEdDSA_ctx, ubyte4 *pVerifyStatus, void *pExtCtx) |
Finalizes an edDSA_CTX context and writes the verify status. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_EdDSA_initSignPreHash (MOC_ECC(hwAccelDescr hwAccelCtx) edDSA_CTX *pEdDSA_ctx, ECCKey *pKey, ubyte *pCtx, ubyte4 ctxLen, void *pExtCtx) |
Initializes an edDSA_CTX for use in the EdDSA sign algorithm. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_EdDSA_initVerify (MOC_ECC(hwAccelDescr hwAccelCtx) edDSA_CTX *pEdDSA_ctx, ECCKey *pKey, ubyte *pSignature, ubyte4 signatureLen, byteBoolean preHash, ubyte *pCtx, ubyte4 ctxLen, void *pExtCtx) |
Initializes an edDSA_CTX for use in the EdDSA verify algorithm. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_EdDSA_Sign (MOC_ECC(hwAccelDescr hwAccelCtx) ECCKey *pKey, ubyte *pMessage, ubyte4 messageLen, ubyte *pSignature, ubyte4 bufferSize, ubyte4 *pSignatureLen, byteBoolean preHash, ubyte *pCtx, ubyte4 ctxLen, void *pExtCtx) |
Signs a message via the EdDSA algorithm. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_EdDSA_update (MOC_ECC(hwAccelDescr hwAccelCtx) edDSA_CTX *pEdDSA_ctx, ubyte *pMessage, ubyte4 messageLen, void *pExtCtx) |
Updates an edDSA_CTX with data. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_EdDSA_VerifySignature (MOC_ECC(hwAccelDescr hwAccelCtx) ECCKey *pKey, ubyte *pMessage, ubyte4 messageLen, ubyte *pSignature, ubyte4 signatureLen, ubyte4 *pVerifyStatus, byteBoolean preHash, ubyte *pCtx, ubyte4 ctxLen, void *pExtCtx) |
A one shot verify of a message via the EdDSA algorithm. More... | |
Cryptographic Interface header file for declaring EdDSA functions.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_EdDSA_finalSign | ( | MOC_ECC(hwAccelDescr hwAccelCtx) edDSA_CTX * | pEdDSA_ctx, |
ubyte * | pSignature, | ||
ubyte4 | bufferSize, | ||
ubyte4 * | pSignatureLen, | ||
void * | pExtCtx | ||
) |
Finalizes an edDSA_CTX
and outputs the signature.
pEdDSA_ctx | Pointer to a previous initialized context. |
pSignature | Buffer that will hold the resulting signature. |
bufferSize | The length of the buffer pSignature in bytes. |
pSignatureLen | Contents will be set to the number of bytes actually written to the pSignature buffer. |
pExtCtx | An extended context reserved for future use. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_EdDSA_finalVerify | ( | MOC_ECC(hwAccelDescr hwAccelCtx) edDSA_CTX * | pEdDSA_ctx, |
ubyte4 * | pVerifyStatus, | ||
void * | pExtCtx | ||
) |
Finalizes an edDSA_CTX
context and writes the verify status.
pEdDSA_ctx | Pointer to a previous initialized and updated context. |
pVerifyStatus | Contents will be set to 0 for a valid signature and a nonzero value for an invalid signature. |
pExtCtx | An extended context reserved for future use. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_EdDSA_initSignPreHash | ( | MOC_ECC(hwAccelDescr hwAccelCtx) edDSA_CTX * | pEdDSA_ctx, |
ECCKey * | pKey, | ||
ubyte * | pCtx, | ||
ubyte4 | ctxLen, | ||
void * | pExtCtx | ||
) |
Initializes an edDSA_CTX
for use in the EdDSA sign algorithm.
pEdDSA_ctx | Pointer to the context to be initialized. |
pKey | Pointer to the public key. |
pSignature | Buffer holding the signature to be verified. |
signatureLen | The length of the signature in bytes. |
pCtx | Optional. For curve25519 set to non-null for Ed25519ctx mode. For curve448 the context is optional for pre-hash mode. |
ctxLen | The length of the context in bytes. This cannot be more than 255. |
pExtCtx | An extended context reserved for future use. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_EdDSA_initVerify | ( | MOC_ECC(hwAccelDescr hwAccelCtx) edDSA_CTX * | pEdDSA_ctx, |
ECCKey * | pKey, | ||
ubyte * | pSignature, | ||
ubyte4 | signatureLen, | ||
byteBoolean | preHash, | ||
ubyte * | pCtx, | ||
ubyte4 | ctxLen, | ||
void * | pExtCtx | ||
) |
Initializes an edDSA_CTX
for use in the EdDSA verify algorithm.
pEdDSA_ctx | Pointer to the context to be initialized. |
pKey | Pointer to the public key. |
pSignature | Buffer holding the signature to be verified. |
signatureLen | The length of the signature in bytes. |
preHash | Set to TRUE (1) for EdDSAph "pre-hash" mode. |
pCtx | Optional. For curve25519 set to non-null for Ed25519ctx mode. For curve448 the context is optional for pure Ed448 or pre-hash mode. |
ctxLen | The length of the context in bytes. This cannot be more than 255. |
pExtCtx | An extended context reserved for future use. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_EdDSA_Sign | ( | MOC_ECC(hwAccelDescr hwAccelCtx) ECCKey * | pKey, |
ubyte * | pMessage, | ||
ubyte4 | messageLen, | ||
ubyte * | pSignature, | ||
ubyte4 | bufferSize, | ||
ubyte4 * | pSignatureLen, | ||
byteBoolean | preHash, | ||
ubyte * | pCtx, | ||
ubyte4 | ctxLen, | ||
void * | pExtCtx | ||
) |
Signs a message via the EdDSA algorithm.
pKey | Pointer to the private signing key. |
pMessage | Buffer holding the message to be signed. |
messageLen | The length of the message in bytes. |
pSignature | Buffer that will hold the resulting signature. |
bufferSize | The length of the buffer pSignature in bytes. |
pSignatureLen | Contents will be set to the number of bytes actually written to the pSignature buffer. |
preHash | Set to TRUE (1) for EdDSAph "pre-hash" mode. |
pCtx | Optional. For curve25519 set to non-null for Ed25519ctx mode. For curve448 the context is optional for pure Ed448 or pre-hash mode. |
ctxLen | The length of the context in bytes. This cannot be more than 255. |
pExtCtx | An extended context reserved for future use. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_EdDSA_update | ( | MOC_ECC(hwAccelDescr hwAccelCtx) edDSA_CTX * | pEdDSA_ctx, |
ubyte * | pMessage, | ||
ubyte4 | messageLen, | ||
void * | pExtCtx | ||
) |
Updates an edDSA_CTX
with some portion of the data to be signed or verified. You may call this API as many times as is appropriate.
pEdDSA_ctx | Pointer to a previous initialized context. |
pMessage | Buffer holding the message or portion of the message to be signed or verified. |
messageLen | The length of the message or portion of the message in bytes. |
pExtCtx | An extended context reserved for future use. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_EdDSA_VerifySignature | ( | MOC_ECC(hwAccelDescr hwAccelCtx) ECCKey * | pKey, |
ubyte * | pMessage, | ||
ubyte4 | messageLen, | ||
ubyte * | pSignature, | ||
ubyte4 | signatureLen, | ||
ubyte4 * | pVerifyStatus, | ||
byteBoolean | preHash, | ||
ubyte * | pCtx, | ||
ubyte4 | ctxLen, | ||
void * | pExtCtx | ||
) |
A one shot verify of a message via the EdDSA algorithm.
pKey | Pointer to the public key. |
pMessage | Buffer holding the message to be verified. |
messageLen | The length of the message in bytes. |
pSignature | Buffer holding the signature to be verified. |
signatureLen | The length of the signature in bytes. |
pVerifyStatus | Contents will be set to 0 for a valid signature and a nonzero value for an invalid signature. |
preHash | Set to TRUE (1) for EdDSAph "pre-hash" mode. |
pCtx | Optional. For curve25519 set to non-null for Ed25519ctx mode. For curve448 the context is optional for pure Ed448 or pre-hash mode. |
ctxLen | The length of the context in bytes. This cannot be more than 255. |
pExtCtx | An extended context reserved for future use. |
OK
(0) if successful execution of the method, otherwise a negative number error code from merrors.h