![]() |
TrustCore SDK NanoCrypto API reference
version 7.0
|
Header file for declaring One-Time-Password and S/Key methods. More...
Go to the source code of this file.
Functions | |
MOC_EXTERN MSTATUS | OTP_otp (MOC_HASH(hwAccelDescr hwAccelCtx) ubyte ht_type, const sbyte *seed, const sbyte *pwd, ubyte4 seq, ubyte res[8]) |
Computes a one-time password. More... | |
MOC_EXTERN MSTATUS | OTP_otpEx (MOC_HASH(hwAccelDescr hwAccelCtx) const sbyte *challenge, const sbyte *pwd, sbyte res[20]) |
Computes a one-time password from a challange string. More... | |
Header file for declaring One-Time-Password and S/Key methods.
To enable the methods in this file please define:
__ENABLE_MOCANA_OTP__
MOC_EXTERN MSTATUS OTP_otp | ( | MOC_HASH(hwAccelDescr hwAccelCtx) ubyte | ht_type, |
const sbyte * | seed, | ||
const sbyte * | pwd, | ||
ubyte4 | seq, | ||
ubyte | res[8] | ||
) |
Computes a one-time password from a hash type, seed, initial password, and sequence number.
ht_type | Hash type identifier from ca_mgmt.h. This is one of
|
seed | The initial seed as a character string. This is case insensitive and may be the empty string. |
pwd | The initial password as a character string. This is NOT case insensitive and there is no limit on the length of this string. |
seq | The sequence number. This is the number of hashing iterations that will be performed. |
res | Buffer to hold the resulting one time password as a byte array. This is 64 bits (8 bytes) in length. |
To enable this method please define:
__ENABLE_MOCANA_OTP__
OK
(0) if successful, otherwise a negative number error code from merrors.h. MOC_EXTERN MSTATUS OTP_otpEx | ( | MOC_HASH(hwAccelDescr hwAccelCtx) const sbyte * | challenge, |
const sbyte * | pwd, | ||
sbyte | res[20] | ||
) |
Computes a one-time password from a challange string. This string as described in RFC 2289 consists of "otp-<hash identifier> <sequence integer> <seed>" where the spaces shown must be present and hash identifier is "md4", "md5", or "sha1".
challenge | A challange string in the form described above. |
pwd | The initial password as a character string. This is NOT case insensitive and there is no limit on the length of this string. |
res | Buffer to hold the resulting one time password as a string. This will be 19 characters plus the '\0' terminating character. |
To enable this method please define:
__ENABLE_MOCANA_OTP__
OK
(0) if successful, otherwise a negative number error code from merrors.h.