By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,907 Members | 1,932 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,907 IT Pros & Developers. It's quick & easy.

Help creating Tiger hash function in Python

P: n/a
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

May 7 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
May 7 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.