checksum correction

Discussion in 'C Programming' started by Imran, Dec 10, 2007.

  1. Imran

    Imran Guest

    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
     
    Imran, Dec 10, 2007
    #1
    1. Advertising

  2. In article <fjjke1$p76$>,
    Imran <> 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
     
    Richard Tobin, Dec 10, 2007
    #2
    1. Advertising

  3. 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$>
     
    Johannes Bauer, Dec 10, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ALuPin
    Replies:
    8
    Views:
    661
    Marcus Harnisch
    Apr 6, 2004
  2. reddy

    CRC Error CORRECTION

    reddy, Apr 21, 2004, in forum: VHDL
    Replies:
    14
    Views:
    12,263
    fauji86
    Mar 3, 2010
  3. Replies:
    4
    Views:
    693
    Uncle Noah
    Mar 22, 2006
  4. Reto Caviezel

    Re: Apply this correction package

    Reto Caviezel, Sep 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    362
    Reto Caviezel
    Sep 24, 2003
  5. John Jimenez
    Replies:
    0
    Views:
    343
    John Jimenez
    Apr 30, 2004
Loading...

Share This Page