[msm_shared/crypto]: Fix error in hash calculation
[msm_shared/crypto]: Fix error in hash calculation

For data size which is not a multiple of 4 bytes, we calculated the
hash for the left over bytes by wrong byte order. Now we change the
byte order for leftover bytes and calculate the hash properly.

This is a corner case as we always verified images with size of
multiple of 4 bytes.

Change-Id: Ia463894f46440cd6c5d97c2792baec2fc0287ad1

utilite2/lk,t2m-foxfone/android_kernel_lk,thornbirdblue/codeaurora_lk,CanarySolutions/little-kernel,M1cha/lktris,mozilla-b2g/fairphone2_kernel_lk,CanarySolutions/little-kernel,t2m-foxfone/kernel_lk,jsr-d9/android_kernel_lk,chirayudesai/android_bootable_bootloader_lk,detule/lk-g2-spr,efidroid/lk,MiCode/mi2_lk,detule/lk-g2-spr,DooMLoRD/android_bootable_bootloader_lk,jcsullins/moboot,Foxda-Tech/polaris-bootable-bootloader-lk,pichina/lk,RonGokhale/android_lk_bootloader,M1cha/mi2_lk,t2m-foxfone/android_kernel_lk,mozilla-b2g/fairphone2_kernel_lk,jsr-d10/android_bootable_bootloader_lk,Redmi-dev/android_bootable_lk,jsr-d9/android_kernel_lk,Blefish/android_bootable_bootloader_lk,efidroid/lk,M1cha/mi2_lk,pichina/lk,MiCode/mi2_lk,pichina/lk,mozilla-b2g/kernel_lk,RonGokhale/android_lk_bootloader,chirayudesai/android_bootable_bootloader_lk,chirayudesai/android_bootable_bootloader_lk,jcsullins/moboot,Blefish/android_bootable_bootloader_lk,jcsullins/moboot,xndcn/moboot-for-veer,lg-devs/g2-bootloader,RonGokhale/android_lk_bootloader,oubeichen/lk-v500,MiCode/mi2_lk,jbott/lk_gee,chirayudesai/android_bootable_bootloader_lk,lg-devs/g2-bootloader,beidl/lk_umia,Foxda-Tech/argo8-bootable-bootloader-lk,mozilla-b2g/fairphone2_kernel_lk,hanjae/lumiab0,Blefish/android_bootable_bootloader_lk,zhuotong/mi2_lk_NoEmmc,M1cha/android_bootable_bootloader_lk,DooMLoRD/android_bootable_bootloader_lk,t2m-foxfone/kernel_lk,Blefish/android_bootable_bootloader_lk,my4ndr0id/android_bootable_bootloader_lk,Redmi-dev/android_bootable_lk,M1cha/lktris,lg-devs/g2-bootloader,hanjae/lumiab0,pichina/lk,utilite2/lk,M1cha/mi2_lk,jsr-d9/android_kernel_lk,t2m-foxfone/android_kernel_lk,jbott/lk_gee,zhuotong/mi2_lk_NoEmmc,Foxda-Tech/argo8-bootable-bootloader-lk,Foxda-Tech/argo8-bootable-bootloader-lk,jbott/lk_gee,hanjae/lumiab0,detule/lk-g2-spr,M1cha/android_bootable_bootloader_lk,beidl/lk_umia,zhuotong/mi2_lk_NoEmmc,mozilla-b2g/kernel_lk,thornbirdblue/codeaurora_lk,M1cha/android_bootable_bootloader_lk,oubeichen/lk-v500,xndcn/moboot-for-veer,efidroid/lk,DooMLoRD/android_bootable_bootloader_lk,efidroid/lk,t2m-foxfone/android_kernel_lk,mozilla-b2g/fairphone2_kernel_lk,Foxda-Tech/polaris-bootable-bootloader-lk,Foxda-Tech/argo8-bootable-bootloader-lk,utilite2/lk,hanjae/lumiab0,jsr-d10/android_bootable_bootloader_lk,Redmi-dev/android_bootable_lk,lg-devs/g2-bootloader,idor/dk50-bootable_bootloader_lk,M1cha/lktris,MiCode/mi2_lk,detule/lk-g2-spr,CanarySolutions/little-kernel,xndcn/moboot-for-veer,jbott/lk_gee,lg-devs/g2-bootloader,DooMLoRD/android_bootable_bootloader_lk,my4ndr0id/android_bootable_bootloader_lk,thornbirdblue/codeaurora_lk,Foxda-Tech/polaris-bootable-bootloader-lk,zhuotong/mi2_lk_NoEmmc,thornbirdblue/codeaurora_lk,jsr-d9/android_kernel_lk,idor/dk50-bootable_bootloader_lk,mozilla-b2g/kernel_lk,beidl/lk_umia,M1cha/mi2_lk,Foxda-Tech/polaris-bootable-bootloader-lk,chirayudesai/android_bootable_bootloader_lk,MiCode/mi2_lk,jcsullins/moboot,zhuotong/mi2_lk_NoEmmc,idor/dk50-bootable_bootloader_lk,xndcn/moboot-for-veer,jsr-d10/android_bootable_bootloader_lk,my4ndr0id/android_bootable_bootloader_lk,my4ndr0id/android_bootable_bootloader_lk,M1cha/android_bootable_bootloader_lk,oubeichen/lk-v500,Foxda-Tech/polaris-bootable-bootloader-lk,jcsullins/moboot,t2m-foxfone/android_kernel_lk,M1cha/lktris,beidl/lk_umia,oubeichen/lk-v500,DooMLoRD/android_bootable_bootloader_lk,jsr-d10/android_bootable_bootloader_lk,oubeichen/lk-v500,M1cha/lktris,jsr-d9/android_kernel_lk,Blefish/android_bootable_bootloader_lk,CanarySolutions/little-kernel,Redmi-dev/android_bootable_lk,mozilla-b2g/kernel_lk,RonGokhale/android_lk_bootloader,pichina/lk,utilite2/lk,idor/dk50-bootable_bootloader_lk,hanjae/lumiab0,Redmi-dev/android_bootable_lk,M1cha/android_bootable_bootloader_lk,detule/lk-g2-spr,t2m-foxfone/kernel_lk,M1cha/android_bootable_bootloader_lk,jsr-d10/android_bootable_bootloader_lk,jcsullins/moboot,mozilla-b2g/fairphone2_kernel_lk,t2m-foxfone/kernel_lk,jbott/lk_gee,mozilla-b2g/kernel_lk,xndcn/moboot-for-veer,t2m-foxfone/kernel_lk,M1cha/mi2_lk,efidroid/lk,RonGokhale/android_lk_bootloader,thornbirdblue/codeaurora_lk,beidl/lk_umia,CanarySolutions/little-kernel,my4ndr0id/android_bootable_bootloader_lk,utilite2/lk,idor/dk50-bootable_bootloader_lk,Foxda-Tech/argo8-bootable-bootloader-lk