<br><br><div class="gmail_quote">On Sat, Nov 17, 2012 at 6:02 PM, Steve Davis <span dir="ltr"><<a href="mailto:steven.charles.davis@gmail.com" target="_blank">steven.charles.davis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am intrigued by what is arguably a pointless problem.<br></blockquote><div><br></div><div>Not really</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Looking at the tiny encryption algorithm aka XXTEA it seemed easy enough to implement in Erlang. I have an implementation (attached with source and all references inside the module) which encodes and decodes successfully... BUT the cipher text doesn't match the test vectors...<br>
</blockquote><div><br></div><div>I had exactly the same problem with tea a few years ago ...</div><div><br></div><div>I'd really like to see:</div><div><br></div><div>a) an algebraic spec</div><div>b) reference implementations in more than one language that I can reproduce</div>
<div><br></div><div>I'm more interested in inter-operability than performance - (think client in Javascript</div><div>backend in C / Erlang) - so compliance with the spec is more important than performance.</div><div>
(which is why I like RSA implemented in erlang bignums - no chance of backdoors in the code)</div><div><br></div><div>  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
What makes this pointless is that I should "just make it a NIF" etc. But it's likely that I am misunderstanding some aspect of either Erlang or C, however I am confounded as to what that problem is... why does the attached implementation not generate the same ciphertext as in the test vectors from the C implementation? Can anyone spot my error?<br>

<br></blockquote><div><br></div><div>Before you ask this you might ask "can the test vectors be reproduced in any other</div><div>language/implementation than the reference implementation?"</div><div><br></div>
<div>Cheers</div><div><br></div><div>/Joe</div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks,<br>
/s<br>
<br>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br>