Cryptography Reference
In-Depth Information
The Standards for Effi cient Cryptography Group (SECG) lists the named
curves and their values at
http://www.secg.org/download/aid-784/sec2-v2
.pdf
. The names the groups gives to the curves are along the lines of
secp192r1,
which indicates that it's an SEC (Standards for Effi cient Cryptography) prime-
fi eld curve, 192 bits long, and that it is randomly generated. You also might see
sect
nnn
curves that identify characteristic 2 fi nite-fi eld curves and
secp
nnn
k
curves that identify
Koblitz curves
. The distinction isn't particularly important
here; this topic focuses on the “secp” curves.
Some of the SECP curves come from an older NIST standard, which referred
to the curves as simply
prime
nnn
vx
where
nnn
was the length of the parameters
and
x
was just a version.
prime192v1
is identical to
secp192r1
, and
prime256v1
is identical to
secp256r1
.
Named curve support is straightforward, if slightly tedious. A 256-bit named
curve such as secp256r1 is described by a list of six 256-bit (32-byte) numeric
values. To support a little bit of diversity, go ahead and implement two named
curves — prime192v1/secp192r1 and prime256v1/secp256r1 — as shown in
Listing 9-31.
Listing 9-31:
“ecc.c” get_named_curve
unsigned char prime192v1_P[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};
unsigned char prime192v1_A[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC
};
unsigned char prime192v1_B[] = {
0x64, 0x21, 0x05, 0x19, 0xE5, 0x9C, 0x80, 0xE7,
0x0F, 0xA7, 0xE9, 0xAB, 0x72, 0x24, 0x30, 0x49,
0xFE, 0xB8, 0xDE, 0xEC, 0xC1, 0x46, 0xB9, 0xB1
};
unsigned char prime192v1_Gx[] = {
0x18, 0x8D, 0xA8, 0x0E, 0xB0, 0x30, 0x90, 0xF6,
0x7C, 0xBF, 0x20, 0xEB, 0x43, 0xA1, 0x88, 0x00,
0xF4, 0xFF, 0x0A, 0xFD, 0x82, 0xFF, 0x10, 0x12
};
unsigned char prime192v1_Gy[] = {
0x07, 0x19, 0x2B, 0x95, 0xFF, 0xC8, 0xDA, 0x78,
0x63, 0x10, 0x11, 0xED, 0x6B, 0x24, 0xCD, 0xD5,
0x73, 0xF9, 0x77, 0xA1, 0x1E, 0x79, 0x48, 0x11
};
unsigned char prime192v1_N[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
(Continued)
Search WWH ::
Custom Search