Help creating Tiger hash function in Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Livingstone

    #1

    Help creating Tiger hash function in Python

    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:



    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

  • Vyacheslav Maslov

    #2
    Re: Help creating Tiger hash function in Python

    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:
    >

    >
    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.

    Comment

    Working...