Skip to content

Latest commit

 

History

History
24 lines (21 loc) · 1.48 KB

README.md

File metadata and controls

24 lines (21 loc) · 1.48 KB

PES-Assignment-5

CODE OPTIMIZATION

The summary of the changes performed are:

  1. The data copy is performed using for loop and to optimize this memcopy and memset function was used.
  2. To load and store 32bit integers from/to 8bit integers built-in swap functions were used. The swap operation can be seen in the functions ISHAResult() and F().
  3. Loop unrolling is performed which reduces the time. This can be observed in F() function.
  4. Assembly code usage will help optimize the code. The assembly code was written for the function ISHAProcessMessageBlock().
  5. Unnecessary code which would not run was removed.
  6. Length High was removed and only length low was used for buffer calculation and corrupted check is removed. This can be observed in ISHAResult and ISHAinput respectively.
  7. The ISHAReset and ISHAInput functions required to be calculated once for inner padding and outer padding.Hence static structures were used for optimization.

Results:
Before Optimisation code size - 21056 bytes
Before Optimisation run time - 8744ms
After Optimisation code Size - 19468 bytes
After Opitimised run time - 1393ms

Debug Mode: In debug code under optimisation code size is 20776 and run time is 1396 milliseconds
Release Mode:
In release mode under optimisation code size is 19468 and run time is 1393 milliseconds
Extra Credit:

  1. Optimized the code size with assembly which reduced the time to 1393 ms