My problem is very similar to this problem. I am working on the new authentication for the yahoo Perl module, but I'm stuck on a part that requires the sha module to do some weird things:
the C code:
shaUpdate(&ctx1, crypt_hash_xor1, 64); /* Start of additions */ if(j>=3) ctx1.sizeLo = 0x1ff; /* End of additions */ shaUpdate(&ctx1, magic_key_char, 4); shaFinal(&ctx1, digest1);
My problem is the same as the other post in java. I don't see it possible with the current Digest::SHA module to change the sizeLo before I make the digest. My first part of the question is it possible with and current modules?

I am assuming its not..so i decided to port over from the c code and from a python class, both unsuccessful.

c code:
http://www.openaether.org/jabberd2/source/util/sha1.c

my try:
http://www.msndev.com/source/sha/sha1-2.pm

python code:
http://www.msndev.com/source/sha/shatest.py

my try:
http://www.msndev.com/source/sha/SHA.pm

The c conversion gives me a bit shift error, and the python convert...is just wrong?

Thanks in advance Great Ones!

In reply to SHA-1 problem by mattaustin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.