Talk:Tiny Encryption Algorithm

message: TEA, XTEA, and XXTEA appear to be sensitive to endianness. They take blocks of (presumably 32-bit) longs; however, most messages in practice are defined as a stream of bytes, not longs. Have the authors specified an ordering for bytes within 32-bit units, or have they left it unspecified on purpose? And what happens to the reference code on a platform where longs are 64-bit? --Damian Yerrick (talk | stalk) 01:15, 6 July 2007 (UTC)
replies: text: This is indeed something that the article should answer; I've been wondering the same. -- intgr [talk] 14:56, 21 October 2007 (UTC)
thread_title:  Endianness? 

message: What does "completely in the public domain" mean? What is difference between AES and TEA in this matter? --89.172.45.103 12:35, 21 October 2007 (UTC)
replies: text: There is no difference; there are various implementations of AES in the public domain and neither are subject to patents. In fact, nearly all popular ciphers are unencumbered these days. This looks like a silly attempt to promote TEA; I have toned down this statement. -- intgr [talk] 14:55, 21 October 2007 (UTC)
thread_title:  Completely public domain 

message: I had to implement TEA a while ago and remember that the reference code (as provided here) was broken. :( Further poking around lead me to this page ( http://www.thescripts.com/forum/thread215505.html ) which says:
:"Okay, Ben, I've done my homework now, and I can safely say that
:you've been misled by sloppy academic types. :-) The original paper
:on TEA, by Wheeler & Needham, is WRONG WRONG WRONG with respect to
:the reference implementation they provide. They left out several
:crucial pairs of parentheses, and both you and I were confused by
:that. Rightly so."
My (tested, working version) has the following for encoding and decoding respectively (with extra parentheses for fixed operator precedence):
encode:
for (int i=0; i<kNumRounds; ++i)
{
	s += kDelta;
	y += (z << 4) + (k0 ^ z) + (s ^ (z >> 5)) + k1;
	z += (y << 4) + (k2 ^ y) + (s ^ (y >> 5)) + k3;
}
decode:
for (int i=0; i<kNumRounds; ++i)
{
	z -= (y << 4) + (k2 ^ y) + (s ^ (y >> 5)) + k3;
	y -= (z << 4) + (k0 ^ z) + (s ^ (z >> 5)) + k1;
		s -= kDelta;
}
However I have no test data to confirm that this is actually TEA, rather than just something similar to it (the reference code doesn't even encrypt and decrypt to the same result). It looks like someone has already fixed up the XTEA page since theres a comment about "It is also important to note that some modern programming languages have a slightly different operators order of precedence. Therefore, the interpretation of the original code will lead to different results, making different implementations of the encryption incompatible. This can be corrected with the use of a few parenthesis to enforce precedence order."
Can someone confirm my results before changing the code in the article? 217.18.21.2 14:22, 12 November 2007 (UTC)
replies: text: I believe your implementation is incorrect. TEA Paper has the code with parenthesis and shows the XORs outside of the additions. Linux kernel code shows the same. The figure for this article and the figure shown in Thesis on TEA both show the XOR as being outside of the additions. (The code in that last reference lacks parenthesis, though.) Astgtciv (talk) 13:58, 20 November 2009 (UTC)
thread_title:  Broken Reference Code 

message: Despite being useful to any people out there who wish to write implementations of TEA, the C code currently given on the page represents original research and cannot be cited or attested to.  The page already links to a reference implementation of the algorithm.  Therefore, I recommend the removal of the example implementation. —Preceding unsigned comment added by Waves00 (talk • contribs) 18:39, 8 September 2009 (UTC)
replies: text: We can only point it out if we can attribute it to a reliable source. -- intgr [talk] 14:41, 31 October 2009 (UTC)
thread_title:  Not encyclopaedic content 

message: The "Versions" section implies that XTEA and Block TEA are the same thing.
The XTEA article (main section, third paragraph) implies that they are
related, but not identical.
Could someone who knows the difference please resolve the conflict?
24.89.3.219 (talk) 17:58, 28 October 2015 (UTC)
thread_title:  Block TEA