GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 16-Jul-2004, 00:03
ise152 ise152 is offline
New Member
 
Join Date: Jul 2004
Posts: 1
ise152 is on a distinguished road
Unhappy

Problem after converting int to char


i converted the following ints into unsigned chars using sprintf as follows:

int x = 1, y = 2, z = 3;
unsigned char partIn[10];
sprint f (partIn, "%d,%d,%d", x,y,z);

once conversion is complete 'partIn' is inserted into the following function:

R_SignUpdate (&context, partIn, partInLen);

This function uses a helper function:

MD5_DigestUpdate(context,partIn,partInLen) to calculate a message digest using the integers specified in partIn as "x, y and z".

There is a second function under the same main argument:

R_VerifyUpdate (&context, partIn, partInLen);

This function also uses the same helper function:

MD5_DigestUpdate(context,partIn,partInLen) to calculate a message digest using the integers specified in partIn as "x, y and z".

THE PROBLEM:
Both functions produce different message digests eventhough i pass on the same 'partIn' with the same converted integers.

Why does it give two totally different values when the same formula is used with the same input arguments???

Please any immediate help would be deeply appreciated. this cde is part of my MSc project and the deadline is getting closer !!

Regards,
ise152
 
 

Recent GIDBlogUS Elections and the ?Voter?s Responsibility? by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Another FX 5600 problem (but with details that might shed light on this) BobDaDuck Computer Hardware Forum 2 16-Apr-2004 08:53
(read/write file) newbie need help plz momotx C Programming Language 6 28-Jan-2004 14:40
convert long to pointer to char realpopeye C++ Forum 2 26-Sep-2003 11:22
char to operator calculus87 C++ Forum 3 04-Sep-2003 11:05

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:50.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.