Help creating Tiger hash function in Python

Discussion in 'Python' started by Mark Livingstone, May 7, 2007.

  1. Hello!

    I am a Uni student and for a project in Information Systems Security due
    in just under two weeks, I have tried to make a Python version of the
    Biham / Anderson Tiger Hash function. I have put the original C source
    and my two files Tiger.py and doHash.py on my website:

    http://www.users.on.net/~mlivingstone/

    My problems are doubtless basic since I have been teaching myself
    Python. My best knowledge is Java :-(

    Firstly, in doHash.py, I cannot invoke tiger() without getting unbounded
    errors and / or complaints about no such method.

    The C code is peppered with typedefs for word64 and word 32 and byte and
    I am unsure how to treat these.

    t2, t3, t4 are some sort of index into the S-Box table. How can I
    pythonise them?

    I don't expect you to write my program for me but any help / clues would
    be gratefully received. I have been using the latest Core Python
    Programming 2E by Wesley Chun which has been very helpful but I have
    not found help for these specific areas.

    I have taken out all the Bigendian code, Alpha code and ternary operator
    within ternary operator code but the C is still a bit complex for me.

    Many thanks in advance for your help

    MarkL
    Mark Livingstone, May 7, 2007
    #1
    1. Advertising

  2. > I am a Uni student and for a project in Information Systems Security due
    > in just under two weeks, I have tried to make a Python version of the
    > Biham / Anderson Tiger Hash function. I have put the original C source
    > and my two files Tiger.py and doHash.py on my website:
    >
    > http://www.users.on.net/~mlivingstone/
    >
    > My problems are doubtless basic since I have been teaching myself
    > Python. My best knowledge is Java :-(
    >
    > Firstly, in doHash.py, I cannot invoke tiger() without getting unbounded
    > errors and / or complaints about no such method.


    First of all you should create an instance of you Tiger class, you try
    to do this by line:
    x = Tiger.Tiger

    But this is wrong, because you should call constructor and pass all
    necessary parameters, in very simple case:
    x = Tiger.Tiger() (if there is no constructor parameters)

    --
    Vyacheslav Maslov
    SWsoft, Inc.
    Vyacheslav Maslov, May 7, 2007
    #2
    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. Tino Lange

    Re: Tiger Hash Function in Python

    Tino Lange, Jun 26, 2003, in forum: Python
    Replies:
    0
    Views:
    1,020
    Tino Lange
    Jun 26, 2003
  2. scum
    Replies:
    1
    Views:
    386
  3. rp
    Replies:
    1
    Views:
    516
    red floyd
    Nov 10, 2011
  4. Srijayanth Sridhar
    Replies:
    19
    Views:
    612
    David A. Black
    Jul 2, 2008
  5. Replies:
    14
    Views:
    184
    C.DeRykus
    Dec 22, 2009
Loading...

Share This Page