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

Cryptographic Interface header file for declaring DSA methods. More...

Go to the source code of this file.

Functions

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_cloneKey (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey **ppNew, const DSAKey *pSrc)
 Clone (copy) a DSA key. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_computeKeyPair (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pFipsRngCtx, DSAKey *p_dsaDescr, vlong **ppVlongQueue)
 Generate DSA key pair (but not their associated parameters). More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_computeSignature2Aux (MOC_DSA(hwAccelDescr hwAccelCtx) RNGFun rngfun, void *pRngArg, DSAKey *pKey, ubyte *pM, ubyte4 mLen, ubyte **ppR, ubyte4 *pRLen, ubyte **ppS, ubyte4 *pSLen, vlong **ppVlongQueue)
 Computes the DSA signature after message truncation. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_computeSignatureAux (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pRngCtx, DSAKey *pKey, ubyte *pM, ubyte4 mLen, intBoolean *pVerify, ubyte **ppR, ubyte4 *pRLen, ubyte **ppS, ubyte4 *pSLen, vlong **ppVlongQueue)
 Computes the DSA signature. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_createKey (DSAKey **pp_dsaDescr)
 Create memory storage for a DSA key. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_equalKey (MOC_DSA(hwAccelDescr hwAccelCtx) const DSAKey *pKey1, const DSAKey *pKey2, byteBoolean *pResult)
 Determine whether two DSA keys are equal. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_extractKeyBlob (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey **pp_RetNewDsaDescr, const ubyte *pKeyBlob, ubyte4 keyBlobLength)
 Get DSA key data structure converted from DSA key blob. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_freeKey (DSAKey **pp_dsaDescr, vlong **ppVlongQueue)
 Free (delete) a DSA key. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_freeKeyTemplate (DSAKey *pKey, MDsaKeyTemplatePtr pTemplate)
 Frees the fields within a key template. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_generateKeyAux (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pFipsRngCtx, DSAKey *p_dsaDescr, ubyte4 keySize, vlong **ppVlongQueue)
 Generate DSA key pair (private and public keys) and associated parameters. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_generateKeyAux2 (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pFipsRngCtx, DSAKey *p_dsaDescr, ubyte4 keySize, ubyte4 qSize, DSAHashType hashType, vlong **ppVlongQueue)
 Generate DSA key pair (private and public keys) and associated parameters with flexibility to set the q size and hash algo. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_generatePQ (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pFipsRngCtx, DSAKey *p_dsaDescr, ubyte4 L, ubyte4 Nin, DSAHashType hashType, ubyte4 *pRetC, ubyte *pRetSeed, vlong **ppVlongQueue)
 Generates the DSA domain parameters p and q. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_generateRandomGAux (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, randomContext *pRandomContext, ubyte **ppH, ubyte4 *pHLen, vlong **ppVlongQueue)
 Randomly computes a generator g of the cyclic group of order q. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_getCipherTextLength (MOC_DSA(hwAccelDescr hwAccelCtx) const DSAKey *pKey, sbyte4 *cipherTextLen)
 Gets the length in bytes of the DSA prime p. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_getKeyParametersAlloc (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, MDsaKeyTemplatePtr pTemplate, ubyte keyType)
 Gets DSA key and domain parameters. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_getSignatureLength (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, ubyte4 *pSigLen)
 Gets the length in bytes of the DSA prime q and therefore the signature components r and s. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_makeKeyBlob (MOC_DSA(hwAccelDescr hwAccelCtx) const DSAKey *p_dsaDescr, ubyte *pKeyBlob, ubyte4 *pRetKeyBlobLength)
 Get DSA key blob converted from DSA key data structure. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_setKeyParametersAux (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, MDsaKeyTemplatePtr pTemplate)
 Sets DSA key and domain parameters. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifyKeyPair (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, intBoolean *pIsValid, vlong **ppVlongQueue)
 Validates a DSA private/public key pair. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifyPrivateKey (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, intBoolean *pIsValid, vlong **ppVlongQueue)
 Validates a DSA private key. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifyPublicKey (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, intBoolean *pIsValid, vlong **ppVlongQueue)
 Validates a DSA public key. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifySignature2Aux (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, ubyte *pM, ubyte4 mLen, ubyte *pR, ubyte4 rLen, ubyte *pS, ubyte4 sLen, intBoolean *pIsGoodSignature, vlong **ppVlongQueue)
 Verifies a DSA signature after message truncation. More...
 
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifySignatureAux (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, ubyte *pM, ubyte4 mLen, ubyte *pR, ubyte4 rLen, ubyte *pS, ubyte4 sLen, intBoolean *pIsGoodSignature, vlong **ppVlongQueue)
 Verifies a DSA signature. More...
 

