There is an error which occurs when viewing or printing page 10 of this file. After this error occurs, page 10 appears blank when viewed or printed. The error is corrected in the corresponding file found here. The corrected file is also included in the ZIP file for RC6, and on CD-2.
In each of these directories, we accidentally omitted a header file, hpc.h. A printout of this short file (2 pages) is being provided with all copies of CD-2.
Crypton uses additional data storage for the Intermediate Values (IV) test. This and other additional code for IV's gets include during compilation when CheckInterValue is defined in crypton.h. Be sure that this is undefined during normal operation.
DEAL uses additional data storage for the key schedule. This storage space must be allocated and assigned for proper execution. Storage space for the key schedule is allocated with a statement similar to the following:
| UNIT precomp[MAX_KSS]; |
| key.kss = precomp; |
The Initialization Vector to cipherInit() must have storage space defined. You cannot pass a NULL pointer to cipherInit(). The inputLen parameter to blockEncrypt() and blockDecrypt() refer to the number of bytes to be processed not the number of bits. The functions do however return the number of bits processed.
blockEncrypt() and blockDecrypt() only handle 128 bits at a time (inputlen=128). Additionally, blockEncrypt() and blockDecrypt() return TRUE on success instead of the number of bits ciphered.
Aside from the missing header file (noted in item #1 above), the algorithm code is contained in one file, either hpc-ansi.c or hpc-gcc.c. This makes it difficult to add test code in additional files. Some of the "defines" and structure definitions in the top of the hpc-ansi.c file are needed in the hpc.h file.
In order to make things more simple, we recommend cutting and pasting code from hpc-ansi.c to a file called hpc-defs.h (hpc-defs.h will be a new file). The code that needs to be transfered from hpc-ansi.c to hpc-defs.h is found on lines 89-102 and line 425-530. Once the file hpc-defs.h is created, place a #include statement in hpc-ansi.c at line 89 (#include "hpc-defs.h"). A copy of what hpc-defs.h should look like is also being included with the CD-2 mailing.
blockEncrypt() and blockDecrypt() return TRUE on success instead of the number of bits ciphered.
cipherInit() and makeKey() return 0 on success instead of TRUE.
Rijndael accepts input lengths greater than BLOCK_SIZE (128 bits), but seems to only cipher the first block (128 bits) properly. Additionally, there is an extra parameter, blocklen, to both cipherInit() and makeKey().
blockEncrypt() and blockDecrypt() return TRUE on success instead of the number of bits ciphered.
In the \RefCode\Twofish directory:
Twofish needs several routines that are found in the file tst2fish.c. (tst2fish.c is a standalone program for generating the KAT and MCT data files.) Instead of copying the needed routines from tst2fish.c to twofish.c, simply delete the main program at the bottom of tst2fish.c and link with your main program.
In the \OptCCode\Twofish directory:
Twofish needs the routine called Here() - located in the file tst2fish.c - to be placed in the file twofish2.c. (tst2fish.c is a standalone program for generating the KAT and MCT data files.)
In each of these files, on line 783, "26" should be changed to "16". This should eliminate any errors that might have occurred from faulty memory allocation.
Technical contact: Morris
Dworkin
Administrative/process questions: Elaine
Barker, Bill Burr