Silence more Gcc warnings.

Update testing note.
This commit is contained in:
Moinak Ghosh 2012-12-17 20:23:30 +05:30
parent 25bb54e3bc
commit 00c8c534d0
3 changed files with 33 additions and 29 deletions

10
INSTALL
View file

@ -40,12 +40,16 @@ For every test both compression and decompression are performed
and after every decompression the decompressed file is verified and after every decompression the decompressed file is verified
byte for byte with the original using the diff utility. byte for byte with the original using the diff utility.
It takes a while to run all the tests. It takes a long time to run all the tests. The complete test log
is stored in the file test.log. Test failures are indicated by the
error message starting with the word "FATAL". All other error
messages visible in the log are a result of negative testing where
the utility is expected to exit with an error.
Custom Installation Custom Installation
=================== ===================
The options to the config script are detailed below. Note that this is The options to the config script are detailed below. Note that this
not the usual GNU Autoconf script. is not the usual GNU Autoconf script.
./config [<options>] ./config [<options>]

2
config
View file

@ -62,7 +62,7 @@ int
main(void) main(void)
{ {
long l; long l;
printf("%d\n", sizeof (l)); printf("%lu\n", sizeof (l));
return (0); return (0);
} }
_EOF _EOF

View file

@ -93,7 +93,7 @@ STATUS_CODES
genShortMsg(int hashbitlen) genShortMsg(int hashbitlen)
{ {
char fn[32], line[SUBMITTER_INFO_LEN]; char fn[32], line[SUBMITTER_INFO_LEN];
int msglen, msgbytelen, done; int msglen, msgbytelen, done, rv;
BitSequence Msg[256], MD[64]; BitSequence Msg[256], MD[64];
FILE *fp_in, *fp_out; FILE *fp_in, *fp_out;
@ -109,7 +109,7 @@ genShortMsg(int hashbitlen)
} }
fprintf(fp_out, "# %s\n", fn); fprintf(fp_out, "# %s\n", fn);
if ( FindMarker(fp_in, "# Algorithm Name:") ) { if ( FindMarker(fp_in, "# Algorithm Name:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Algorithm Name:%s\n", line); fprintf(fp_out, "# Algorithm Name:%s\n", line);
} }
else { else {
@ -117,7 +117,7 @@ genShortMsg(int hashbitlen)
return KAT_HEADER_ERROR; return KAT_HEADER_ERROR;
} }
if ( FindMarker(fp_in, "# Principal Submitter:") ) { if ( FindMarker(fp_in, "# Principal Submitter:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Principal Submitter:%s\n", line); fprintf(fp_out, "# Principal Submitter:%s\n", line);
} }
else { else {
@ -128,7 +128,7 @@ genShortMsg(int hashbitlen)
done = 0; done = 0;
do { do {
if ( FindMarker(fp_in, "Len = ") ) if ( FindMarker(fp_in, "Len = ") )
fscanf(fp_in, "%d", &msglen); rv = fscanf(fp_in, "%d", &msglen);
else { else {
done = 1; done = 1;
break; break;
@ -157,7 +157,7 @@ STATUS_CODES
genShortMsgSponge(unsigned int rate, unsigned int capacity, int outputLength, const char *fileName) genShortMsgSponge(unsigned int rate, unsigned int capacity, int outputLength, const char *fileName)
{ {
char line[SUBMITTER_INFO_LEN]; char line[SUBMITTER_INFO_LEN];
int msglen, msgbytelen, done; int msglen, msgbytelen, done, rv;
BitSequence Msg[256]; BitSequence Msg[256];
BitSequence Squeezed[SqueezingOutputLength/8]; BitSequence Squeezed[SqueezingOutputLength/8];
spongeState state; spongeState state;
@ -179,7 +179,7 @@ genShortMsgSponge(unsigned int rate, unsigned int capacity, int outputLength, co
} }
fprintf(fp_out, "# %s\n", fileName); fprintf(fp_out, "# %s\n", fileName);
if ( FindMarker(fp_in, "# Algorithm Name:") ) { if ( FindMarker(fp_in, "# Algorithm Name:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Algorithm Name:%s\n", line); fprintf(fp_out, "# Algorithm Name:%s\n", line);
} }
else { else {
@ -187,7 +187,7 @@ genShortMsgSponge(unsigned int rate, unsigned int capacity, int outputLength, co
return KAT_HEADER_ERROR; return KAT_HEADER_ERROR;
} }
if ( FindMarker(fp_in, "# Principal Submitter:") ) { if ( FindMarker(fp_in, "# Principal Submitter:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Principal Submitter:%s\n", line); fprintf(fp_out, "# Principal Submitter:%s\n", line);
} }
else { else {
@ -198,7 +198,7 @@ genShortMsgSponge(unsigned int rate, unsigned int capacity, int outputLength, co
done = 0; done = 0;
do { do {
if ( FindMarker(fp_in, "Len = ") ) if ( FindMarker(fp_in, "Len = ") )
fscanf(fp_in, "%d", &msglen); rv = fscanf(fp_in, "%d", &msglen);
else { else {
done = 1; done = 1;
break; break;
@ -232,7 +232,7 @@ STATUS_CODES
genLongMsg(int hashbitlen) genLongMsg(int hashbitlen)
{ {
char fn[32], line[SUBMITTER_INFO_LEN]; char fn[32], line[SUBMITTER_INFO_LEN];
int msglen, msgbytelen, done; int msglen, msgbytelen, done, rv;
BitSequence Msg[4288], MD[64]; BitSequence Msg[4288], MD[64];
#ifdef AllowExtendedFunctions #ifdef AllowExtendedFunctions
BitSequence Squeezed[SqueezingOutputLength/8]; BitSequence Squeezed[SqueezingOutputLength/8];
@ -252,7 +252,7 @@ genLongMsg(int hashbitlen)
} }
fprintf(fp_out, "# %s\n", fn); fprintf(fp_out, "# %s\n", fn);
if ( FindMarker(fp_in, "# Algorithm Name:") ) { if ( FindMarker(fp_in, "# Algorithm Name:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Algorithm Name:%s\n", line); fprintf(fp_out, "# Algorithm Name:%s\n", line);
} }
else { else {
@ -260,7 +260,7 @@ genLongMsg(int hashbitlen)
return KAT_HEADER_ERROR; return KAT_HEADER_ERROR;
} }
if ( FindMarker(fp_in, "# Principal Submitter:") ) { if ( FindMarker(fp_in, "# Principal Submitter:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Principal Submitter:%s\n\n", line); fprintf(fp_out, "# Principal Submitter:%s\n\n", line);
} }
else { else {
@ -271,7 +271,7 @@ genLongMsg(int hashbitlen)
done = 0; done = 0;
do { do {
if ( FindMarker(fp_in, "Len = ") ) if ( FindMarker(fp_in, "Len = ") )
fscanf(fp_in, "%d", &msglen); rv = fscanf(fp_in, "%d", &msglen);
else else
break; break;
msgbytelen = (msglen+7)/8; msgbytelen = (msglen+7)/8;
@ -319,7 +319,7 @@ genExtremelyLongMsg(int hashbitlen)
#ifdef AllowExtendedFunctions #ifdef AllowExtendedFunctions
BitSequence Squeezed[SqueezingOutputLength/8]; BitSequence Squeezed[SqueezingOutputLength/8];
#endif #endif
int i, repeat; int i, repeat, rv;
FILE *fp_in, *fp_out; FILE *fp_in, *fp_out;
hashState state; hashState state;
HashReturn retval; HashReturn retval;
@ -336,7 +336,7 @@ genExtremelyLongMsg(int hashbitlen)
} }
fprintf(fp_out, "# %s\n", fn); fprintf(fp_out, "# %s\n", fn);
if ( FindMarker(fp_in, "# Algorithm Name:") ) { if ( FindMarker(fp_in, "# Algorithm Name:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Algorithm Name:%s\n", line); fprintf(fp_out, "# Algorithm Name:%s\n", line);
} }
else { else {
@ -344,7 +344,7 @@ genExtremelyLongMsg(int hashbitlen)
return KAT_HEADER_ERROR; return KAT_HEADER_ERROR;
} }
if ( FindMarker(fp_in, "# Principal Submitter:") ) { if ( FindMarker(fp_in, "# Principal Submitter:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Principal Submitter:%s\n\n", line); fprintf(fp_out, "# Principal Submitter:%s\n\n", line);
} }
else { else {
@ -353,14 +353,14 @@ genExtremelyLongMsg(int hashbitlen)
} }
if ( FindMarker(fp_in, "Repeat = ") ) if ( FindMarker(fp_in, "Repeat = ") )
fscanf(fp_in, "%d", &repeat); rv = fscanf(fp_in, "%d", &repeat);
else { else {
printf("ERROR: unable to read 'Repeat' from <ExtremelyLongMsgKAT.txt>\n"); printf("ERROR: unable to read 'Repeat' from <ExtremelyLongMsgKAT.txt>\n");
return KAT_DATA_ERROR; return KAT_DATA_ERROR;
} }
if ( FindMarker(fp_in, "Text = ") ) if ( FindMarker(fp_in, "Text = ") )
fscanf(fp_in, "%s", Text); rv = fscanf(fp_in, "%s", Text);
else { else {
printf("ERROR: unable to read 'Text' from <ExtremelyLongMsgKAT.txt>\n"); printf("ERROR: unable to read 'Text' from <ExtremelyLongMsgKAT.txt>\n");
return KAT_DATA_ERROR; return KAT_DATA_ERROR;
@ -408,7 +408,7 @@ genMonteCarlo(int hashbitlen)
{ {
char fn[32], line[SUBMITTER_INFO_LEN]; char fn[32], line[SUBMITTER_INFO_LEN];
BitSequence Seed[128], Msg[128], MD[64], Temp[128]; BitSequence Seed[128], Msg[128], MD[64], Temp[128];
int i, j, bytelen; int i, j, bytelen, rv;
FILE *fp_in, *fp_out; FILE *fp_in, *fp_out;
if ( (fp_in = fopen("MonteCarlo.txt", "r")) == NULL ) { if ( (fp_in = fopen("MonteCarlo.txt", "r")) == NULL ) {
@ -423,7 +423,7 @@ genMonteCarlo(int hashbitlen)
} }
fprintf(fp_out, "# %s\n", fn); fprintf(fp_out, "# %s\n", fn);
if ( FindMarker(fp_in, "# Algorithm Name:") ) { if ( FindMarker(fp_in, "# Algorithm Name:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Algorithm Name:%s\n", line); fprintf(fp_out, "# Algorithm Name:%s\n", line);
} }
else { else {
@ -431,7 +431,7 @@ genMonteCarlo(int hashbitlen)
return KAT_HEADER_ERROR; return KAT_HEADER_ERROR;
} }
if ( FindMarker(fp_in, "# Principal Submitter:") ) { if ( FindMarker(fp_in, "# Principal Submitter:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Principal Submitter:%s\n\n", line); fprintf(fp_out, "# Principal Submitter:%s\n\n", line);
} }
else { else {
@ -471,7 +471,7 @@ genMonteCarloSqueezing(int hashbitlen)
{ {
char fn[32], line[SUBMITTER_INFO_LEN]; char fn[32], line[SUBMITTER_INFO_LEN];
BitSequence Seed[128], MD[64]; BitSequence Seed[128], MD[64];
int i, j, bytelen; int i, j, bytelen, rv;
FILE *fp_in, *fp_out; FILE *fp_in, *fp_out;
hashState state; hashState state;
HashReturn retval; HashReturn retval;
@ -488,7 +488,7 @@ genMonteCarloSqueezing(int hashbitlen)
} }
fprintf(fp_out, "# %s\n", fn); fprintf(fp_out, "# %s\n", fn);
if ( FindMarker(fp_in, "# Algorithm Name:") ) { if ( FindMarker(fp_in, "# Algorithm Name:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Algorithm Name:%s\n", line); fprintf(fp_out, "# Algorithm Name:%s\n", line);
} }
else { else {
@ -496,7 +496,7 @@ genMonteCarloSqueezing(int hashbitlen)
return KAT_HEADER_ERROR; return KAT_HEADER_ERROR;
} }
if ( FindMarker(fp_in, "# Principal Submitter:") ) { if ( FindMarker(fp_in, "# Principal Submitter:") ) {
fscanf(fp_in, "%[^\n]\n", line); rv = fscanf(fp_in, "%[^\n]\n", line);
fprintf(fp_out, "# Principal Submitter:%s\n\n", line); fprintf(fp_out, "# Principal Submitter:%s\n\n", line);
} }
else { else {
@ -545,7 +545,7 @@ genMonteCarloSqueezing(int hashbitlen)
STATUS_CODES STATUS_CODES
genDuplexKAT(unsigned int rate, unsigned int capacity, const char *fileName) genDuplexKAT(unsigned int rate, unsigned int capacity, const char *fileName)
{ {
int inLen, inByteLen, outLen, outByteLen, done; int inLen, inByteLen, outLen, outByteLen, done, rv;
BitSequence in[256]; BitSequence in[256];
BitSequence out[256]; BitSequence out[256];
FILE *fp_in, *fp_out; FILE *fp_in, *fp_out;
@ -569,7 +569,7 @@ genDuplexKAT(unsigned int rate, unsigned int capacity, const char *fileName)
outByteLen = (outLen+7)/8; outByteLen = (outLen+7)/8;
do { do {
if ( FindMarker(fp_in, "InLen = ") ) if ( FindMarker(fp_in, "InLen = ") )
fscanf(fp_in, "%d", &inLen); rv = fscanf(fp_in, "%d", &inLen);
else { else {
done = 1; done = 1;
break; break;