aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2023-04-11 16:18:17 +0200
committerTheo Buehler <tb@openbsd.org>2023-04-11 16:27:39 +0200
commite61927441352a7ac4c51b9b8fc2164d1d236e2f3 (patch)
treeb5cc2b04186dff8c4eff9cc0cf243c451d0bfe04
parent6bbcefa48bbb9fbb6ef11ebce750bbb6a2135a31 (diff)
downloadportable-e61927441352a7ac4c51b9b8fc2164d1d236e2f3.tar.gz
portable-e61927441352a7ac4c51b9b8fc2164d1d236e2f3.tar.bz2
portable-e61927441352a7ac4c51b9b8fc2164d1d236e2f3.zip
Temporarily add sha512.c r1.27 as a patch
-rw-r--r--patches/sha512.c.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/sha512.c.patch b/patches/sha512.c.patch
new file mode 100644
index 0000000..92cfdf4
--- /dev/null
+++ b/patches/sha512.c.patch
@@ -0,0 +1,35 @@
1diff -u -p -r1.29 -r1.28
2--- crypto/sha/sha512.c 11 Apr 2023 13:03:03 -0000 1.29
3+++ crypto/sha/sha512.c 11 Apr 2023 10:35:21 -0000 1.28
4@@ -546,28 +546,9 @@ SHA512_Final(unsigned char *md, SHA512_C
5 sha512_block_data_order(c, p, 1);
6 }
7
8- memset (p + n, 0, sizeof(c->u) - 16 - n);
9-#if BYTE_ORDER == BIG_ENDIAN
10- c->u.d[SHA_LBLOCK - 2] = c->Nh;
11- c->u.d[SHA_LBLOCK - 1] = c->Nl;
12-#else
13- p[sizeof(c->u) - 1] = (unsigned char)(c->Nl);
14- p[sizeof(c->u) - 2] = (unsigned char)(c->Nl >> 8);
15- p[sizeof(c->u) - 3] = (unsigned char)(c->Nl >> 16);
16- p[sizeof(c->u) - 4] = (unsigned char)(c->Nl >> 24);
17- p[sizeof(c->u) - 5] = (unsigned char)(c->Nl >> 32);
18- p[sizeof(c->u) - 6] = (unsigned char)(c->Nl >> 40);
19- p[sizeof(c->u) - 7] = (unsigned char)(c->Nl >> 48);
20- p[sizeof(c->u) - 8] = (unsigned char)(c->Nl >> 56);
21- p[sizeof(c->u) - 9] = (unsigned char)(c->Nh);
22- p[sizeof(c->u) - 10] = (unsigned char)(c->Nh >> 8);
23- p[sizeof(c->u) - 11] = (unsigned char)(c->Nh >> 16);
24- p[sizeof(c->u) - 12] = (unsigned char)(c->Nh >> 24);
25- p[sizeof(c->u) - 13] = (unsigned char)(c->Nh >> 32);
26- p[sizeof(c->u) - 14] = (unsigned char)(c->Nh >> 40);
27- p[sizeof(c->u) - 15] = (unsigned char)(c->Nh >> 48);
28- p[sizeof(c->u) - 16] = (unsigned char)(c->Nh >> 56);
29-#endif
30+ memset(p + n, 0, sizeof(c->u) - 16 - n);
31+ c->u.d[SHA_LBLOCK - 2] = htobe64(c->Nh);
32+ c->u.d[SHA_LBLOCK - 1] = htobe64(c->Nl);
33
34 sha512_block_data_order(c, p, 1);
35