Creates an ECC private and/or public key object from the given password.
#include "huecspeke.h"
int hu_ECSPEKEKeyGen(sb_Params eccParams, int hashAlgId, size_t oLen, size_t passwordBytes, const unsigned char *passwordValue, sb_PublicKey *genFromPasswd, sb_PrivateKey *privateKey, sb_PublicKey *publicKey, sb_GlobalCtx sbCtx)
An ECC parameters object.
The hash algorithm for HashRE. Currently only HU_MGF1_SHA256 is supported.
The length (in bytes) of the output of HashRE. Currently only HU_HASHRE_O_LEN is supported.
The length (in bytes) of the password.
The password value.
The generator point produced from the password.
The private key object pointer.
The public key object pointer.
A global context.
This function performs ephemeral key pair generation using the ECBPKAS-SPEKE algorithm as specified in IEEE 1363.2-2008.
IEEE 1363.2-2008 contains some errors; this implementation corrects those errors.
The function applies the ECREDP-1 primitive to the password to derive a generator point. It then generates a key pair on the subgroup formed by this generator point.
In order to use this function, you must first register the underlying ECC and hash algorithms. You also need to explicitly register the hu_ZModCalcExpo() function.
Currently only the secp521r1 curve is supported.
Also, currently, for HashRE, only MGF-1-SHA-256 with an oLen of 96 bytes (768 bits) is supported.
The generator point produced from the password is used for key confirmation and must therefore be treated as a secret as sensitive as the password.
The eccParams object is NULL.
The tag for the params object is not of the expected type.
The specified elliptic curve or hash algorithm is not supported.
The specified size for oLen is not supported.
The length of password is zero.
The passwordValue is NULL.
The genFromPasswd parameter is NULL.
The privateKey parameter is NULL.
The publicKey parameter is NULL.
Memory allocation failure.
Success.