Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Crypto_light by
Diff: hash/MD2.cpp
- Revision:
- 13:ac8e23b98dae
- Parent:
- 10:bc9c23aa3870
--- a/hash/MD2.cpp Tue Apr 08 19:39:25 2014 +0000
+++ b/hash/MD2.cpp Sun May 11 11:14:51 2014 +0000
@@ -55,7 +55,7 @@
bufferLength = length;
memcpy(buffer, data, length);
}
- else if(length < 16-bufferLength)
+ else if((int)length < 16-bufferLength)
{
memcpy(&buffer[bufferLength], data, length);
bufferLength += length;
@@ -123,11 +123,16 @@
memcpy(hash, x, 16);
}
-__forceinline void MD2::computeBlock(uint8_t *checksum2, uint8_t *x2, uint8_t *l2, uint8_t *buffer2)
+#ifdef __CC_ARM
+__forceinline
+#endif
+void MD2::computeBlock(uint8_t *checksum2, uint8_t *x2, uint8_t *l2, uint8_t *buffer2)
{
if(checksum2 != buffer2)
{
- #pragma unroll_completely
+ #ifdef __CC_ARM
+ #pragma unroll_completely
+ #endif
for(int j = 0; j < 16; ++j)
{
uint8_t c = buffer2[j];
@@ -146,7 +151,9 @@
x3[8+j] = x3[4+j] ^ x3[j];
uint8_t t = 0;
- #pragma unroll_completely
+ #ifdef __CC_ARM
+ #pragma unroll_completely
+ #endif
for(int j = 0; j < 18; ++j)
{
t = (x2[0] ^= s[t]);
