summaryrefslogtreecommitdiff
path: root/lib/avb/libavb/avb_sha512.c
diff options
context:
space:
mode:
authorfang hui <hui.fang@nxp.com>2017-04-27 14:50:03 +0800
committerfang hui <hui.fang@nxp.com>2017-04-27 15:16:25 +0800
commit71dc860a61a936eca242c2badaad8815b352905b (patch)
tree32469833d886b05dae2ddee032a74bb8d8081a7b /lib/avb/libavb/avb_sha512.c
parent4dc1d71d0da1d07913ef91e60f54338db70caa69 (diff)
downloadu-boot-imx-imx_v2015.04_brillo.zip
u-boot-imx-imx_v2015.04_brillo.tar.gz
u-boot-imx-imx_v2015.04_brillo.tar.bz2
MA-9530-2 [iot] Revet avb in ubootimx_v2015.04_brillo
Revert "libavb: upgrade avb" This reverts commit 94734eeca56e8d1b9f1baedf67e16cd0397fc178. Change-Id: I6eae3fa9579fb43fa6956c450011b230875d0a96
Diffstat (limited to 'lib/avb/libavb/avb_sha512.c')
-rw-r--r--lib/avb/libavb/avb_sha512.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/avb/libavb/avb_sha512.c b/lib/avb/libavb/avb_sha512.c
index 8df6319..f2f0ec4 100644
--- a/lib/avb/libavb/avb_sha512.c
+++ b/lib/avb/libavb/avb_sha512.c
@@ -91,14 +91,10 @@
wv[h] = t1 + t2; \
}
-static const uint64_t sha512_h0[8] = {0x6a09e667f3bcc908ULL,
- 0xbb67ae8584caa73bULL,
- 0x3c6ef372fe94f82bULL,
- 0xa54ff53a5f1d36f1ULL,
- 0x510e527fade682d1ULL,
- 0x9b05688c2b3e6c1fULL,
- 0x1f83d9abfb41bd6bULL,
- 0x5be0cd19137e2179ULL};
+static const uint64_t sha512_h0[8] = {
+ 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL,
+ 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL,
+ 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL};
static const uint64_t sha512_k[80] = {
0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL,
@@ -144,16 +140,14 @@ void avb_sha512_init(AvbSHA512Ctx* ctx) {
#else
int i;
- for (i = 0; i < 8; i++)
- ctx->h[i] = sha512_h0[i];
+ for (i = 0; i < 8; i++) ctx->h[i] = sha512_h0[i];
#endif /* UNROLL_LOOPS_SHA512 */
ctx->len = 0;
ctx->tot_len = 0;
}
-static void SHA512_transform(AvbSHA512Ctx* ctx,
- const uint8_t* message,
+static void SHA512_transform(AvbSHA512Ctx* ctx, const uint8_t* message,
unsigned int block_nb) {
uint64_t w[80];
uint64_t wv[8];
@@ -312,8 +306,7 @@ static void SHA512_transform(AvbSHA512Ctx* ctx,
wv[0] = t1 + t2;
}
- for (j = 0; j < 8; j++)
- ctx->h[j] += wv[j];
+ for (j = 0; j < 8; j++) ctx->h[j] += wv[j];
#endif /* UNROLL_LOOPS_SHA512 */
}
}
@@ -380,8 +373,7 @@ uint8_t* avb_sha512_final(AvbSHA512Ctx* ctx) {
UNPACK64(ctx->h[6], &ctx->buf[48]);
UNPACK64(ctx->h[7], &ctx->buf[56]);
#else
- for (i = 0; i < 8; i++)
- UNPACK64(ctx->h[i], &ctx->buf[i << 3]);
+ for (i = 0; i < 8; i++) UNPACK64(ctx->h[i], &ctx->buf[i << 3]);
#endif /* UNROLL_LOOPS_SHA512 */
return ctx->buf;