![]() |
TrustCore SDK NanoCrypto API reference
version 7.0
|
Header file for the Nanocrypto DSA API. More...
Go to the source code of this file.
Typedefs | |
typedef struct MDsaKeyTemplate * | MDsaKeyTemplatePtr |
Enumerations | |
enum | DSAHashType { DSA_sha1 = FFC_sha1, DSA_sha224 = FFC_sha224, DSA_sha256 = FFC_sha256, DSA_sha384 = FFC_sha384, DSA_sha512 = FFC_sha512 } |
enum | DSAKeyType { DSA_186_2, DSA_186_4 } |
Functions | |
MOC_EXTERN MSTATUS | DSA_cloneKey (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey **ppNew, const DSAKey *pSrc) |
Clone (copy) a DSA key. More... | |
MOC_EXTERN MSTATUS | 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 | DSA_computeKeyPairEx (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pFipsRngCtx, DSAKey *p_dsaDescr, ubyte4 Lin, ubyte4 Nin, vlong **ppVlongQueue) |
Generate DSA key pair (but not their associated parameters). More... | |
MOC_EXTERN MSTATUS | DSA_computeSignature (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pRandomContext, const DSAKey *p_dsaDescr, vlong *m, intBoolean *pVerifySignature, vlong **ppR, vlong **ppS, vlong **ppVlongQueue) |
Generate DSA signature. More... | |
MOC_EXTERN MSTATUS | 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 | DSA_computeSignatureEx (MOC_DSA(hwAccelDescr hwAccelCtx) RNGFun rngfun, void *rngArg, const DSAKey *p_dsaDescr, vlong *m, intBoolean *pVerifySignature, vlong **ppR, vlong **ppS, vlong **ppVlongQueue) |
This is the same as DSAComputeSignature , except that it uses an RNGFun and rngArg to generate the random values, rather than a randomContext. More... | |
MOC_EXTERN MSTATUS | DSA_createKey (DSAKey **pp_dsaDescr) |
Create memory storage for a DSA key. More... | |
MOC_EXTERN MSTATUS | 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 | 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 | DSA_freeKey (DSAKey **pp_dsaDescr, vlong **ppVlongQueue) |
Free (delete) a DSA key. More... | |
MOC_EXTERN MSTATUS | DSA_freeKeyTemplate (DSAKey *pKey, MDsaKeyTemplatePtr pTemplate) |
Frees the fields within a key template. More... | |
MOC_EXTERN MSTATUS | DSA_generateKey (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pFipsRngCtx, DSAKey *p_dsaDescr, ubyte4 keySize, ubyte4 *pRetC, ubyte *pRetSeed, vlong **ppRetH, vlong **ppVlongQueue) |
Generate DSA key pair (private and public keys) and associated parameters. More... | |
MOC_EXTERN MSTATUS | 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 | 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 | DSA_generateKeyEx (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pFipsRngCtx, DSAKey *p_dsaDescr, ubyte4 keySize, ubyte4 qSize, DSAHashType hashType, ubyte4 *pRetC, ubyte *pRetSeed, vlong **ppRetH, vlong **ppVlongQueue) |
Generate DSA key pair (private and public keys). More... | |
MOC_EXTERN MSTATUS | DSA_generateRandomG (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *p_dsaDescr, randomContext *pRandomContext, vlong **ppRetH, vlong **ppVlongQueue) |
Randomly computes a generator g of the cyclic group of order q. More... | |
MOC_EXTERN MSTATUS | DSA_generateRandomGAux (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *p_dsaDescr, randomContext *pRandomContext, ubyte **ppH, ubyte4 *pHLen, vlong **ppVlongQueue) |
Randomly computes a generator g of the cyclic group of order q. More... | |
MOC_EXTERN MSTATUS | 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 | DSA_getKeyParametersAlloc (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, MDsaKeyTemplatePtr pTemplate, ubyte keyType) |
Gets DSA key and domain parameters. More... | |
MOC_EXTERN MSTATUS | 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 | 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 | DSA_setAllKeyParameters (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, const ubyte *p, ubyte4 pLen, const ubyte *q, ubyte4 qLen, const ubyte *g, ubyte4 gLen, const ubyte *x, ubyte4 xLen, vlong **ppVlongQueue) |
Sets all the DSA domain and key parameters in a DSA key. More... | |
MOC_EXTERN MSTATUS | DSA_setKeyParameters (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, const ubyte *p, ubyte4 pLen, const ubyte *q, ubyte4 qLen, const ubyte *g, ubyte4 gLen, vlong **ppVlongQueue) |
Sets the DSA domain parameters in a DSA key. More... | |
MOC_EXTERN MSTATUS | DSA_setKeyParametersAux (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, MDsaKeyTemplatePtr pTemplate) |
Sets DSA key and domain parameters. More... | |
MOC_EXTERN MSTATUS | DSA_setPublicKeyParameters (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pKey, const ubyte *p, ubyte4 pLen, const ubyte *q, ubyte4 qLen, const ubyte *g, ubyte4 gLen, const ubyte *y, ubyte4 yLen, vlong **ppVlongQueue) |
Sets all the DSA domain and public key parameters in a DSA key. More... | |
MOC_EXTERN MSTATUS | DSA_verifyG (MOC_DSA(hwAccelDescr hwAccelCtx) vlong *pP, vlong *pQ, vlong *pG, intBoolean *isValid, vlong **ppVlongQueue) |
Verifies that g generates a cyclic group of prime order q. More... | |
MOC_EXTERN MSTATUS | DSA_verifyKeys (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pFipsRngCtx, ubyte *pSeed, const DSAKey *p_dsaDescr, ubyte4 C, vlong *pH, intBoolean *isGoodKeys, vlong **ppVlongQueue) |
Verify DSA key. More... | |
MOC_EXTERN MSTATUS | DSA_verifyKeysEx (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pFipsRngCtx, ubyte *pSeed, ubyte4 seedSize, const DSAKey *p_dsaDescr, DSAHashType hashType, DSAKeyType keyType, ubyte4 C, vlong *pH, intBoolean *isGoodKeys, vlong **ppVlongQueue) |
Verify DSA key. More... | |
MOC_EXTERN MSTATUS | DSA_verifyPQ (MOC_DSA(hwAccelDescr hwAccelCtx) randomContext *pFipsRngCtx, DSAKey *p_dsaDescr, ubyte4 L, ubyte4 Nin, DSAHashType hashType, DSAKeyType keyType, ubyte4 C, ubyte *pSeed, ubyte4 seedSize, intBoolean *pIsPrimePQ, vlong **ppVlongQueue) |
Verifies that the parameters p and q come from seed and initial domain parameters passed in. More... | |
MOC_EXTERN MSTATUS | DSA_verifySignature (MOC_DSA(hwAccelDescr hwAccelCtx) const DSAKey *p_dsaDescr, vlong *m, vlong *pR, vlong *pS, intBoolean *isGoodSignature, vlong **ppVlongQueue) |
Verify message's DSA signature. More... | |
MOC_EXTERN MSTATUS | 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 | generateG (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *p_dsaDescr, vlong **ppRetH, vlong **ppVlongQueue) |
Deterministically computes a generator g of the cyclic group of order q. More... | |
MOC_EXTERN MSTATUS | 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... | |
This file documents the APIs of NanoCrypto DSA.
To use these APIs one must define
__ENABLE_MOCANA_DSA__
MOC_EXTERN MSTATUS 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 DSA_freeKey() when it is done using the cloned key.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
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 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, else use DSA_computeKeyPairEx
.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
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 DSA_computeKeyPairEx | ( | MOC_DSA(hwAccelDescr hwAccelCtx) randomContext * | pFipsRngCtx, |
DSAKey * | p_dsaDescr, | ||
ubyte4 | Lin, | ||
ubyte4 | Nin, | ||
vlong ** | ppVlongQueue | ||
) |
This function generates a DSA key pair, but not their associated parameters (which should already be within the DSA 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. |
Lin | The length in bytes of the DSA prime p. (not used by this method) |
Nin | The length in bytes of the DSA cyclic group order q. |
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 DSA_computeSignature | ( | MOC_DSA(hwAccelDescr hwAccelCtx) randomContext * | pRandomContext, |
const DSAKey * | p_dsaDescr, | ||
vlong * | m, | ||
intBoolean * | pVerifySignature, | ||
vlong ** | ppR, | ||
vlong ** | ppS, | ||
vlong ** | ppVlongQueue | ||
) |
This function generates a DSA signature.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
To use this API one must define + __ENABLE_MOCANA_DSA__
pRandomContext | Pointer to RNG context to use for signature generation. |
p_dsaDescr | Pointer to DSA key pair. |
m | Pointer to digested input message. |
pVerifySignature | On return, pointer to TRUE if generated signature is valid; otherwise pointer to FALSE . |
ppR | On return, pointer to address of R portion of the resultant signature. |
ppS | On return, pointer to address of S portion of the resultant signature. |
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 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 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__
dsa.h dsa.h
MOC_EXTERN MSTATUS DSA_computeSignatureEx | ( | MOC_DSA(hwAccelDescr hwAccelCtx) RNGFun | rngfun, |
void * | rngArg, | ||
const DSAKey * | p_dsaDescr, | ||
vlong * | m, | ||
intBoolean * | pVerifySignature, | ||
vlong ** | ppR, | ||
vlong ** | ppS, | ||
vlong ** | ppVlongQueue | ||
) |
This function generates a DSA signature.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
To use this API one must define + __ENABLE_MOCANA_DSA__
rngfun | The random number generating function used |
rngArg | Any info the rngfun needs to perform its operations |
p_dsaDescr | Pointer to DSA key pair. |
m | Pointer to digested input message. |
pVerifySignature | On return, pointer to TRUE if generated signature is valid; otherwise pointer to FALSE . |
ppR | On return, pointer to address of R portion of the resultant signature. |
ppS | On return, pointer to address of S portion of the resultant signature. |
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 DSA_createKey | ( | DSAKey ** | pp_dsaDescr | ) |
This function creates storage (allocates memory) for a DSA key. After the memory is allocated, applications can use the DSA_generateKey() function to generate the DSA key.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
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 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.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
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 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.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
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 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.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
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 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__
dsa.h dsa.h
MOC_EXTERN MSTATUS DSA_generateKey | ( | MOC_DSA(hwAccelDescr hwAccelCtx) randomContext * | pFipsRngCtx, |
DSAKey * | p_dsaDescr, | ||
ubyte4 | keySize, | ||
ubyte4 * | pRetC, | ||
ubyte * | pRetSeed, | ||
vlong ** | ppRetH, | ||
vlong ** | ppVlongQueue | ||
) |
This function generates a DSA key pair (private and public keys) and associated parameters. Typically, your application calls this function after calling the DSA_createKey() function.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
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. But... what does the user specify? In the 5.3.1 docs, we just said that this was "Reserved for future use." Ditto this for all dsa.{c,h} functions. |
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. |
pRetC | On return, pointer to C value to use for DSK key verification. |
pRetSeed | If NULL, the function does not return the seed, otherwise, it is a user-supplied buffer into which the function will place the seed value. This is a value related to FIPS certification. It must be the same size as the subprime (160 bits for 1024-bit DSA keys, 256 bits for 2048-bit or 3072-bit DSA keys) |
ppRetH | On return, pointer to address of H value to use for DSA key verification (see DSA_verifyKeys). Call VLONG_freeVlong when you are done with this value. |
ppVlongQueue | On return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used (see DSA_verifyKeys). (Before ending, your application should be sure to free the entire queue by calling VLONG_freeVlongQueue.) |
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 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__
dsa.h dsa.h
MOC_EXTERN MSTATUS 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 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__
dsa.h dsa.h
MOC_EXTERN MSTATUS DSA_generateKeyEx | ( | MOC_DSA(hwAccelDescr hwAccelCtx) randomContext * | pFipsRngCtx, |
DSAKey * | p_dsaDescr, | ||
ubyte4 | keySize, | ||
ubyte4 | qSize, | ||
DSAHashType | hashType, | ||
ubyte4 * | pRetC, | ||
ubyte * | pRetSeed, | ||
vlong ** | ppRetH, | ||
vlong ** | ppVlongQueue | ||
) |
Generate DSA key pair (private and public keys) and associated parameters. This method allows for a hash type and qSize to be passed in only the configurations allowed via FIPS 186-4 are allowed.
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 and parameter generation. |
p_dsaDescr | Pointer to DSA key memory, previously allocated by DSA_createKey(). |
keySize | Bit length of the generated DSA key. |
qSize | Bit length of the cyclic group order q. |
hashType | The hash algorithm to use in key generation. |
pRetC | On return, pointer to C value to use for DSK key verification. |
pRetSeed | If NULL, the function does not return the seed, otherwise, it is a user-supplied buffer into which the function will place the seed value. This is a value related to FIPS certification. It must be the same size as the subprime (160 bits for 1024-bit DSA keys, 256 bits for 2048-bit or 3072-bit DSA keys) |
ppRetH | On return, pointer to address of H value to use for DSA key verification (see DSA_verifyKeys). Call VLONG_freeVlong when you are done with this value. |
ppVlongQueue | On return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used (see DSA_verifyKeys). (Before ending, your application should be sure to free the entire queue by calling VLONG_freeVlongQueue.) |
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 DSA_generateRandomG | ( | MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey * | p_dsaDescr, |
randomContext * | pRandomContext, | ||
vlong ** | ppRetH, | ||
vlong ** | ppVlongQueue | ||
) |
Randomly computes a generator g of the cyclic group of order q. Optionally, the intermediate value h can be be output by this method in vlong
form. If exercising that option be sure to call VLONG_freeVlong
when done with it.
p_dsaDescr | 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. |
ppRetH | Optional. If provided, pointer to the location that will receive receive a newly allocated vlong with the base h used to compute g, ie g = h^((p-1)/q). |
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 DSA_generateRandomGAux | ( | MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey * | p_dsaDescr, |
randomContext * | pRandomContext, | ||
ubyte ** | ppH, | ||
ubyte4 * | pHLen, | ||
vlong ** | ppVlongQueue | ||
) |
Randomly computes a generator g of the cyclic group of order q.
p_dsaDescr | 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 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__
dsa.h dsa.h
MOC_EXTERN MSTATUS 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__
dsa.h dsa.h
MOC_EXTERN MSTATUS 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__
dsa.h dsa.h
MOC_EXTERN MSTATUS 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.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
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 DSA_setAllKeyParameters | ( | MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey * | pKey, |
const ubyte * | p, | ||
ubyte4 | pLen, | ||
const ubyte * | q, | ||
ubyte4 | qLen, | ||
const ubyte * | g, | ||
ubyte4 | gLen, | ||
const ubyte * | x, | ||
ubyte4 | xLen, | ||
vlong ** | ppVlongQueue | ||
) |
Sets all the DSA domain and key parameters in a DSA key from Big Endian byte arrays. The public key will be computed from the private key.
pKey | Pointer to a previously allocated DSA key. |
p | The DSA large prime number p as a Big Endian byte array. |
pLen | The length of p in bytes. |
q | The cyclic group order q as a Big Endian byte array. |
qLen | The length of q in bytes. |
g | The cyclic group generator g as a Big Endian byte array. |
gLen | The length of g in bytes. |
x | The private key x as a Big Endian byte array. |
xLen | The length of x 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 DSA_setKeyParameters | ( | MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey * | pKey, |
const ubyte * | p, | ||
ubyte4 | pLen, | ||
const ubyte * | q, | ||
ubyte4 | qLen, | ||
const ubyte * | g, | ||
ubyte4 | gLen, | ||
vlong ** | ppVlongQueue | ||
) |
Sets the DSA domain parameters in a DSA key from Big Endian byte arrays. Setting the generator g is optional.
pKey | Pointer to a previously allocated DSA key. |
p | The DSA large prime number p as a Big Endian byte array. |
pLen | The length of p in bytes. |
q | The cyclic group order q as a Big Endian byte array. |
qLen | The length of q in bytes. |
g | Optional. The cyclic group generator g as a Big Endian byte array. |
gLen | The length of g 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 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 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__
dsa.h dsa.h
MOC_EXTERN MSTATUS DSA_setPublicKeyParameters | ( | MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey * | pKey, |
const ubyte * | p, | ||
ubyte4 | pLen, | ||
const ubyte * | q, | ||
ubyte4 | qLen, | ||
const ubyte * | g, | ||
ubyte4 | gLen, | ||
const ubyte * | y, | ||
ubyte4 | yLen, | ||
vlong ** | ppVlongQueue | ||
) |
Sets all the DSA domain and public key parameters in a DSA key from Big Endian byte arrays.
pKey | Pointer to a previously allocated DSA key. |
p | The DSA large prime number p as a Big Endian byte array. |
pLen | The length of p in bytes. |
q | The cyclic group order q as a Big Endian byte array. |
qLen | The length of q in bytes. |
g | The cyclic group generator g as a Big Endian byte array. |
gLen | The length of g in bytes. |
y | The public key y as a Big Endian byte array. |
yLen | The length of y 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 DSA_verifyG | ( | MOC_DSA(hwAccelDescr hwAccelCtx) vlong * | pP, |
vlong * | pQ, | ||
vlong * | pG, | ||
intBoolean * | isValid, | ||
vlong ** | ppVlongQueue | ||
) |
Verifies that g generates a cyclic group of prime order q. This method does not verify q is prime. If q is not prime then g will also not be properly verified as a generator of the cyclic group.
pP | The DSA large prime number p. |
pQ | The cyclic group order q. |
pG | The integer g to be verified. |
isValid | Contents will be set to TRUE if p and q are successfully verified 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. MOC_EXTERN MSTATUS DSA_verifyKeys | ( | MOC_DSA(hwAccelDescr hwAccelCtx) randomContext * | pFipsRngCtx, |
ubyte * | pSeed, | ||
const DSAKey * | p_dsaDescr, | ||
ubyte4 | C, | ||
vlong * | pH, | ||
intBoolean * | isGoodKeys, | ||
vlong ** | ppVlongQueue | ||
) |
This function verifies a DSA key that was generated by the DSA_generateKey() function with a default seed length of 20 bytes, a default hashType of SHA-1, and a default keyType of DSA_186_4.
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 used for DSA key generation. |
pSeed | Pointer to seed value returned from DSA_generateKey(). |
p_dsaDescr | Pointer to DSA key to verify. |
C | The iteration count C value returned from DSA_generateKey(). |
pH | Pointer to H value returned from DSA_generateKey(). |
isGoodKeys | On return, pointer to TRUE if the key is valid; otherwise pointer to FALSE . |
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 DSA_verifyKeysEx | ( | MOC_DSA(hwAccelDescr hwAccelCtx) randomContext * | pFipsRngCtx, |
ubyte * | pSeed, | ||
ubyte4 | seedSize, | ||
const DSAKey * | p_dsaDescr, | ||
DSAHashType | hashType, | ||
DSAKeyType | keyType, | ||
ubyte4 | C, | ||
vlong * | pH, | ||
intBoolean * | isGoodKeys, | ||
vlong ** | ppVlongQueue | ||
) |
This function verifies a DSA key that was generated by the DSA_generateKey() function.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
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 used for DSA key generation. |
pSeed | Pointer to seed value returned from DSA_generateKey(). |
seedSize | The size of the seed in bytes. |
p_dsaDescr | Pointer to DSA key to verify. |
hashType | The hash algorithm used within DSA_generateKey(). |
keyType | Either DSA_186_2 or DSA_186_4 . |
C | The iteration count C value returned from DSA_generateKey(). |
pH | Pointer to H value returned from DSA_generateKey(). |
isGoodKeys | On return, pointer to TRUE if the key is valid; otherwise pointer to FALSE . |
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 DSA_verifyPQ | ( | MOC_DSA(hwAccelDescr hwAccelCtx) randomContext * | pFipsRngCtx, |
DSAKey * | p_dsaDescr, | ||
ubyte4 | L, | ||
ubyte4 | Nin, | ||
DSAHashType | hashType, | ||
DSAKeyType | keyType, | ||
ubyte4 | C, | ||
ubyte * | pSeed, | ||
ubyte4 | seedSize, | ||
intBoolean * | pIsPrimePQ, | ||
vlong ** | ppVlongQueue | ||
) |
Verifies that the parameters p and q come from seed and initial domain parameters passed in.
pFipsRngCtx | Pointer to RNG context used during DSA key generation. |
p_dsaDescr | Pointer to DSA key to with the p and q to verify. |
L | The key size in bits. |
Nin | The cyclic group order q's size in bits. |
hashType | The original hash type used when key generation was done. |
keyType | The original key type DSA_186_2 or DSA_186_4 used when key generation was done. |
C | The iteration count C value returned when original key generation was done. |
pSeed | Buffer holding the original seed used to generate p and q. |
seedSize | The length of the seed in bytes. |
pIsPrimePQ | Contents will be set to TRUE if p and q are successfully verified 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. MOC_EXTERN MSTATUS DSA_verifySignature | ( | MOC_DSA(hwAccelDescr hwAccelCtx) const DSAKey * | p_dsaDescr, |
vlong * | m, | ||
vlong * | pR, | ||
vlong * | pS, | ||
intBoolean * | isGoodSignature, | ||
vlong ** | ppVlongQueue | ||
) |
This function verifies a message's DSA signature.
FIPS Approved | ![]() |
Suite B Algorithm | ![]() |
Flowchart | DSA |
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. |
p_dsaDescr | Pointer to DSA key. |
m | Pointer to digested input message. |
pR | Pointer to R portion of the signature to verify. |
pS | Pointer to S portion of the signature to verify. |
isGoodSignature | On return, pointer to TRUE if the signature is valid; otherwise pointer to FALSE . |
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 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 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__
dsa.h dsa.h
MOC_EXTERN MSTATUS generateG | ( | MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey * | p_dsaDescr, |
vlong ** | ppRetH, | ||
vlong ** | ppVlongQueue | ||
) |
Deterministically computes a generator g of the cyclic group of order q. Optionally, the intermediate value h can be be output by this method in vlong
form. If exercising that option be sure to call VLONG_freeVlong
when done with it.
p_dsaDescr | 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. |
ppRetH | Optional. If provided, pointer to the location that will receive receive a newly allocated vlong with the base h used to compute g, ie g = h^((p-1)/q). |
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 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__
dsa.h dsa.h