2 * CryptKitAsn1.h - ASN1 templates for FEE objects
5 #ifndef _CRYPT_KIT_ASN1_H_
6 #define _CRYPT_KIT_ASN1_H_
8 #include <Security/cssmtype.h>
9 #include <SecurityNssAsn1/secasn1t.h>
16 -- FEE Curve parameters (defined in <CryptKit/feeTypes.h>)
17 FEEPrimeType ::= INTEGER { FPT_Mersenne(0), FPT_FEE(1), FPT_General(2) }
18 FEECurveType ::= INTEGER { FCT_Montgomery(0), FCT_Weierstrass(1),
23 FEECurveParameters ::= SEQUENCE
25 primeType FEEPrimeType,
26 curveType FEECurveType,
27 q INTEGER, -- unsigned
31 bb BigIntegerStr, -- can't use variable/field b
34 x1Minus BigIntegerStr,
35 cOrderPlus BigIntegerStr,
36 cOrderMinus BigIntegerStr,
37 x1OrderPlus BigIntegerStr,
38 x1OrderMinus BigIntegerStr,
39 basePrime BigIntegerStr OPTIONAL
40 -- iff FEEPrimeType == CT_GENERAL
50 CSSM_DATA b_
; // can't use variable/field b
55 CSSM_DATA cOrderMinus
;
56 CSSM_DATA x1OrderPlus
;
57 CSSM_DATA x1OrderMinus
;
58 CSSM_DATA basePrime
; // OPTIONAL
59 } FEECurveParametersASN1
;
61 extern const SEC_ASN1Template FEECurveParametersASN1Template
[];
64 -- FEE ElGamal-style signature
65 FEEElGamalSignature ::= SEQUENCE {
73 } FEEElGamalSignatureASN1
;
75 extern const SEC_ASN1Template FEEElGamalSignatureASN1Template
[];
78 -- FEE ECDSA-style signature
79 FEEECDSASignature ::= SEQUENCE {
87 } FEEECDSASignatureASN1
;
89 extern const SEC_ASN1Template FEEECDSASignatureASN1Template
[];
92 FEEPublicKey ::= SEQUENCE
95 curveParams FEECurveParameters,
98 plusY BigIntegerStr OPTIONAL
99 -- iff FEECurveType == ct-weierstrass
104 FEECurveParametersASN1 curveParams
;
107 CSSM_DATA plusY
; // OPTIONAL
110 extern const SEC_ASN1Template FEEPublicKeyASN1Template
[];
113 FEEPrivateKey ::= SEQUENCE
116 curveParams FEECurveParameters,
117 privData BigIntegerStr
122 FEECurveParametersASN1 curveParams
;
126 extern const SEC_ASN1Template FEEPrivateKeyASN1Template
[];
133 #endif /* _CRYPT_KIT_ASN1_H_ */