Detailed Description

Function Documentation

◆ CRYPTO_INTERFACE_DSA_cloneKey()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_cloneKey ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey **  ppNew,
const DSAKey *  pSrc 
)

This function clones (copies) a DSA key. To avoid memory leaks, your application should call CRYPTO_INTERFACE_DSA_freeKey() when it is done using the cloned key.

To use this API one must define + __ENABLE_MOCANA_DSA__

crypto_interface_dsa.h

Parameters
ppNewOn return, double pointer to cloned (copied) DSA key.
pSrcPointer to DSA key to clone (copy).
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_computeKeyPair()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_computeKeyPair ( MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *  pFipsRngCtx,
DSAKey *  p_dsaDescr,
vlong **  ppVlongQueue 
)

This function generates a DSA key pair, but not their associated parameters (which should already be within the DSA key). This method will obtain the key length and q length from the key.

Note
To generate a DSA key pair and their associated parameters, call the DSA_generateKey() function instead of this function.

To use this API one must define + __ENABLE_MOCANA_DSA__

crypto_interface_dsa.h

Parameters
hwAccelCtxIf a hardware acceleration flag is defined, this macro expands to an additional parameter, "hwAccelDescr hwAccelCtx". Otherwise, this macro resolves to nothing.
pFipsRngCtxPointer to RNG context to use for DSA key generation.
p_dsaDescrPointer to DSA key memory, previously allocated by calling DSA_createKey(), and already filled with associated parameters.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_computeSignature2Aux()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_computeSignature2Aux ( MOC_DSA(hwAccelDescr hwAccelCtx) RNGFun  rngfun,
void *  pRngArg,
DSAKey *  pKey,
ubyte *  pM,
ubyte4  mLen,
ubyte **  ppR,
ubyte4 *  pRLen,
ubyte **  ppS,
ubyte4 *  pSLen,
vlong **  ppVlongQueue 
)

Computes the DSA signature after message truncation. This method allocates buffers to hold the signature values R and S. Be sure to free these buffers when done.

Parameters
rngfunUser defined callback method for returning random data.
pRngArgArgument for the rngFun, typically a random context.
pKeyPointer to DSA key memory, previously allocated by DSA_createKey().
pMThe message to be signed.
mLenThe length of the message in bytes.
pVerifyIf non-null the signature will be verified (as a sanity check) In that case contents will be set TRUE if valid and FALSE otherwise.
ppRContents will be set to the buffer holding the R value.
pRLenContents will be set to the length of R in bytes.
ppSContents will be set to the buffer holding the S value.
pSLenContents will be set to the length of S in bytes.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ dsa2.h dsa2.h

◆ CRYPTO_INTERFACE_DSA_computeSignatureAux()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_computeSignatureAux ( MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *  pRngCtx,
DSAKey *  pKey,
ubyte *  pM,
ubyte4  mLen,
intBoolean *  pVerify,
ubyte **  ppR,
ubyte4 *  pRLen,
ubyte **  ppS,
ubyte4 *  pSLen,
vlong **  ppVlongQueue 
)

Computes the DSA signature. This method allocates buffers to hold the signature values R and S. Be sure to free these buffers when done.

Parameters
pRngCtxPointer to RNG context to use for DSA key and parameter generation.
pKeyPointer to DSA key memory, previously allocated by CRYPTO_INTERFACE_DSA_createKey().
pMThe message to be signed.
mLenThe length of the message in bytes.
pVerifyIf non-null the signature will be verified (as a sanity check) In that case contents will be set TRUE if valid and FALSE otherwise.
ppRContents will be set to the buffer holding the R value.
pRLenContents will be set to the length of R in bytes.
ppSContents will be set to the buffer holding the S value.
pSLenContents will be set to the length of S in bytes.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ crypto_interface_dsa.h crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_createKey()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_createKey ( DSAKey **  pp_dsaDescr)

