ECDSA Cipher Object
Operations Supported
SignInit(), Sign(), VerifyInit(), and Verify().
Key Encoding
When performing:
>Sign operation: the key is specified as a buffer of ECC_Curve_t followed by Private Key ECC_PrivateKey_t.
>Verify operation: the key is specified as a buffer of ECC_Curve_t followed by Public Key ECC_PublicKey_t.
See also ECDSA Key Structures.
Modes
None
Sign/Verify Parameters
None
ECDSA Key Structures
#define ECC_MAX_MOD_LEN 571 #define ECC_MAX_BUF_LEN ROUND_UP(ECC_MAX_MOD_LEN, 8)/8 typedef enum ECC_FieldType_et { ECC_FT_GFP, ECC_FT_G2M ECC_FT_MON } ECC_FieldType_t;
Where:
>ECC_FT_GFP: Identifies a curve over a field with an odd prime number of elements.
>ECC_FT_G2M: Identifies a curve over a field of characteristic two (F_2^m).
>ECC_FT_MON: Identifies a curve that uses a Montgomery function.
typedef struct ECC_Point_st { unsigned char x[ECC_MAX_BUF_LEN]; unsigned char y[ECC_MAX_BUF_LEN]; } ECC_Point_t;
Where:
>x: The X coordinate of the point. X is an element of the field over which the curve is defined.
>y: The Y coordinate of the point. Y is an element of the field over which the curve is defined.
typedef struct ECC_Curve_st { ECC_FieldType_t fieldType; ECC_Point_t base; unsigned char modulus[ECC_MAX_BUF_LEN]; unsigned char a[ECC_MAX_BUF_LEN]; unsigned char b[ECC_MAX_BUF_LEN]; unsigned char bpOrder[ECC_MAX_BUF_LEN]; } ECC_Curve_t;
Where:
>fieldType: The field type, over which this curve is defined.
>base: The base point.
>modulus: The curve modulus. This value is the field polynomial for ECC_FT_G2M field types.
>a: The coefficient 'a' in the elliptic curve equation.
>b: The coefficient 'b' in the elliptic curve equation.
>bpOrder: The base point order. This buffer contains a big endian large number regardless of the field type.
typedef struct ECC_PrivateKey_st {
unsigned char d[ECC_MAX_BUF_LEN];
} ECC_PrivateKey_t;
Where:
>d: The buffer containing the private key. The private key is always a big-endian large number, d, regardless of the field type of the curve.
typedef struct ECC_PublicKey_st {
ECC_Point_t p;
} ECC_PublicKey_t;
Where:
>p: The point P on the curve, which is calculated from the curve base and the private key.