1                     Apple FEE Library Source, v. 1.0
 
   2                         Last Update: 26 Sep 2001
 
   5    NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT
 
   6    TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE
 
   7    SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE COMPUTER, INC. AND THE
 
   8    ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE COMPUTER,
 
   9    INC.  ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
 
  10    EXPOSE YOU TO LIABILITY.
 
  13 This directory contains the source code for Apple's Fast Elliptic
 
  14 Encryption (FEE) library. All code is written in ANSI C. A UNIX
 
  17 Note that all source files in this directory are best viewed with an
 
  18 editor configured for 8-space tabs, a fixed pitch font, and a window
 
  19 of at least 80 characters in width.
 
  25 These files contain the public API used by clients of the FEE library.
 
  29       A top-level header which includes all of the other public headers.
 
  30       Typically a client application will only include this file.
 
  34       Common #defines and typedefs used throughout the library.
 
  38       Functions for generating and manipulating FEE public and private keys,
 
  39       performing key exchange, and high-level digital signature operations.
 
  43       Low-level primitives for performing ElGamal digital signature
 
  44       operations. Not normally used by clients; high-level functions
 
  45       for performing signature operations are provided in feePublicKey.h.
 
  49       Low-level primitives for performing ECDSA digital signature operations.
 
  50       Not normally used by clients; high-level functions for performing
 
  51       signature operations are provided in feePublicKey.h.
 
  55       DES symmetric encryption and decryption functions.
 
  67       Pseudo-random number generator.
 
  71       General-purpose C functions.
 
  75       Asymmetric encryption functions using the FEE Direct Embedding,
 
  80       Asymmetric encryption functions using the Expanding FEED algorithm.
 
  84       Functions for performing encoding and decoding via base-64 IA5
 
  90       High-level CipherFile support. Provides encapsulation of ciphertext,
 
  91       digital signature, and public key strings in a portable format.
 
  95       Memory alloc/free routines. All memory mallocd by CryptKit and
 
  96       returned to called must be freed via ffree(), declared here.
 
 102 In addition to the '.c' files associated with the abovementioned public
 
 103 headers (e.g., feePublicKey.c, feeCipherFile.c), the FEE library
 
 104 contains the following source files:
 
 108       Large-precision integer arithmetic package.
 
 112       Elliptic Curve algebra, Apple "FEE" style.
 
 116       Elliptic Curve Algebra using projective coordinates.
 
 118    curveParams.[ch], curveParamData.h
 
 119    ----------------------------------
 
 120       Elliptic curve parameters. Declarations of known curves.
 
 124       Platform-independent implement implementation of portable
 
 125       representation of all aggregate data types used in FEE library.
 
 129       Miscellaneous C utilities.
 
 141       Low-level primitives for DES, MD5, SHA-1 algorithms.
 
 144 Porting to other platforms
 
 145 --------------------------
 
 147 The FEE library has been built and tested on the Macintosh platform using Metrowerks CodeWarrior, on the OpenStep OS on both the 68k and Pentium platforms, and on Windows NT (on which it was built using the Gnu gcc compiler).
 
 149 There are at least 3 files which need to be edited in order to port the
 
 150 FEE library to other platforms. One is platform.c. This file has two
 
 151 platform-specific functions:
 
 153    void NSGiantRaise(const char *reason);
 
 155       This function is called interally in the library in the unlikely
 
 156       event of a fatal runtime error. The current versions of this
 
 157       function use printf() to log the reason and call exit(1).
 
 159    unsigned createRandomSeed();
 
 161       This function obtains a 32-bit number with which FEE's
 
 162       pseudo-random number generator is seeded. The implementation
 
 163       of this function is highly platform-specific and also depends
 
 164       on the amount of security required from the RNG in a
 
 165       particular application. Common (and simple) implementations
 
 166       involve obtaining a high-precision system clock, process
 
 169       Note that this function is called during a call to feeRandAlloc()
 
 170       in feeRandom.c. Clients of the FEE library can also avoid this
 
 171       mechanism by instantiating the RNG via feeRandAllocWithSeed(),
 
 172       passing in an application-specific seed.
 
 174 The file platform.h contains a definition for the endianness of the
 
 175 current platform. Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must
 
 176 be #defined at compile time. If your compiler does not implicitly
 
 177 define one of these symbols, edit platform.h appropriately.
 
 179 Another file which may be modified during a port is falloc.c. All
 
 180 memory allocation calls in the library are performed via fmalloc() and
 
 181 ffree() in falloc.c. The current implementation of falloc.c merely
 
 182 passes these calls on to the standard malloc() and free(). A port to
 
 183 another platform may require the use of different memory allocators.
 
 185 The giantIntegers module, which implements large integer arithmetic,
 
 186 allows for specification of platform-dependent digit size. In addition,
 
 187 provisions are made for implementation of platform-dependent routines
 
 188 to perform low-level digit arithmetic (single and double precision add,
 
 189 subtract with carry, double precision multiply, multiply an array
 
 190 of digits by another digit). The current library contains assembly
 
 191 languange macros for the Intel and PPC platforms. The specification of
 
 192 the size of a giant digit, type giantDigit, is found in giantIntegers.h.
 
 193 The files which use low-level platform-dependent giant arithmentic
 
 194 include giantPortCommon.h, which select one of several possible header
 
 195 files. The header giantPortGeneric.h can be specified; this has
 
 196 no assembly language, but implements the necessary functions using
 
 197 the C "unsigned long long" type and static lines functions. The API for
 
 198 the low-level digit functions is the same in all three of the following
 
 205 Currently, the implementation of the PPC-specific giant digit routines
 
 206 is in giantPort_PPC.c; the implementation of the Intels-specific giant
 
 207 routines is found in both giantPort_i486.h and giantPort_i486.s.
 
 212 This directory contains a UNIX Makefile. Just type 'make' in the current
 
 213 (writable) directory to build the library. The result is libFEE.a.
 
 216    Copyright (c) 1998 Apple Inc.  All rights reserved.
 
 218 Apple and Macintosh are trademarks of Apple Computer, Inc., registered
 
 219 in the U.S.A. and other countries.  OpenStep is a trademark of NeXT
 
 220 Software, Inc. registered in the U.S.A. and other countries.  All other
 
 221 trademarks are the property of their respective owners.