KM_EncodeECParams2M

#include“kmlib.h”

Windows library: Kmlib.lib

UNIX library: Libkmlib.a

typedef enum {
    ECBT_GnBasis,   /* Gaussian Normal Basis - parameters = 0,  0,  0 */
    ECBT_TpBasis,   /* Trinomial Basis - parameters = k,  0,  0 */
    ECBT_PpBasis    /* Pentanomial Basis - parameters = k1, k2, k3 */
} ECBasisType;
 
CK_RV KM_EncodeECParams2M(
    CK_SIZE m,
    ECBasisType basis,
    CK_SIZE  parameters[3],   
    CK_BYTE_PTR curveA,   CK_SIZE curveALen,
    CK_BYTE_PTR curveB,   CK_SIZE curveBLen,
    CK_BYTE_PTR curveSeed,CK_SIZE curveSeedLen,
    CK_BYTE_PTR baseX,    CK_SIZE baseXLen,
    CK_BYTE_PTR baseY,    CK_SIZE baseYLen,
    CK_BYTE_PTR bpOrder,  CK_SIZE bpOrderLen,
    CK_BYTE_PTR cofactor, CK_SIZE cofactorLen,
    CK_BYTE_PTR result,   CK_SIZE * resultLen
);

Do DER enc of ECC Domain Parameters 2^M

All long integer values are variable length big endian numbers with optional leading zeros, lengths are all in bytes.

Parameter Description
M Degree of field
basis Should be ECBT_GnBasis or ECBT_TpBasis or ECBT_PpBasis
parameters

Array of three integers - values depend on basis

ECBT_GnBasis - parameters = 0. 0. 0

ECBT_TpBasis - parameters = k. 0. 0

ECBT_PpBasis - parameters = k1.k2.k3

curveA Elliptic Curve coefficient a
curveALen Elliptic Curve coefficient a length
curveB Elliptic Curve coefficient b
curveBLen Elliptic Curve coefficient b length
curveSeed Seed (optional may be NULL)
curveSeedLen Seed length
baseX Elliptic Curve point X coord
baseXLen Elliptic Curve point X coord length
baseY Elliptic Curve point Y coord
baseYLen Elliptic Curve point Y coord length
bpOrder Order n of the Base Point
bpOrderLen Order n of the Base Point length
cofactor The integer h = #E(Fq)/n (optional)
cofactorLen h length
result Resultant Encoding (length prediction supported if NULL)
resultLen Buffer len/Length of resultant encoding
Return Status of operation. CKR_OK if ok