RSA Security 5.2.2 Projection Television User Manual


 
Performing Elliptic Curve Operations
292 RSA BSAFE Crypto-C Developers Guide
Step 2: Setting the Algorithm Object
You need to set the algorithm object that will then be used to generate the key pair.
To supply the necessary information, pass a pointer to an
ITEM structure that contains
the ANSI X9.62-compliant BER encoding of an elliptic curves parameters. In
compliance with X9.62, you can specify the
CHOICE of either a full EC CURVE
definition or a NAMED CURVE definition. Both ANSI X9.62 uncompressed and
hybrid base points are decoded.
B_ALGORITHM_OBJ *ecParamsObj = (B_ALGORITHM_OBJ)NULL_PTR;
if((status = B_CreateAlgorithmObject (ecParamsObj)) != 0)
break;
ITEM stockECParamsBER;
unsigned char ECParamsBER[154] = {
0x30, 0x81, 0x97, 0x02, 0x01, 0x01, 0x30, 0x20,
0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01,
0x01, 0x02, 0x15, 0x00, 0xda, 0xe2, 0x12, 0xcc,
0xec, 0x6d, 0xfa, 0x73, 0x17, 0x44, 0x1c, 0xee,
0x28, 0xf0, 0x42, 0xa3, 0xde, 0xd0, 0x4d, 0x7f,
0x30, 0x2c, 0x04, 0x14, 0xda, 0xe2, 0x12, 0xcc,
0xec, 0x6d, 0xfa, 0x73, 0x17, 0x44, 0x1c, 0xee,
0x28, 0xf0, 0x42, 0xa3, 0xde, 0xd0, 0x4d, 0x7c,
0x04, 0x14, 0xbf, 0x63, 0x40, 0xb3, 0xf8, 0xef,
0x6a, 0xbc, 0xd1, 0x9b, 0x56, 0x37, 0x69, 0x85,
0x5b, 0xa0, 0xa2, 0xae, 0x84, 0x92, 0x04, 0x29,
0x04, 0x77, 0x79, 0xdc, 0x0b, 0xf7, 0xfa, 0x7e,
0x52, 0xd1, 0x4c, 0x14, 0x3a, 0x60, 0x7a, 0x46,
0xe3, 0x6c, 0x7b, 0x7a, 0x7e, 0xd1, 0xa0, 0xc5,
0x30, 0xa6, 0x2b, 0xf5, 0x4f, 0xa8, 0xe7, 0x6f,
0x58, 0x64, 0xcc, 0x5a, 0xf3, 0xab, 0x06, 0x76,
0x6a, 0x02, 0x14, 0x06, 0x14, 0x80, 0x85, 0xb1,
0x3b, 0xf1, 0x9f, 0xa4, 0x33, 0xa9, 0x32, 0x42,
0x85, 0x00, 0xff, 0x30, 0x43, 0x2e, 0x75, 0x02,
0x01, 0x24
};