|
|
| Author |
Message |
< Erlang ~ xtea cryptography using erlang |
| jp |
Posted: Tue Oct 02, 2007 12:37 am |
|
|
|
Joined: 02 Oct 2007
Posts: 1
|
Hello everyone, I have a good background in imperative/procedural and OO programming language but absolutely no experience in functional languages.
For fun, I gave myself the assignement to implement the xtea cipher (http://en.wikipedia.org/wiki/XTEA).
I have identified the functions that I will need in erlang: bsr, bsl, math:pow , etc.
My main problem is that I do not know how to implement it because variables can only be assigned once in erlang.
Is there a way to dynamically generate variables ?
I am looking for basic guidelines/tips as I want to implement it by myself.
Thanks,
jp |
|
|
| Back to top |
|
| francesco |
Posted: Mon Oct 15, 2007 3:34 pm |
|
|
|
User
Joined: 07 Jul 2006
Posts: 249
Location: London
|
Hi JP,
the way to tackle single assignment of variables in Erlang is to use recursion. Whenever you call a function recursively, all variables in the function body are considered "fresh".
Francesco
--
http://www.erlang-consulting.com |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|