??? 06/04/05 09:45 Read: times |
#94346 - platform-dependent Responding to: ???'s previous message |
Juan Carlos said:
Hi, I need to use the TEA Encryption method with uvision 3. The program works fine with other PC compilers, meaning that it enciphers and deciphers properly. I tried it with uvision 3, but it does not give the right result. So, you're saying that whether it works or not is platform-dependent - therefore, you need to inspect the code for platform-dependencies Dan Henry said:
TEA is sensitive to big-endian/little-endian differences. Take care of all endian-related issues. The PC and its compilers are little-endian. Keil's C51 toolchain is big-endian. I don't know specifically about TEA, but "Endian-ness" is a prime suspect in any platform-dependence issue. This will affect things like using unions and casting pointers to access individual bytes of larger objects. Other general things to consider are: To avoid such problems, never use the "raw" 'C' data types - always make your own typedefs to give you a known size & signedness; eg, U8, U16, S32. Keil C51 doesn't do this. Specifically for Keil C51, remember that "normal" 'C' functions are inherently reentrant, but C51 functions are not! Of course, you could also have plain simple bugs - your code only works on a PC by pure luck! |
Topic | Author | Date |
TEA | 01/01/70 00:00 | |
Endianess | 01/01/70 00:00 | |
Any recommendations? | 01/01/70 00:00 | |
Assess your requirements | 01/01/70 00:00 | |
Test vectors | 01/01/70 00:00 | |
platform-dependent | 01/01/70 00:00 | |
Why TEA? | 01/01/70 00:00 | |
Did you Mean DES | 01/01/70 00:00 | |
Yes, DES | 01/01/70 00:00 | |
Here it is | 01/01/70 00:00 | |
It would be better | 01/01/70 00:00 | |
Go here! | 01/01/70 00:00 | |
And what is your result? | 01/01/70 00:00 | |
Not right? | 01/01/70 00:00 | |
I expected that... | 01/01/70 00:00 | |
Here are the results I am gettng | 01/01/70 00:00 | |
Michael is right: | 01/01/70 00:00 | |
MS Visual C. | 01/01/70 00:00 | |
Recipe for success | 01/01/70 00:00 | |
problem with "standard implementation".. | 01/01/70 00:00 | |
Example for the user | 01/01/70 00:00 | |
like this? | 01/01/70 00:00 | |
What else? | 01/01/70 00:00 | |
??? | 01/01/70 00:00 | |
I noticed that![]() | 01/01/70 00:00 | |
Statics init to zero | 01/01/70 00:00 | |
Code Problems | 01/01/70 00:00 | |
Didn't search first? | 01/01/70 00:00 | |
It's easy? | 01/01/70 00:00 | |
Useful fast shift and roll functions | 01/01/70 00:00 |