2 * CryptKitAsn1.h - ASN1 templates for FEE objects
5 #ifndef _CRYPT_KIT_ASN1_H_
6 #define _CRYPT_KIT_ASN1_H_
10 #if CRYPTKIT_DER_ENABLE
12 #include <Security/cssmtype.h>
13 #include <Security/secasn1t.h>
20 -- FEE Curve parameters (defined in <security_cryptkit/feeTypes.h>)
21 FEEPrimeType ::= INTEGER { FPT_Mersenne(0), FPT_FEE(1), FPT_General(2) }
22 FEECurveType ::= INTEGER { FCT_Montgomery(0), FCT_Weierstrass(1),
27 FEECurveParameters ::= SEQUENCE
29 primeType FEEPrimeType,
30 curveType FEECurveType,
31 q INTEGER, -- unsigned
35 bb BigIntegerStr, -- can't use variable/field b
38 x1Minus BigIntegerStr,
39 cOrderPlus BigIntegerStr,
40 cOrderMinus BigIntegerStr,
41 x1OrderPlus BigIntegerStr,
42 x1OrderMinus BigIntegerStr,
43 basePrime BigIntegerStr OPTIONAL
44 -- iff FEEPrimeType == CT_GENERAL
54 CSSM_DATA b_
; // can't use variable/field b
59 CSSM_DATA cOrderMinus
;
60 CSSM_DATA x1OrderPlus
;
61 CSSM_DATA x1OrderMinus
;
62 CSSM_DATA basePrime
; // OPTIONAL
63 } FEECurveParametersASN1
;
65 extern const SecAsn1Template FEECurveParametersASN1Template
[];
68 -- FEE ElGamal-style signature
69 FEEElGamalSignature ::= SEQUENCE {
77 } FEEElGamalSignatureASN1
;
79 extern const SecAsn1Template FEEElGamalSignatureASN1Template
[];
82 -- FEE ECDSA-style signature
83 FEEECDSASignature ::= SEQUENCE {
91 } FEEECDSASignatureASN1
;
93 extern const SecAsn1Template FEEECDSASignatureASN1Template
[];
96 FEEPublicKey ::= SEQUENCE
99 curveParams FEECurveParameters,
101 minusX BigIntegerStr,
102 plusY BigIntegerStr OPTIONAL
103 -- iff FEECurveType == ct-weierstrass
108 FEECurveParametersASN1 curveParams
;
111 CSSM_DATA plusY
; // OPTIONAL
114 extern const SecAsn1Template FEEPublicKeyASN1Template
[];
117 FEEPrivateKey ::= SEQUENCE
120 curveParams FEECurveParameters,
121 privData BigIntegerStr
126 FEECurveParametersASN1 curveParams
;
130 extern const SecAsn1Template FEEPrivateKeyASN1Template
[];
136 #endif /* CRYPTKIT_DER_ENABLE */
138 #endif /* _CRYPT_KIT_ASN1_H_ */