![]() |
TrustCore SDK NanoCrypto API reference
version 7.0
|
Header file for declaring Secure Remote Protocol methods. More...
Go to the source code of this file.
Functions | |
MOC_EXTERN MSTATUS | SRP_computeVerifier (MOC_ASYM(hwAccelDescr hwAccelCtx) const ubyte *salt, ubyte4 saltLen, const ubyte *uname, ubyte4 unameLen, const ubyte *pw, ubyte4 pwLen, ubyte4 bitNum, ubyte **verifier, ubyte4 *verifierLen) |
Computes the verifier for a user. More... | |
MOC_EXTERN MSTATUS | SRP_getGroupParameters (ubyte4 bitNum, vlong **modulus, vlong **generator, vlong **k) |
Gets the SRP Group parameters. More... | |
MOC_EXTERN MSTATUS | SRP_getGroupParameters2 (ubyte4 bitNum, const ubyte **modulus, sbyte4 *modulusLen, const ubyte **generator, sbyte4 *generatorLen, const ubyte **k) |
Gets the SRP Group parameters in Big Endian byte array form. More... | |
Header file for declaring Secure Remote Protocol methods.
To enable the methods in this file please define:
__ENABLE_MOCANA_SRP__
MOC_EXTERN MSTATUS SRP_computeVerifier | ( | MOC_ASYM(hwAccelDescr hwAccelCtx) const ubyte * | salt, |
ubyte4 | saltLen, | ||
const ubyte * | uname, | ||
ubyte4 | unameLen, | ||
const ubyte * | pw, | ||
ubyte4 | pwLen, | ||
ubyte4 | bitNum, | ||
ubyte ** | verifier, | ||
ubyte4 * | verifierLen | ||
) |
Computes the verifier for a user. This is dependent on the user's username and password, and the user's random salt. Memory will be allocated for a buffer to hold the verifier. Be sure to free this buffer when done with it.
salt | The user's randomly generated salt. |
saltLen | The length of the salt in bytes. |
uname | The username as a byte array. |
unameLen | The length of the username in bytes. |
pw | The user's password as a byte array. |
pwLen | The length of the user's password in bytes. |
bitNum | The bit size for the group requested. The acceptable values are 2048, 3072, 4096, 6144, and 8192. If + __MOCANA_MIN_SRP_BITS__ is defined to 1024, or 1536 then those sizes are also acceptable. |
verifier | Pointer to the location that will receive the verifier as a newly allocated byte array. |
verifierLen | Contents will be set to the length of the verifier in bytes. |
To enable this method please define:
__ENABLE_MOCANA_SRP__
OK
(0) if successful, otherwise a negative number error code from merrors.h. MOC_EXTERN MSTATUS SRP_getGroupParameters | ( | ubyte4 | bitNum, |
vlong ** | modulus, | ||
vlong ** | generator, | ||
vlong ** | k | ||
) |
Gets the SRP Group parameters, which are fixed groups dependent on the bit size requested. This method will allocate three elements. Be sure to call VLONG_freeVlong
on each when done with them.
bitNum | The bit size requested. The acceptable values are 2048, 3072, 4096, 6144, and 8192. If + __MOCANA_MIN_SRP_BITS__ is defined to 1024, or 1536 then those sizes are also acceptable. |
modulus | Pointer to the location of the modulus for the bit size requested. |
generator | Pointer to the location of the group generator for the bit size requested. |
k | Pointer to the location of the k parameter (a SHA1 hash dependent on the modulus and generator). |
To enable this method please define:
__ENABLE_MOCANA_SRP__
OK
(0) if successful, otherwise a negative number error code from merrors.h. MOC_EXTERN MSTATUS SRP_getGroupParameters2 | ( | ubyte4 | bitNum, |
const ubyte ** | modulus, | ||
sbyte4 * | modulusLen, | ||
const ubyte ** | generator, | ||
sbyte4 * | generatorLen, | ||
const ubyte ** | k | ||
) |
Gets the SRP Group parameters, which are fixed groups dependent on the bit size requested. This method will get them in Big Endian byte array form. This method does not allocate any memeory.
bitNum | The bit size requested. The acceptable values are 2048, 3072, 4096, 6144, and 8192. If + __MOCANA_MIN_SRP_BITS__ is defined to 1024, or 1536 then those sizes are also acceptable. |
modulus | Contents will be set to the location of the modulus for the bit size requested. |
modulusLen | Contents will be set to the size of the modulus in bytes. |
generator | Contents will be set to the location of the group generator for the bit size requested. |
generatorLen | Contents will be set to the size of the group generator in bytes. |
k | Contents will be set to the location of the k parameter (a SHA1 hash dependent on the modulus and generator). The size of k in bytes is always 20. |
To enable this method please define:
__ENABLE_MOCANA_SRP__
OK
(0) if successful, otherwise a negative number error code from merrors.h.