1 FEE Portable Byte Representation of Public Key Strings and Signatures
2 Last Modified 15 March 2001
4 This defines portable data formats shared by the C and Java implementation of FEE. This definition supercedes formats used prior to 20 Feb 2001.
11 4 bytes, M.S. byte first
13 short, feeUnichar, Java char:
14 2 bytes, M.S. byte first
19 ------ -------- ---------------------------------------
20 int numBytes abs(numBytes) indicates size of n[] to
22 sign of numBytes is sign bit of result
23 byte data n[0], MSB first for each element
26 Curve Parameters (curveParams, Java CurveParams)
27 ------------------------------------------------
29 CURVE_PARAM_VERSION = 1:
33 int CURVE_PARAM_VERSION = 1
34 int minVersion of code to parse this struct = 1
48 The last four fields are not always known; a value of (giant)0
49 indicates a "not known" condition. In this case, 4 bytes of
50 zero are written, indicating a giant with a length of zero.
52 CURVE_PARAM_VERSION = 2 (20 Jan 1998)
56 int CURVE_PARAM_VERSION = 2
57 int minVersion of code to parse this struct = 2
58 byte primeType /* new for version 2 */
61 unsigned m /* new for version 2 */
72 giant basePrime, if primeType == PT_GENERAL /* new */
74 Note that as of version 2, the cOrder* and x1Order* fields are always
77 CURVE_PARAM_VERSION = 3 (1 Sep 1998)
81 int CURVE_PARAM_VERSION = 3
82 int minVersion of code to parse this struct = 3
84 byte curveType /* new for version 3 */
98 giant basePrime, if primeType == PT_GENERAL
104 PUBLIC_KEY_STRING_VERSION = 3:
106 A public key string is always encoded via enc64(); the raw data before
107 enc64() is as follows.
111 int PUBLIC_KEY_STRING_MAGIC (0xfeeddeef)
112 int PUBLIC_KEY_STRING_VERSION = 3
113 int minVersion of code to parse this key = 3
115 curveParams curve parameters
116 giant plusX (public key, plus curve)
117 giant minusX (public key, minus curve)
118 int usageName length in unichars
119 feeUnichar[] usageName as array of unichars
121 PUBLIC_KEY_BLOB_VERSION = 4 (23 Mar 1998)
123 New for version 4 - exported blobs for both public and private keys.
124 Public key strings are merely enc64() encoded versions of public
125 key blobs and are identical to PUBLIC_KEY_STRING_VERSION 3 public
128 PUBLIC_KEY_BLOB_MAGIC : 0xfeeddeef - public
130 minVersion : 3 for public, 4 for private
134 int PUBLIC_KEY_BLOB_MAGIC
135 int PUBLIC_KEY_BLOB_VERSION = 4
136 int minVersion of code to parse this key = 3 or 4
138 curveParams curve parameters
141 giant plusX (public key, plus curve)
142 giant minusX (public key, minus curve)
145 unsigned char privData[]
147 both private and public:
149 int usageName length in unichars
150 feeUnichar[] usageName as array of unichars
152 PUBLIC_KEY_BLOB_VERSION = 5 (2 Sep 1998)
159 int PUBLIC_KEY_BLOB_MAGIC_{PRIV,PUB}
160 int PUBLIC_KEY_BLOB_VERSION = 5
161 int minVersion of code to parse this key = 5
163 curveParams curve parameters
166 giant plusX (public key, plus curve)
167 giant plusY (y-coord of public key, plus curve, may be zero)
168 giant minusX (public key, minus curve)
172 both private and public:
174 int usageName length in unichars
175 feeUnichar[] usageName as array of unichars
177 PUBLIC_KEY_BLOB_VERSION = 6 (14 Mar 2001)
183 int PUBLIC_KEY_BLOB_MAGIC_{PRIV,PUB}
184 int PUBLIC_KEY_BLOB_VERSION = 5
185 int minVersion of code to parse this key = 5
187 curveParams curve parameters
190 giant plusX (public key, plus curve)
191 giant plusY (y-coord of public key, plus curve, may be zero)
192 giant minusX (public key, minus curve)
197 Digital Signature, ElGamal style
198 --------------------------------
202 int FEE_SIG_MAGIC (0xfee00516)
203 int FEE_SIG_VERSION = 3
204 int minVersion of code to parse this signature = 3
206 int signer length in unichars (DELETED 2/20/01)
207 feeUnichar[] signer as array of unichars (DELETED 2/20/01)
211 FEE_SIG_VERSION = 4 (15 March 2001)
216 int FEE_SIG_MAGIC (0xfee00516)
217 int FEE_SIG_VERSION = 4
218 int minVersion of code to parse this signature = 4
223 Digital Signature, ECDSA style
224 --------------------------------
228 int FEE_ECDSA_MAGIC (0xfee00517)
229 int FEE_ECDSA_VERSION = 1
230 int minVersion of code to parse this signature = 1
232 int signer length in unichars (DELETED 2/20/01)
233 feeUnichar[] signer as array of unichars (DELETED 2/20/01)
237 FEE_ECDSA_VERSION = 2 (15 March 2001)
242 int FEE_ECDSA_MAGIC (0xfee00517)
243 int FEE_ECDSA_VERSION = 2
244 int minVersion of code to parse this signature = 2
251 FEED (2:1) CipherText
252 ---------------------
254 This data type uses an optimized form of Giants in that the sign, and hence
255 the number of 16-bit shorts (i.e., the size of n[]), is implied by the size
256 of p used in encryption and decryption. For a given curve parameter q (as
257 in p = 2**q - k), the number of shorts per giant transmitted is ((q/8 + 1)/2).
258 As in normal giants, the n[] array is transmitted m.s. byte first. During
259 encoding, unused elements in n[] - i.e., those appearing after
260 n[abs(sign) - 1] - are zero. Upon decoding, the sign of an incoming n[]
261 array can be inferred from the number of non-zero shorts.
263 One block of ciphertext is formatted as follows. See "Fast Elliptic
264 Encryption (FEE) Algorithms", by Richard E. Crandall, July 1996, for
265 descriptions of Xm, Xc, and g.
268 --------------- -----------------
274 FEED (1:1) CipherText
275 ---------------------
277 The first cipherblock is a FEED(2:1) encrypted copy of the initial
278 R and S arrays; this is basically a bunch of random bytes which are
279 used to cook up the giants R and S at both encrypt and decrypt time.
280 In 1:1 FEED ciphertext, this is encrypted with the recipient's public
281 key; the result is padded out to one 1:1 FEED Cipherblock.
283 Subsequent cipherblocks are:
286 --------------- -----------------
293 bit 1 : 's' arg to elliptic_add()