This function creates storage (allocates memory) for a DSA key. After the memory is allocated, applications can use the CRYPTO_INTERFACE_DSA_generateKey() function to generate the DSA key.

Note
This function does not generate an actual DSA key value; to generate the DSA key pair, call the DSA_generateKey() function.

To use this API one must define + __ENABLE_MOCANA_DSA__

crypto_interface_dsa.h

Parameters
pp_dsaDescrOn return, pointer to address of allocated memory (for a DSA key).
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_equalKey()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_equalKey ( MOC_DSA(hwAccelDescr hwAccelCtx) const DSAKey *  pKey1,
const DSAKey *  pKey2,
byteBoolean *  pResult 
)

This function determines whether two DSA keys are equal, and returns the result through the res parameter.

To use this API one must define + __ENABLE_MOCANA_DSA__

crypto_interface_dsa.h

Parameters
pKey1Pointer to first DSA key.
pKey2Pointer to second DSA key.
pResultOn return, pointer to TRUE if the two keys are equal; otherwise pointer to FALSE.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_extractKeyBlob()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_extractKeyBlob ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey **  pp_RetNewDsaDescr,
const ubyte *  pKeyBlob,
ubyte4  keyBlobLength 
)

This function generates a DSA key data structure from information in a DSA key blob, and returns the resultant key data structure through the pp_RetNewDsaDescr parameter.

To use this API one must define + __ENABLE_MOCANA_DSA__

crypto_interface_dsa.h

Parameters
pp_RetNewDsaDescrOn return, pointer to address of resultant DSA key variable.
pKeyBlobPointer to input key blob.
keyBlobLengthNumber of bytes in input key blob (pKeyBlob).
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_freeKey()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_freeKey ( DSAKey **  pp_dsaDescr,
vlong **  ppVlongQueue 
)

This function frees (deletes) a DSA key. To avoid memory leaks, applications should call this function when an allocated DSA key is no longer needed.

To use this API one must define + __ENABLE_MOCANA_DSA__

crypto_interface_dsa.h

Parameters
pp_dsaDescrPointer to address of DSA key to free (delete).
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_freeKeyTemplate()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_freeKeyTemplate ( DSAKey *  pKey,
MDsaKeyTemplatePtr  pTemplate 
)

Frees the fields within a key template.

Parameters
pKeyPointer to the DSA key associated with the template.
pTemplateTemplate whose fields will be freed.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ crypto_interface_dsa.h crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_generateKeyAux()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_generateKeyAux ( MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *  pFipsRngCtx,
DSAKey *  p_dsaDescr,
ubyte4  keySize,
vlong **  ppVlongQueue 
)

Generate DSA key pair (private and public keys) and associated parameters.

Parameters
pFipsRngCtxPointer to RNG context to use for DSA key and parameter generation.
p_dsaDescrPointer to DSA key memory, previously allocated by DSA_createKey().
keySizeBit length of the generated DSA key. (For details, refer to the appropriate FIPS Publication, accessible from the following Web page: http://www.nist.gov/itl/fips.cfm.) Currently supported are lengths of 1024, 2048, and 3072.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ crypto_interface_dsa.h crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_generateKeyAux2()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_generateKeyAux2 ( MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *  pFipsRngCtx,
DSAKey *  p_dsaDescr,
ubyte4  keySize,
ubyte4  qSize,
DSAHashType  hashType,
vlong **  ppVlongQueue 
)

Generate DSA key pair (private and public keys) and associated parameters with flexibility to set the q size and hash algo.

