Author: Duncan S. Wong e-mail: swong@ccs.neu.edu Manual written by: Hector Ho Fuentes. e-mail: hhofuent@ccs.neu.edu Modified by: Duncan S. Wong (Oct 11, 2001) - to cope with new formats of version 1.0 functions Date of RijndaelGladmanLib.prc: Aug 4, 2001 Version: 1.0 If you have any suggestions please write to the authors. Description: RijndaelGladmanLib is a port of Brian Gladman's Rijndael (AES) implementation to a Palm OS system library. The program itself takes 28KB of memory. It will also creates a chunk of 8KB to store several tables for speeding up the encryption and decryption processes. The current version is more than ten times faster than the one we posted here previously (version 0.1 in April 2001). To use this Palm Library, you need to: 1. Download the RijndaelGladmanLib.prc 2. Download the RijndaelGladmanLib.h 3. Download the rijndael_gladman.h 4. Only include the RijndaelGladmanLib.h in your file. How to use the library: 1. In your C program, first you need to open the Library. The sample code is as follows: err = SysLibFind("RijndaelGladmanLib", &RijndaelGladmanLibRefNum); if (err) err = SysLibLoad('libr', 'DWRG', &RijndaelGladmanLibRefNum); ErrFatalDisplayIf(err, "Cannot load RijndaelGladman Library"); err = RijndaelGladmanLibOpen(RijndaelGladmanLibRefNum); where RijndaelGladmanLibRefNum is a static UInt16, used to store where is the RijndaelGladmanLibrary. We sugest that you put this code in your StartApplication() function, or in the function you use to initialize your application. 2. Then we only need to declare a variable for the context of the library parameters before using the three main functions. Here below is an example: RijndaelGladmanCTX ctx; Int16 keyLen = 128; Char *k=NULL; UInt8 *m=NULL, *c=NULL; int i; StrPrintF(k,"000102030405060708090A0B0C0D0E0F"); for(i=0; i<16; i++) m[i] = i; RijndaelGladmanLibMakeKey(RijndaelGladmanLibRefNum, &ctx, MODE_ECB, enc, keyLen, k, iv); RijndaelGladmanLibEncrypt(RijndaelGladmanLibRefNum, &ctx, m, 16, c); 3. Finally, close the library when you finished. error = RijndaelGladmanLibClose(RijndaelGladmanLibRefNum, &numapps); // check for erros in the Close() routine if (numapps == 0) SysLibRemove(RijndaelGladmanLibRefNum); We suggest you include this code in the StopApplication() function or your function used to handle the case of closing the application. Disclaimer THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.