Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > checksum correction

Reply
Thread Tools

checksum correction

 
 
Imran
Guest
Posts: n/a
 
      12-10-2007

Hello all

I am trying to calculate a checksum correction for 16 byte checksum
calculation.

I have 1 lines of data

xxxxxxxxyyyyyyyy80804C0400004204UUUUUUUU

What I am trying to achive is to find a right UUUUUUUU
value so that when I reclaculate the checksum of whole
line, it should be yyyyyyyy.

My tried / failed algoritham is as follows

int final_cks(UUUUUUUU) = xxxxxxxx + 8080+4C04+0000+4204 - yyyyyyyy

i will patch this final_cks to UUUUUUUU, then i re-calculate the checksum
again,

int final_cks= xxxxxxxx + 8080+4C04+0000+4204 +UUUU+UUUU

it should be equal to yyyyyyyy


Any sugg?

Thank you


 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      12-10-2007
In article <fjjke1$p76$(E-Mail Removed)>,
Imran <(E-Mail Removed)> wrote:

> I am trying to calculate a checksum correction for 16 byte checksum
>calculation.
>
> I have 1 lines of data
>
> xxxxxxxxyyyyyyyy80804C0400004204UUUUUUUU
>
> What I am trying to achive is to find a right UUUUUUUU
> value so that when I reclaculate the checksum of whole
> line, it should be yyyyyyyy.


You don't say what the checksum algorithm is. Many checksums are
deliberately designed to make it it hard to do what you want.

> My tried / failed algoritham is as follows
>
> int final_cks(UUUUUUUU) = xxxxxxxx + 8080+4C04+0000+4204 - yyyyyyyy


If your checksum algorithm involves adding up 16-bit quantities like
8080 and 4C04, then it probably doesn't produce 32-bit values like
UUUUUUUU.

-- Richard
--
:wq
 
Reply With Quote
 
 
 
 
Johannes Bauer
Guest
Posts: n/a
 
      12-10-2007
Imran schrieb:

> i will patch this final_cks to UUUUUUUU, then i re-calculate the checksum
> again,
>
> int final_cks= xxxxxxxx + 8080+4C04+0000+4204 +UUUU+UUUU
>
> it should be equal to yyyyyyyy


UUUUUUUU needs to be 42.

Seriously, nobody will be able to help you without telling which
algorithm you use. There is no such thing as "the" 16-bit checksum
function. But anyways, it doesn't have anything to do with C.

Greetings,
Johannes

--
"Viele der Theorien der Mathematiker sind falsch und klar
Gotteslästerlich. Ich vermute, dass diese falschen Theorien genau
deshalb so geliebt werden." -- Prophet und Visionär Hans Joss aka
HJP in de.sci.mathematik <4740ad67$0$3811$(E-Mail Removed)>
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: new IOS invalid checksum (broken flashcard?) gglggl Cisco 0 12-23-2004 03:21 AM
PIMSM:Which Cisco IOS sends PIM register messages with checksum ONLY over the PIM header? Farida Cisco 0 10-26-2004 02:12 PM
vhdl code for crc32 checksum anupam VHDL 4 09-06-2004 09:05 PM
PIX VPN and DNS Problem with udp checksum errors Oliver Rahn Cisco 0 08-30-2004 11:28 AM
checksum errors with my 2611 Sameer Cisco 2 01-27-2004 12:37 AM



Advertisments