freemyipod r880 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r879‎ | r880 | r881 >
Date:14:11, 1 August 2013
Author:theseven
Status:new
Tags:
Comment:
emCORE installer for iPod Classic: Optimize SHA1 code a bit
Modified paths:
  • /apps/installer-ipodclassic/main.c (modified) (history)

Diff [purge]

Index: apps/installer-ipodclassic/main.c
@@ -94,13 +94,12 @@
9595 }
9696 for (i = 0; i < 16; i++) SHA1DATAIN[i] = tmp32[i];
9797 }
98 - else for (i = 0; i < 16; i++) SHA1DATAIN[i] = databuf[i];
99 - databuf += 16;
 98+ else for (i = 0; i < 16; i++) SHA1DATAIN[i] = *databuf++;
10099 SHA1CONFIG |= 2;
101100 while (SHA1CONFIG & 1) sleep(0);
102101 SHA1CONFIG |= 8;
103102 }
104 - for (i = 0; i < 5; i++) hashbuf[i] = SHA1RESULT[i];
 103+ for (i = 0; i < 5; i++) *hashbuf++ = SHA1RESULT[i];
105104 clockgate_enable(0, false);
106105 }
107106