Cryptographic Interface header file for declaring Signature based authentication methods.
More...
Go to the source code of this file.
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_SIG_getSignatureLen (QS_CTX *pCtx, ubyte4 *pSigLen) |
| Gets the length or maximum length of a signature associated with a QS context in bytes. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_SIG_signMessage (QS_CTX *pCtx, RNGFun rngFun, void *pRngFunArg, ubyte *pMessage, ubyte4 messageLen, ubyte *pSignature, ubyte4 sigBufferLen, ubyte4 *pActualSigLen) |
| Performs the signature generation algorithm. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_SIG_signMessageAlloc (QS_CTX *pCtx, RNGFun rngFun, void *pRngFunArg, ubyte *pMessage, ubyte4 messageLen, ubyte **ppSignature, ubyte4 *pSignatureLen) |
| Performs the signature generation algorithm. More...
|
|
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_QS_SIG_verifyMessage (QS_CTX *pCtx, ubyte *pMessage, ubyte4 messageLen, ubyte *pSignature, ubyte4 signatureLen, ubyte4 *pVerifyStatus) |
| Performs the signature verification algorithm. More...
|
|
◆ CRYPTO_INTERFACE_QS_SIG_getSignatureLen()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_SIG_getSignatureLen |
( |
QS_CTX * |
pCtx, |
|
|
ubyte4 * |
pSigLen |
|
) |
| |
Gets the length of a signature associated with a QS context in bytes. For the algorithm FALCON this method gets the maximum length that a singature can be.
- Parameters
-
pCtx | Pointer to the QS context. |
pSigLen | Contents will be set to the length of the signature or maximum length in bytes. |
- Warning
- For FALCON remember the contents of pSigLen just represent the maximum length of a signature.
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_QS_SIG_signMessage()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_SIG_signMessage |
( |
QS_CTX * |
pCtx, |
|
|
RNGFun |
rngFun, |
|
|
void * |
pRngFunArg, |
|
|
ubyte * |
pMessage, |
|
|
ubyte4 |
messageLen, |
|
|
ubyte * |
pSignature, |
|
|
ubyte4 |
sigBufferLen, |
|
|
ubyte4 * |
pActualSigLen |
|
) |
| |
Performs the signature generation algorithm.
- Parameters
-
pCtx | Pointer to a previously allocated context. |
rngFun | Function pointer to a random number generation function. |
pRngFunArg | Input data or context into the random number generation function |
pMessage | Buffer holding the input messasge. |
messageLen | The length of the message in bytes. |
pSignature | Buffer that will hold the resulting signature. |
sigBufferLen | The length of the pSignature buffer in bytes. |
pActualSigLen | Contents will be set to the actual length of the signature, ie the number of bytes written to pSignature . |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_QS_SIG_signMessageAlloc()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_SIG_signMessageAlloc |
( |
QS_CTX * |
pCtx, |
|
|
RNGFun |
rngFun, |
|
|
void * |
pRngFunArg, |
|
|
ubyte * |
pMessage, |
|
|
ubyte4 |
messageLen, |
|
|
ubyte ** |
ppSignature, |
|
|
ubyte4 * |
pSignatureLen |
|
) |
| |
Performs the signature generation algorithm. This method allocates a buffer for the signature. Be sure to free this buffer whwn done with it.
- Parameters
-
pCtx | Pointer to a previously allocated context. |
rngFun | Function pointer to a random number generation function. |
pRngFunArg | Input data or context into the random number generation function |
pMessage | Buffer holding the input messasge. |
messageLen | The length of the message in bytes. |
ppSignature | Pointer to the location of the newly allocated buffer that will contain the output signature. |
pSignatureLen | Contents will be set to the length of the signature in bytes. For FALCON This may be fewer bytes than what is allocated for ppSignature . |
- Returns
OK
(0) if successful, otherwise a negative number error code from merrors.h.
◆ CRYPTO_INTERFACE_QS_SIG_verifyMessage()
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_QS_SIG_verifyMessage |
( |
QS_CTX * |
pCtx, |
|
|
ubyte * |
pMessage, |
|
|
ubyte4 |
messageLen, |
|
|
ubyte * |
pSignature, |
|
|
ubyte4 |
signatureLen, |
|
|
ubyte4 * |
pVerifyStatus |
|
) |
| |
Performs the signature verification algorithm.
- Parameters
-
pCtx | Pointer to a previously allocated context. |
pMessage | Buffer holding the input messasge. |
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 non-zero otherwise. |
- Warning
- Be sure to check both a status of
OK
(0) and a verify status of 0 before accepting that a signature is valid.
- Returns
OK
(0) for successful completion of the method regardless of whether the signature is valid for the input message, otherwise a negative number error code from merrors.h.