![]() |
TrustCore SDK Crypto Interface API reference
version 2.0
|
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... | |
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__
ppNew | On return, double pointer to cloned (copied) DSA key. |
pSrc | Pointer to DSA key to clone (copy). |
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.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.
To use this API one must define + __ENABLE_MOCANA_DSA__
hwAccelCtx | If a hardware acceleration flag is defined, this macro expands to an additional parameter, "hwAccelDescr hwAccelCtx". Otherwise, this macro resolves to nothing. |
pFipsRngCtx | Pointer to RNG context to use for DSA key generation. |
p_dsaDescr | Pointer to DSA key memory, previously allocated by calling DSA_createKey(), and already filled with associated parameters. |
ppVlongQueue | On 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.) |
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.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.
rngfun | User defined callback method for returning random data. |
pRngArg | Argument for the rngFun, typically a random context. |
pKey | Pointer to DSA key memory, previously allocated by DSA_createKey() . |
pM | The message to be signed. |
mLen | The length of the message in bytes. |
pVerify | If non-null the signature will be verified (as a sanity check) In that case contents will be set TRUE if valid and FALSE otherwise. |
ppR | Contents will be set to the buffer holding the R value. |
pRLen | Contents will be set to the length of R in bytes. |
ppS | Contents will be set to the buffer holding the S value. |
pSLen | Contents will be set to the length of S in bytes. |
ppVlongQueue | On 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.) |
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
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.
pRngCtx | Pointer to RNG context to use for DSA key and parameter generation. |
pKey | Pointer to DSA key memory, previously allocated by CRYPTO_INTERFACE_DSA_createKey() . |
pM | The message to be signed. |
mLen | The length of the message in bytes. |
pVerify | If non-null the signature will be verified (as a sanity check) In that case contents will be set TRUE if valid and FALSE otherwise. |
ppR | Contents will be set to the buffer holding the R value. |
pRLen | Contents will be set to the length of R in bytes. |
ppS | Contents will be set to the buffer holding the S value. |
pSLen | Contents will be set to the length of S in bytes. |
ppVlongQueue | On 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.) |
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
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.
To use this API one must define + __ENABLE_MOCANA_DSA__
pp_dsaDescr | On return, pointer to address of allocated memory (for a DSA key). |
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.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__
pKey1 | Pointer to first DSA key. |
pKey2 | Pointer to second DSA key. |
pResult | On return, pointer to TRUE if the two keys are equal; otherwise pointer to FALSE . |
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.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__
pp_RetNewDsaDescr | On return, pointer to address of resultant DSA key variable. |
pKeyBlob | Pointer to input key blob. |
keyBlobLength | Number of bytes in input key blob (pKeyBlob ). |
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.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__
pp_dsaDescr | Pointer to address of DSA key to free (delete). |
ppVlongQueue | On 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.) |
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.MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_freeKeyTemplate | ( | DSAKey * | pKey, |
MDsaKeyTemplatePtr | pTemplate | ||
) |
Frees the fields within a key template.
pKey | Pointer to the DSA key associated with the template. |
pTemplate | Template whose fields will be freed. |
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
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.
pFipsRngCtx | Pointer to RNG context to use for DSA key and parameter generation. |
p_dsaDescr | Pointer to DSA key memory, previously allocated by DSA_createKey() . |
keySize | Bit 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. |
ppVlongQueue | On 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.) |
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
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.
pFipsRngCtx | Pointer to RNG context to use for DSA key and parameter generation. |
p_dsaDescr | Pointer to DSA key memory, previously allocated by CRYPTO_INTERFACE_DSA_createKey() . |
keySize | Bit 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. |
qSize | Bit length of the generated DSA domain parameter q. Currently supported lengths are 160, 224, and 256. |
hashType | The hash algorithm to use in domain parameter generation. Valid values are... DSA_sha1 DSA_sha224 DSA_sha256 DSA_sha384 DSA_sha512 |
ppVlongQueue | On 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.) |
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
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.
pFipsRngCtx | Pointer to RNG context to be used during DSA domain parameter generation. |
p_dsaDescr | Pointer to a previously allocated DSA key. The domain parameters p and q will be set within this key. |
L | The desired size of p in bits. |
Nin | The desired cyclic group order q's size in bits. |
hashType | The hash algorithm you wish to use in domain parameter generation. This should be one of... |
pRetC | Contents will be set to the number of iterations used to compute the prime p. |
pRetSeed | Buffer 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. |
ppVlongQueue | On 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.) |
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
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.
pKey | Pointer 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. |
pRandomContext | Pointer to RNG context to be used. |
ppH | Optional. 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. |
pHLen | Required if ppH is not NULL. Contents will be set to the length of h in bytes. |
ppVlongQueue | On 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.) |
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
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.
pKey | Pointer to a DSA key that has its domain parameters set. |
cipherTextLen | Contents will be set to the length in bytes of the DSA prime p. |
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
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.
pKey | Pointer to the DSA key memory containing key and domain parameters. |
pTemplate | Target template that will hold all parameters that were contained in pKey . |
keyType | Type of key data to receive, must be one of MOC_GET_PUBLIC_KEY_DATA or MOC_GET_PRIVATE_KEY_DATA . |
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
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.
pKey | Pointer to a DSA key that has its domain parameters set. |
pSigLen | Contents will be set to the length in bytes of the DSA prime q. |
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
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__
pKeyBlob
parameter is large enough; otherwise, buffer overflow will occur.p_dsaDescr | Pointer to DSA key variable's data structure. |
pKeyBlob | On return, pointer to resultant key blob. (The calling function must allocate sufficient memory for the result; otherwise buffer overflow will occur.) |
pRetKeyBlobLength | On return, pointer to number of bytes in resultant key blob buffer (pKeyBlob ). |
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.MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_setKeyParametersAux | ( | MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey * | pKey, |
MDsaKeyTemplatePtr | pTemplate | ||
) |
Sets DSA key and domain parameters.
pKey | Pointer to the target DSA key memory, previously allocated by CRYPTO_INTERFACE_DSA_createKey() . |
pTemplate | Template holding the paramters to be set. |
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
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifyKeyPair | ( | MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey * | pKey, |
intBoolean * | pIsValid, | ||
vlong ** | ppVlongQueue | ||
) |
Validates a DSA private/public key pair.
pKey | A key context containing a private and public key. |
pIsValid | Contents will be set to TRUE if the key is valid and FALSE otherwise. |
ppVlongQueue | On 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.) |
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__
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifyPrivateKey | ( | MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey * | pKey, |
intBoolean * | pIsValid, | ||
vlong ** | ppVlongQueue | ||
) |
Validates a DSA private key.
pKey | A key context containing a private key. |
pIsValid | Contents will be set to TRUE if the key is valid and FALSE otherwise. |
ppVlongQueue | On 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.) |
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__
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_DSA_verifyPublicKey | ( | MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey * | pKey, |
intBoolean * | pIsValid, | ||
vlong ** | ppVlongQueue | ||
) |
Validates a DSA public key.
pKey | A key context containing a public key. |
pIsValid | Contents will be set to TRUE if the key is valid and FALSE otherwise. |
ppVlongQueue | On 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.) |
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__
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.
pKey | Pointer to DSA key memory, previously allocated by DSA_createKey() . |
pM | The message to be verified. |
mLen | The length of the message in bytes. |
pR | Buffer holding the R value. |
rLen | The length of R in bytes. |
pS | Buffer holding the S value. |
sLen | The length of S in bytes. |
pIsGoodSignature | Contents will be set to TRUE if the signature is valid and FALSE otherwise. |
ppVlongQueue | On 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.) |
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.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
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.
pKey | Pointer to DSA key memory, previously allocated by CRYPTO_INTERFACE_DSA_createKey() . |
pM | The message to be verified. |
mLen | The length of the message in bytes. |
pR | Buffer holding the R value. |
rLen | The length of R in bytes. |
pS | Buffer holding the S value. |
sLen | The length of S in bytes. |
pIsGoodSignature | Contents will be set to TRUE if the signature is valid and FALSE otherwise. |
ppVlongQueue | On 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.) |
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.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