ECC Key Data Structure Definition
A key is stored in order from the most significant bit to the least significant bit; that is, when placing a key into the key structure array, the highest byte is stored at the highest position. If the key is shorter than the array length, the remaining bits are padded with zeros.
Field Name |
Data Length (Byte) |
Description |
|---|---|---|
bits |
4 |
Key length. |
x |
ECCref_MAX_LEN |
x-coordinate of the public key. |
y |
ECCref_MAX_LEN |
y-coordinate of the public key. |
Field Name |
Data Length (Byte) |
Description |
|---|---|---|
bits |
4 |
Key length. |
K |
ECCref_MAX_LEN |
Private key. |
Actual data structure definition:
#define ECCref_MAX_BITS 512
#define ECCref_MAX_LEN ((ECCref_MAX_BITS+7) / 8)
typedef struct ECCrefPublicKey_st {
unsigned int bits;
unsigned char x[ECCref_MAX_LEN];
unsigned char y[ECCref_MAX_LEN];
} ECCrefPublicKey;
typedef struct ECCrefPrivateKey_st {
unsigned int bits;
unsigned char K[ECCref_MAX_LEN];
} ECCrefPrivateKey;
Parent topic: Data Structures