2 * CryptKitAsn1.cpp - ASN1 templates for FEE keys and signatures
5 #include "CryptKitAsn1.h"
8 * Unlike RSA, DSA, and Diffie-Hellman, the integers in these
9 * objects are indeed signed.
11 #define SEC_ASN1_SIGNED (SEC_ASN1_SIGNED_INT | SEC_ASN1_INTEGER)
13 /* FEECurveParametersASN1 */
14 const SEC_ASN1Template FEECurveParametersASN1Template
[] = {
16 0, NULL
, sizeof(FEECurveParametersASN1
) },
17 { SEC_ASN1_INTEGER
, offsetof(FEECurveParametersASN1
,primeType
) },
18 { SEC_ASN1_INTEGER
, offsetof(FEECurveParametersASN1
,curveType
) },
19 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,q
) },
20 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,k
) },
21 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,m
) },
22 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,a
) },
23 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,b_
) },
24 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,c
) },
25 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,x1Plus
) },
26 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,x1Minus
) },
27 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,cOrderPlus
) },
28 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,cOrderMinus
) },
29 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,x1OrderPlus
) },
30 { SEC_ASN1_SIGNED
, offsetof(FEECurveParametersASN1
,x1OrderMinus
) },
31 { SEC_ASN1_SIGNED
| SEC_ASN1_OPTIONAL
,
32 offsetof(FEECurveParametersASN1
,basePrime
) },
36 /* FEEElGamalSignatureASN1 */
37 const SEC_ASN1Template FEEElGamalSignatureASN1Template
[] = {
39 0, NULL
, sizeof(FEEElGamalSignatureASN1
) },
40 { SEC_ASN1_SIGNED
, offsetof(FEEElGamalSignatureASN1
,u
) },
41 { SEC_ASN1_SIGNED
, offsetof(FEEElGamalSignatureASN1
,pmX
) },
45 /* FEEECDSASignatureASN1 */
46 const SEC_ASN1Template FEEECDSASignatureASN1Template
[] = {
48 0, NULL
, sizeof(FEEECDSASignatureASN1
) },
49 { SEC_ASN1_SIGNED
, offsetof(FEEECDSASignatureASN1
,c
) },
50 { SEC_ASN1_SIGNED
, offsetof(FEEECDSASignatureASN1
,d
) },
54 /* FEEPublicKeyASN1 */
55 const SEC_ASN1Template FEEPublicKeyASN1Template
[] = {
57 0, NULL
, sizeof(FEEPublicKeyASN1
) },
58 { SEC_ASN1_SIGNED
, offsetof(FEEPublicKeyASN1
,version
) },
60 offsetof(FEEPublicKeyASN1
,curveParams
),
61 FEECurveParametersASN1Template
},
62 { SEC_ASN1_SIGNED
, offsetof(FEEPublicKeyASN1
,plusX
) },
63 { SEC_ASN1_SIGNED
, offsetof(FEEPublicKeyASN1
,minusX
) },
64 { SEC_ASN1_SIGNED
| SEC_ASN1_OPTIONAL
,
65 offsetof(FEEPublicKeyASN1
,plusY
) },
69 /* FEEPrivateKeyASN1 */
70 const SEC_ASN1Template FEEPrivateKeyASN1Template
[] = {
72 0, NULL
, sizeof(FEEPrivateKeyASN1
) },
73 { SEC_ASN1_SIGNED
, offsetof(FEEPrivateKeyASN1
,version
) },
75 offsetof(FEEPrivateKeyASN1
,curveParams
),
76 FEECurveParametersASN1Template
},
77 { SEC_ASN1_SIGNED
, offsetof(FEEPrivateKeyASN1
,privData
) },