Parameters
pFipsRngCtxPointer to RNG context to use for DSA key and parameter generation.
p_dsaDescrPointer to DSA key memory, previously allocated by CRYPTO_INTERFACE_DSA_createKey().
keySizeBit length of the generated DSA domain parameter p. (For details, refer to the appropriate FIPS Publication, accessible from the following Web page: http://www.nist.gov/itl/fips.cfm.) Currently supported are lengths of 1024, 2048, and 3072.
qSizeBit length of the generated DSA domain parameter q. Currently supported lengths are 160, 224, and 256.
hashTypeThe hash algorithm to use in domain parameter generation. Valid values are... DSA_sha1 DSA_sha224 DSA_sha256 DSA_sha384 DSA_sha512
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ crypto_interface_dsa.h crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_generatePQ()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_generatePQ ( MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *  pFipsRngCtx,
DSAKey *  p_dsaDescr,
ubyte4  L,
ubyte4  Nin,
DSAHashType  hashType,
ubyte4 *  pRetC,
ubyte *  pRetSeed,
vlong **  ppVlongQueue 
)

Generates the DSA prime number p of the appropriate size, such that the associated mutliplicative group contains a cyclic subgroup of a prime order q of the appropriate size. The C value and seed used to generate these parameters are also given as output values.

Parameters
pFipsRngCtxPointer to RNG context to be used during DSA domain parameter generation.
p_dsaDescrPointer to a previously allocated DSA key. The domain parameters p and q will be set within this key.
LThe desired size of p in bits.
NinThe desired cyclic group order q's size in bits.
hashTypeThe hash algorithm you wish to use in domain parameter generation. This should be one of...
  • DSA_sha1
  • DSA_sha224
  • DSA_sha256
  • DSA_sha384
  • DSA_sha512
Parameters
pRetCContents will be set to the number of iterations used to compute the prime p.
pRetSeedBuffer that will be filled with the seed to the prime generation algorithm. The length of this seed in bytes is Nin/8 and this buffer should have enough space.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ crypto_interface_dsa.h crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_generateRandomGAux()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_generateRandomGAux ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *  pKey,
randomContext *  pRandomContext,
ubyte **  ppH,
ubyte4 *  pHLen,
vlong **  ppVlongQueue 
)

Randomly computes a generator g of the cyclic group of order q.

Parameters
pKeyPointer to a previously allocated DSA key that already has the domain parameters p and q set. The new value g will be set within this DSA key too.
pRandomContextPointer to RNG context to be used.
ppHOptional. If provided, pointer to the location that will receive receive a newly allocated buffer with the base h used to compute g, ie g = h^((p-1)/q). h will be in Big Endian.
pHLenRequired if ppH is not NULL. Contents will be set to the length of h in bytes.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ dsa.h dsa.h

◆ CRYPTO_INTERFACE_DSA_getCipherTextLength()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_getCipherTextLength ( MOC_DSA(hwAccelDescr hwAccelCtx) const DSAKey *  pKey,
sbyte4 *  cipherTextLen 
)

Gets the length in bytes of the DSA prime p.

Parameters
pKeyPointer to a DSA key that has its domain parameters set.
cipherTextLenContents will be set to the length in bytes of the DSA prime p.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ crypto_interface_dsa.h crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_getKeyParametersAlloc()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_getKeyParametersAlloc ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *  pKey,
MDsaKeyTemplatePtr  pTemplate,
ubyte  keyType 
)

Gets DSA key and domain parameters. This method will allocated the fields within the passed in template. Be sure to call DSA_freeKeyTemplate to free these fields when done with them.

Parameters
pKeyPointer to the DSA key memory containing key and domain parameters.
pTemplateTarget template that will hold all parameters that were contained in pKey.
keyTypeType of key data to receive, must be one of MOC_GET_PUBLIC_KEY_DATA or MOC_GET_PRIVATE_KEY_DATA.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ crypto_interface_dsa.h crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_getSignatureLength()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_getSignatureLength ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *  pKey,
ubyte4 *  pSigLen 
)

Gets the length in bytes of the DSA prime q and therefore the signature components r and s.

Parameters
pKeyPointer to a DSA key that has its domain parameters set.
pSigLenContents will be set to the length in bytes of the DSA prime q.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ crypto_interface_dsa.h crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_makeKeyBlob()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_makeKeyBlob ( MOC_DSA(hwAccelDescr hwAccelCtx) const DSAKey *  p_dsaDescr,
ubyte *  pKeyBlob,
ubyte4 *  pRetKeyBlobLength 
)

This function generates a DSA key blob from information in a DSA key data structure, and returns the resultant key blob through the pKeyBlob parameter.

To use this API one must define + __ENABLE_MOCANA_DSA__

Warning
Before calling this function, be sure that the buffer pointed to by the pKeyBlob parameter is large enough; otherwise, buffer overflow will occur.

crypto_interface_dsa.h

Parameters
p_dsaDescrPointer to DSA key variable's data structure.
pKeyBlobOn return, pointer to resultant key blob. (The calling function must allocate sufficient memory for the result; otherwise buffer overflow will occur.)
pRetKeyBlobLengthOn return, pointer to number of bytes in resultant key blob buffer (pKeyBlob).
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_setKeyParametersAux()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_setKeyParametersAux ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *  pKey,
MDsaKeyTemplatePtr  pTemplate 
)

Sets DSA key and domain parameters.

Parameters
pKeyPointer to the target DSA key memory, previously allocated by CRYPTO_INTERFACE_DSA_createKey().
pTemplateTemplate holding the paramters to be set.
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__ crypto_interface_dsa.h crypto_interface_dsa.h

◆ CRYPTO_INTERFACE_DSA_verifyKeyPair()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifyKeyPair ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *  pKey,
intBoolean *  pIsValid,
vlong **  ppVlongQueue 
)

Validates a DSA private/public key pair.

Parameters
pKeyA key context containing a private and public key.
pIsValidContents will be set to TRUE if the key is valid and FALSE otherwise.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__

◆ CRYPTO_INTERFACE_DSA_verifyPrivateKey()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifyPrivateKey ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *  pKey,
intBoolean *  pIsValid,
vlong **  ppVlongQueue 
)

Validates a DSA private key.

Parameters
pKeyA key context containing a private key.
pIsValidContents will be set to TRUE if the key is valid and FALSE otherwise.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__

◆ CRYPTO_INTERFACE_DSA_verifyPublicKey()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifyPublicKey ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *  pKey,
intBoolean *  pIsValid,
vlong **  ppVlongQueue 
)

Validates a DSA public key.

Parameters
pKeyA key context containing a public key.
pIsValidContents will be set to TRUE if the key is valid and FALSE otherwise.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.

To use this API one must define + __ENABLE_MOCANA_DSA__

◆ CRYPTO_INTERFACE_DSA_verifySignature2Aux()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifySignature2Aux ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *  pKey,
ubyte *  pM,
ubyte4  mLen,
ubyte *  pR,
ubyte4  rLen,
ubyte *  pS,
ubyte4  sLen,
intBoolean *  pIsGoodSignature,
vlong **  ppVlongQueue 
)

Verifies a DSA signature after message truncation.

Parameters
pKeyPointer to DSA key memory, previously allocated by DSA_createKey().
pMThe message to be verified.
mLenThe length of the message in bytes.
pRBuffer holding the R value.
rLenThe length of R in bytes.
pSBuffer holding the S value.
sLenThe length of S in bytes.
pIsGoodSignatureContents will be set to TRUE if the signature is valid and FALSE otherwise.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.
Warning
Be sure to check BOTH a status of OK and a pIsGoodSignature of TRUE before accepting that a signature is valid.

To use this API one must define + __ENABLE_MOCANA_DSA__ dsa2.h dsa2.h

◆ CRYPTO_INTERFACE_DSA_verifySignatureAux()

MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifySignatureAux ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *  pKey,
ubyte *  pM,
ubyte4  mLen,
ubyte *  pR,
ubyte4  rLen,
ubyte *  pS,
ubyte4  sLen,
intBoolean *  pIsGoodSignature,
vlong **  ppVlongQueue 
)

Verifies a DSA signature.

Parameters
pKeyPointer to DSA key memory, previously allocated by CRYPTO_INTERFACE_DSA_createKey().
pMThe message to be verified.
mLenThe length of the message in bytes.
pRBuffer holding the R value.
rLenThe length of R in bytes.
pSBuffer holding the S value.
sLenThe length of S in bytes.
pIsGoodSignatureContents will be set to TRUE if the signature is valid and FALSE otherwise.
ppVlongQueueOn return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.)
Returns
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.
Warning
Be sure to check BOTH a status of OK and a pIsGoodSignature of TRUE before accepting that a signature is valid.

To use this API one must define + __ENABLE_MOCANA_DSA__ crypto_interface_dsa.h crypto_interface_dsa.h