From 1d4a03f3d650a577581aedee8cc799a3ad6668d8 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 24 Jan 2026 14:20:52 +0000 Subject: Tidy instruction separators in SHA assembly. Remove unnecessary separators and add a few to macros that call other macros (instead of expecting them to exist). --- src/lib/libcrypto/sha/sha1_aarch64_ce.S | 12 +-- src/lib/libcrypto/sha/sha1_amd64_generic.S | 150 +++++++++++++-------------- src/lib/libcrypto/sha/sha1_amd64_shani.S | 20 ++-- src/lib/libcrypto/sha/sha256_aarch64_ce.S | 8 +- src/lib/libcrypto/sha/sha256_amd64_generic.S | 12 +-- src/lib/libcrypto/sha/sha256_amd64_shani.S | 12 +-- src/lib/libcrypto/sha/sha512_amd64_generic.S | 12 +-- 7 files changed, 113 insertions(+), 113 deletions(-) diff --git a/src/lib/libcrypto/sha/sha1_aarch64_ce.S b/src/lib/libcrypto/sha/sha1_aarch64_ce.S index ce7eb81115..853d467641 100644 --- a/src/lib/libcrypto/sha/sha1_aarch64_ce.S +++ b/src/lib/libcrypto/sha/sha1_aarch64_ce.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sha1_aarch64_ce.S,v 1.3 2026/01/17 06:31:45 jsing Exp $ */ +/* $OpenBSD: sha1_aarch64_ce.S,v 1.4 2026/01/24 14:20:52 jsing Exp $ */ /* * Copyright (c) 2023,2025 Joel Sing * @@ -65,7 +65,7 @@ */ #define sha1_message_schedule_update(m0, m1, m2, m3) \ sha1su0 m0.4s, m1.4s, m2.4s; \ - sha1su1 m0.4s, m3.4s; + sha1su1 m0.4s, m3.4s /* * Compute four SHA-1 rounds by adding W0:W1:W2:W3 + K0:K1:K2:K3, then @@ -77,25 +77,25 @@ add tmp0.4s, w.4s, k.4s; /* Tt = Wt + Kt */ \ mov tmp1, h0.s[0]; \ sha1c h0, h1, tmp0.4s; \ - sha1h h1, tmp1; + sha1h h1, tmp1 #define sha1_round2(h0, h1, w, k) \ add tmp0.4s, w.4s, k.4s; /* Tt = Wt + Kt */ \ mov tmp1, h0.s[0]; \ sha1p h0, h1, tmp0.4s; \ - sha1h h1, tmp1; + sha1h h1, tmp1 #define sha1_round3(h0, h1, w, k) \ add tmp0.4s, w.4s, k.4s; /* Tt = Wt + Kt */ \ mov tmp1, h0.s[0]; \ sha1m h0, h1, tmp0.4s; \ - sha1h h1, tmp1; + sha1h h1, tmp1 #define sha1_round4(h0, h1, w, k) \ add tmp0.4s, w.4s, k.4s; /* Tt = Wt + Kt */ \ mov tmp1, h0.s[0]; \ sha1p h0, h1, tmp0.4s; \ - sha1h h1, tmp1; + sha1h h1, tmp1 .arch armv8-a+sha2 diff --git a/src/lib/libcrypto/sha/sha1_amd64_generic.S b/src/lib/libcrypto/sha/sha1_amd64_generic.S index 685d71edf8..a2088229ec 100644 --- a/src/lib/libcrypto/sha/sha1_amd64_generic.S +++ b/src/lib/libcrypto/sha/sha1_amd64_generic.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sha1_amd64_generic.S,v 1.3 2026/01/17 06:31:45 jsing Exp $ */ +/* $OpenBSD: sha1_amd64_generic.S,v 1.4 2026/01/24 14:20:52 jsing Exp $ */ /* * Copyright (c) 2024 Joel Sing * @@ -46,7 +46,7 @@ #define sha1_message_schedule_load(idx, m, w, wt) \ movl ((idx&0xf)*4)(m), wt; \ bswapl wt; \ - movl wt, ((idx&0xf)*4)(w); + movl wt, ((idx&0xf)*4)(w) /* * Update message schedule and return current value in wt: @@ -60,7 +60,7 @@ xorl (((idx)&0xf)*4)(w), wt; /* W0 */ \ roll $1, wt; \ \ - movl wt, ((idx&0xf)*4)(w); + movl wt, ((idx&0xf)*4)(w) /* * Compute a SHA-1 round without logic function: @@ -97,7 +97,7 @@ xorl d, tmp2; /* Ch */ \ addl tmp2, e; /* Ch */ \ \ - sha1_round(a, b, c, d, e, kt, wt); + sha1_round(a, b, c, d, e, kt, wt) /* * Compute a SHA-1 round with Parity: @@ -114,7 +114,7 @@ xorl d, tmp2; /* Parity */ \ addl tmp2, e; /* Parity */ \ \ - sha1_round(a, b, c, d, e, kt, wt); + sha1_round(a, b, c, d, e, kt, wt) /* * Compute a SHA-1 round with Maj: @@ -134,26 +134,26 @@ xorl tmp2, tmp3; /* Maj */ \ addl tmp3, e; /* Maj */ \ \ - sha1_round(a, b, c, d, e, kt, wt); + sha1_round(a, b, c, d, e, kt, wt) #define sha1_round1_load(idx, a, b, c, d, e) \ - sha1_message_schedule_load(idx, in, %rsp, tmp0) \ + sha1_message_schedule_load(idx, in, %rsp, tmp0); \ sha1_round_ch(a, b, c, d, e, 0x5a827999, tmp0) #define sha1_round1_update(idx, a, b, c, d, e) \ - sha1_message_schedule_update(idx, %rsp, tmp0) \ + sha1_message_schedule_update(idx, %rsp, tmp0); \ sha1_round_ch(a, b, c, d, e, 0x5a827999, tmp0) #define sha1_round2_update(idx, a, b, c, d, e) \ - sha1_message_schedule_update(idx, %rsp, tmp0) \ + sha1_message_schedule_update(idx, %rsp, tmp0); \ sha1_round_parity(a, b, c, d, e, 0x6ed9eba1, tmp0) #define sha1_round3_update(idx, a, b, c, d, e) \ - sha1_message_schedule_update(idx, %rsp, tmp0) \ + sha1_message_schedule_update(idx, %rsp, tmp0); \ sha1_round_maj(a, b, c, d, e, 0x8f1bbcdc, tmp0) #define sha1_round4_update(idx, a, b, c, d, e) \ - sha1_message_schedule_update(idx, %rsp, tmp0) \ + sha1_message_schedule_update(idx, %rsp, tmp0); \ sha1_round_parity(a, b, c, d, e, 0xca62c1d6, tmp0) .section .text @@ -215,76 +215,76 @@ sha1_block_generic: sha1_round1_load(15, hs0, hs1, hs2, hs3, hs4) /* Round 16 through 31. */ - sha1_round1_update(16, hs4, hs0, hs1, hs2, hs3); - sha1_round1_update(17, hs3, hs4, hs0, hs1, hs2); - sha1_round1_update(18, hs2, hs3, hs4, hs0, hs1); - sha1_round1_update(19, hs1, hs2, hs3, hs4, hs0); - sha1_round2_update(20, hs0, hs1, hs2, hs3, hs4); - sha1_round2_update(21, hs4, hs0, hs1, hs2, hs3); - sha1_round2_update(22, hs3, hs4, hs0, hs1, hs2); - sha1_round2_update(23, hs2, hs3, hs4, hs0, hs1); - sha1_round2_update(24, hs1, hs2, hs3, hs4, hs0); - sha1_round2_update(25, hs0, hs1, hs2, hs3, hs4); - sha1_round2_update(26, hs4, hs0, hs1, hs2, hs3); - sha1_round2_update(27, hs3, hs4, hs0, hs1, hs2); - sha1_round2_update(28, hs2, hs3, hs4, hs0, hs1); - sha1_round2_update(29, hs1, hs2, hs3, hs4, hs0); - sha1_round2_update(30, hs0, hs1, hs2, hs3, hs4); - sha1_round2_update(31, hs4, hs0, hs1, hs2, hs3); + sha1_round1_update(16, hs4, hs0, hs1, hs2, hs3) + sha1_round1_update(17, hs3, hs4, hs0, hs1, hs2) + sha1_round1_update(18, hs2, hs3, hs4, hs0, hs1) + sha1_round1_update(19, hs1, hs2, hs3, hs4, hs0) + sha1_round2_update(20, hs0, hs1, hs2, hs3, hs4) + sha1_round2_update(21, hs4, hs0, hs1, hs2, hs3) + sha1_round2_update(22, hs3, hs4, hs0, hs1, hs2) + sha1_round2_update(23, hs2, hs3, hs4, hs0, hs1) + sha1_round2_update(24, hs1, hs2, hs3, hs4, hs0) + sha1_round2_update(25, hs0, hs1, hs2, hs3, hs4) + sha1_round2_update(26, hs4, hs0, hs1, hs2, hs3) + sha1_round2_update(27, hs3, hs4, hs0, hs1, hs2) + sha1_round2_update(28, hs2, hs3, hs4, hs0, hs1) + sha1_round2_update(29, hs1, hs2, hs3, hs4, hs0) + sha1_round2_update(30, hs0, hs1, hs2, hs3, hs4) + sha1_round2_update(31, hs4, hs0, hs1, hs2, hs3) /* Round 32 through 47. */ - sha1_round2_update(32, hs3, hs4, hs0, hs1, hs2); - sha1_round2_update(33, hs2, hs3, hs4, hs0, hs1); - sha1_round2_update(34, hs1, hs2, hs3, hs4, hs0); - sha1_round2_update(35, hs0, hs1, hs2, hs3, hs4); - sha1_round2_update(36, hs4, hs0, hs1, hs2, hs3); - sha1_round2_update(37, hs3, hs4, hs0, hs1, hs2); - sha1_round2_update(38, hs2, hs3, hs4, hs0, hs1); - sha1_round2_update(39, hs1, hs2, hs3, hs4, hs0); - sha1_round3_update(40, hs0, hs1, hs2, hs3, hs4); - sha1_round3_update(41, hs4, hs0, hs1, hs2, hs3); - sha1_round3_update(42, hs3, hs4, hs0, hs1, hs2); - sha1_round3_update(43, hs2, hs3, hs4, hs0, hs1); - sha1_round3_update(44, hs1, hs2, hs3, hs4, hs0); - sha1_round3_update(45, hs0, hs1, hs2, hs3, hs4); - sha1_round3_update(46, hs4, hs0, hs1, hs2, hs3); - sha1_round3_update(47, hs3, hs4, hs0, hs1, hs2); + sha1_round2_update(32, hs3, hs4, hs0, hs1, hs2) + sha1_round2_update(33, hs2, hs3, hs4, hs0, hs1) + sha1_round2_update(34, hs1, hs2, hs3, hs4, hs0) + sha1_round2_update(35, hs0, hs1, hs2, hs3, hs4) + sha1_round2_update(36, hs4, hs0, hs1, hs2, hs3) + sha1_round2_update(37, hs3, hs4, hs0, hs1, hs2) + sha1_round2_update(38, hs2, hs3, hs4, hs0, hs1) + sha1_round2_update(39, hs1, hs2, hs3, hs4, hs0) + sha1_round3_update(40, hs0, hs1, hs2, hs3, hs4) + sha1_round3_update(41, hs4, hs0, hs1, hs2, hs3) + sha1_round3_update(42, hs3, hs4, hs0, hs1, hs2) + sha1_round3_update(43, hs2, hs3, hs4, hs0, hs1) + sha1_round3_update(44, hs1, hs2, hs3, hs4, hs0) + sha1_round3_update(45, hs0, hs1, hs2, hs3, hs4) + sha1_round3_update(46, hs4, hs0, hs1, hs2, hs3) + sha1_round3_update(47, hs3, hs4, hs0, hs1, hs2) /* Round 48 through 63. */ - sha1_round3_update(48, hs2, hs3, hs4, hs0, hs1); - sha1_round3_update(49, hs1, hs2, hs3, hs4, hs0); - sha1_round3_update(50, hs0, hs1, hs2, hs3, hs4); - sha1_round3_update(51, hs4, hs0, hs1, hs2, hs3); - sha1_round3_update(52, hs3, hs4, hs0, hs1, hs2); - sha1_round3_update(53, hs2, hs3, hs4, hs0, hs1); - sha1_round3_update(54, hs1, hs2, hs3, hs4, hs0); - sha1_round3_update(55, hs0, hs1, hs2, hs3, hs4); - sha1_round3_update(56, hs4, hs0, hs1, hs2, hs3); - sha1_round3_update(57, hs3, hs4, hs0, hs1, hs2); - sha1_round3_update(58, hs2, hs3, hs4, hs0, hs1); - sha1_round3_update(59, hs1, hs2, hs3, hs4, hs0); - sha1_round4_update(60, hs0, hs1, hs2, hs3, hs4); - sha1_round4_update(61, hs4, hs0, hs1, hs2, hs3); - sha1_round4_update(62, hs3, hs4, hs0, hs1, hs2); - sha1_round4_update(63, hs2, hs3, hs4, hs0, hs1); + sha1_round3_update(48, hs2, hs3, hs4, hs0, hs1) + sha1_round3_update(49, hs1, hs2, hs3, hs4, hs0) + sha1_round3_update(50, hs0, hs1, hs2, hs3, hs4) + sha1_round3_update(51, hs4, hs0, hs1, hs2, hs3) + sha1_round3_update(52, hs3, hs4, hs0, hs1, hs2) + sha1_round3_update(53, hs2, hs3, hs4, hs0, hs1) + sha1_round3_update(54, hs1, hs2, hs3, hs4, hs0) + sha1_round3_update(55, hs0, hs1, hs2, hs3, hs4) + sha1_round3_update(56, hs4, hs0, hs1, hs2, hs3) + sha1_round3_update(57, hs3, hs4, hs0, hs1, hs2) + sha1_round3_update(58, hs2, hs3, hs4, hs0, hs1) + sha1_round3_update(59, hs1, hs2, hs3, hs4, hs0) + sha1_round4_update(60, hs0, hs1, hs2, hs3, hs4) + sha1_round4_update(61, hs4, hs0, hs1, hs2, hs3) + sha1_round4_update(62, hs3, hs4, hs0, hs1, hs2) + sha1_round4_update(63, hs2, hs3, hs4, hs0, hs1) /* Round 64 through 79. */ - sha1_round4_update(64, hs1, hs2, hs3, hs4, hs0); - sha1_round4_update(65, hs0, hs1, hs2, hs3, hs4); - sha1_round4_update(66, hs4, hs0, hs1, hs2, hs3); - sha1_round4_update(67, hs3, hs4, hs0, hs1, hs2); - sha1_round4_update(68, hs2, hs3, hs4, hs0, hs1); - sha1_round4_update(69, hs1, hs2, hs3, hs4, hs0); - sha1_round4_update(70, hs0, hs1, hs2, hs3, hs4); - sha1_round4_update(71, hs4, hs0, hs1, hs2, hs3); - sha1_round4_update(72, hs3, hs4, hs0, hs1, hs2); - sha1_round4_update(73, hs2, hs3, hs4, hs0, hs1); - sha1_round4_update(74, hs1, hs2, hs3, hs4, hs0); - sha1_round4_update(75, hs0, hs1, hs2, hs3, hs4); - sha1_round4_update(76, hs4, hs0, hs1, hs2, hs3); - sha1_round4_update(77, hs3, hs4, hs0, hs1, hs2); - sha1_round4_update(78, hs2, hs3, hs4, hs0, hs1); - sha1_round4_update(79, hs1, hs2, hs3, hs4, hs0); + sha1_round4_update(64, hs1, hs2, hs3, hs4, hs0) + sha1_round4_update(65, hs0, hs1, hs2, hs3, hs4) + sha1_round4_update(66, hs4, hs0, hs1, hs2, hs3) + sha1_round4_update(67, hs3, hs4, hs0, hs1, hs2) + sha1_round4_update(68, hs2, hs3, hs4, hs0, hs1) + sha1_round4_update(69, hs1, hs2, hs3, hs4, hs0) + sha1_round4_update(70, hs0, hs1, hs2, hs3, hs4) + sha1_round4_update(71, hs4, hs0, hs1, hs2, hs3) + sha1_round4_update(72, hs3, hs4, hs0, hs1, hs2) + sha1_round4_update(73, hs2, hs3, hs4, hs0, hs1) + sha1_round4_update(74, hs1, hs2, hs3, hs4, hs0) + sha1_round4_update(75, hs0, hs1, hs2, hs3, hs4) + sha1_round4_update(76, hs4, hs0, hs1, hs2, hs3) + sha1_round4_update(77, hs3, hs4, hs0, hs1, hs2) + sha1_round4_update(78, hs2, hs3, hs4, hs0, hs1) + sha1_round4_update(79, hs1, hs2, hs3, hs4, hs0) /* Add intermediate state to hash state. */ addl (0*4)(ctx), hs0 diff --git a/src/lib/libcrypto/sha/sha1_amd64_shani.S b/src/lib/libcrypto/sha/sha1_amd64_shani.S index 751554f1d5..e31143887a 100644 --- a/src/lib/libcrypto/sha/sha1_amd64_shani.S +++ b/src/lib/libcrypto/sha/sha1_amd64_shani.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sha1_amd64_shani.S,v 1.2 2026/01/17 06:31:45 jsing Exp $ */ +/* $OpenBSD: sha1_amd64_shani.S,v 1.3 2026/01/24 14:20:52 jsing Exp $ */ /* * Copyright (c) 2024 Joel Sing * @@ -50,25 +50,25 @@ #define sha1_message_schedule_load(idx, m, xmsg) \ movdqu (idx*16)(m), xmsg; \ - pshufb xshufmask, xmsg; + pshufb xshufmask, xmsg #define sha1_message_schedule_update(xm0, xm1, xm2, xm3) \ sha1msg1 xm1, xm0; \ pxor xm2, xm0; \ - sha1msg2 xm3, xm0; + sha1msg2 xm3, xm0 #define sha1_shani_round(fn, xmsg, xe, xe_next) \ sha1nexte xmsg, xe; \ movdqa xabcd, xe_next; \ - sha1rnds4 fn, xe, xabcd; + sha1rnds4 fn, xe, xabcd #define sha1_shani_round_load(fn, idx, m, xmsg, xe, xe_next) \ sha1_message_schedule_load(idx, m, xmsg); \ - sha1_shani_round(fn, xmsg, xe, xe_next); + sha1_shani_round(fn, xmsg, xe, xe_next) #define sha1_shani_round_update(fn, xm0, xm1, xm2, xm3, xe, xe_next) \ sha1_message_schedule_update(xm0, xm1, xm2, xm3); \ - sha1_shani_round(fn, xm0, xe, xe_next); + sha1_shani_round(fn, xm0, xe, xe_next) .section .text @@ -109,14 +109,14 @@ sha1_block_shani: movdqa xe0, xe_save /* Rounds 0 through 15 (four rounds at a time). */ - sha1_message_schedule_load(0, in, xmsg0); + sha1_message_schedule_load(0, in, xmsg0) paddd xmsg0, xe0 movdqa xabcd, xe1 sha1rnds4 $0, xe0, xabcd - sha1_shani_round_load($0, 1, in, xmsg1, xe1, xe0); - sha1_shani_round_load($0, 2, in, xmsg2, xe0, xe1); - sha1_shani_round_load($0, 3, in, xmsg3, xe1, xe0); + sha1_shani_round_load($0, 1, in, xmsg1, xe1, xe0) + sha1_shani_round_load($0, 2, in, xmsg2, xe0, xe1) + sha1_shani_round_load($0, 3, in, xmsg3, xe1, xe0) /* Rounds 16 through 79 (four rounds at a time). */ sha1_shani_round_update($0, xmsg0, xmsg1, xmsg2, xmsg3, xe0, xe1) diff --git a/src/lib/libcrypto/sha/sha256_aarch64_ce.S b/src/lib/libcrypto/sha/sha256_aarch64_ce.S index b66969427b..343f338390 100644 --- a/src/lib/libcrypto/sha/sha256_aarch64_ce.S +++ b/src/lib/libcrypto/sha/sha256_aarch64_ce.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sha256_aarch64_ce.S,v 1.4 2026/01/17 06:31:45 jsing Exp $ */ +/* $OpenBSD: sha256_aarch64_ce.S,v 1.5 2026/01/24 14:20:52 jsing Exp $ */ /* * Copyright (c) 2023,2025 Joel Sing * @@ -65,7 +65,7 @@ */ #define sha256_message_schedule_update(m0, m1, m2, m3) \ sha256su0 m0.4s, m1.4s; \ - sha256su1 m0.4s, m2.4s, m3.4s; + sha256su1 m0.4s, m2.4s, m3.4s /* * Compute four SHA-256 rounds by adding W0:W1:W2:W3 + K0:K1:K2:K3, then @@ -76,10 +76,10 @@ add tmp0.4s, w.4s, k.4s; /* Tt = Wt + Kt */ \ mov tmp1.4s, h0.4s; \ sha256h h0, h1, tmp0.4s; \ - sha256h2 h1, tmp1, tmp0.4s; + sha256h2 h1, tmp1, tmp0.4s #define sha256_round_update(h0, h1, m0, m1, m2, m3, k) \ - sha256_message_schedule_update(m0, m1, m2, m3) \ + sha256_message_schedule_update(m0, m1, m2, m3); \ sha256_round(h0, h1, m0, k) .arch armv8-a+sha2 diff --git a/src/lib/libcrypto/sha/sha256_amd64_generic.S b/src/lib/libcrypto/sha/sha256_amd64_generic.S index a5bb3eca42..a860b014f2 100644 --- a/src/lib/libcrypto/sha/sha256_amd64_generic.S +++ b/src/lib/libcrypto/sha/sha256_amd64_generic.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sha256_amd64_generic.S,v 1.4 2026/01/17 06:31:45 jsing Exp $ */ +/* $OpenBSD: sha256_amd64_generic.S,v 1.5 2026/01/24 14:20:52 jsing Exp $ */ /* * Copyright (c) 2024 Joel Sing * @@ -51,7 +51,7 @@ #define sha256_message_schedule_load(idx, m, w, wt) \ movl (m, round, 4), wt; \ bswapl wt; \ - movl wt, ((idx&0xf)*4)(w); + movl wt, ((idx&0xf)*4)(w) /* * Update message schedule and return current value in wt: @@ -82,7 +82,7 @@ xorl tmp3, tmp2; /* sigma0 */ \ addl tmp2, wt; /* sigma0 */ \ \ - movl wt, ((idx&0xf)*4)(w); + movl wt, ((idx&0xf)*4)(w) /* * Compute a SHA-256 round: @@ -133,14 +133,14 @@ xorl tmp2, tmp3; /* T2 Maj */ \ addl tmp3, h; /* T2 Maj */ \ \ - addq $1, round; + addq $1, round #define sha256_round_load(idx, a, b, c, d, e, f, g, h) \ - sha256_message_schedule_load(idx, in, %rsp, tmp0) \ + sha256_message_schedule_load(idx, in, %rsp, tmp0); \ sha256_round(idx, a, b, c, d, e, f, g, h, k256, %rsp, tmp0) #define sha256_round_update(idx, a, b, c, d, e, f, g, h) \ - sha256_message_schedule_update(idx, %rsp, tmp0) \ + sha256_message_schedule_update(idx, %rsp, tmp0); \ sha256_round(idx, a, b, c, d, e, f, g, h, k256, %rsp, tmp0) .section .text diff --git a/src/lib/libcrypto/sha/sha256_amd64_shani.S b/src/lib/libcrypto/sha/sha256_amd64_shani.S index e43ecfa51f..b6f32b72cf 100644 --- a/src/lib/libcrypto/sha/sha256_amd64_shani.S +++ b/src/lib/libcrypto/sha/sha256_amd64_shani.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sha256_amd64_shani.S,v 1.2 2026/01/17 06:31:45 jsing Exp $ */ +/* $OpenBSD: sha256_amd64_shani.S,v 1.3 2026/01/24 14:20:52 jsing Exp $ */ /* * Copyright (c) 2024 Joel Sing * @@ -56,29 +56,29 @@ #define sha256_message_schedule_load(idx, m, xmsgtmp) \ movdqu (idx*16)(m), xmsg; \ pshufb xshufmask, xmsg; \ - movdqa xmsg, xmsgtmp; + movdqa xmsg, xmsgtmp #define sha256_message_schedule_update(xmt0, xmt1, xmt2, xmt3) \ sha256msg1 xmt1, xmt0; \ movdqa xmt3, xmsgtmp4; \ palignr $4, xmt2, xmsgtmp4; \ paddd xmsgtmp4, xmt0; \ - sha256msg2 xmt3, xmt0; + sha256msg2 xmt3, xmt0 #define sha256_shani_round(idx) \ paddd (idx*16)(k256), xmsg; \ sha256rnds2 xmsg, xhs0, xhs1; \ pshufd $0x0e, xmsg, xmsg; \ - sha256rnds2 xmsg, xhs1, xhs0; + sha256rnds2 xmsg, xhs1, xhs0 #define sha256_shani_round_load(idx, m, xmsgtmp) \ sha256_message_schedule_load(idx, m, xmsgtmp); \ - sha256_shani_round(idx); + sha256_shani_round(idx) #define sha256_shani_round_update(idx, xmt0, xmt1, xmt2, xmt3) \ sha256_message_schedule_update(xmt0, xmt1, xmt2, xmt3); \ movdqa xmt0, xmsg; \ - sha256_shani_round(idx); + sha256_shani_round(idx) .section .text diff --git a/src/lib/libcrypto/sha/sha512_amd64_generic.S b/src/lib/libcrypto/sha/sha512_amd64_generic.S index 3b6a9719e1..052367df07 100644 --- a/src/lib/libcrypto/sha/sha512_amd64_generic.S +++ b/src/lib/libcrypto/sha/sha512_amd64_generic.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sha512_amd64_generic.S,v 1.2 2026/01/17 06:31:45 jsing Exp $ */ +/* $OpenBSD: sha512_amd64_generic.S,v 1.3 2026/01/24 14:20:52 jsing Exp $ */ /* * Copyright (c) 2024 Joel Sing * @@ -51,7 +51,7 @@ #define sha512_message_schedule_load(idx, m, w, wt) \ movq (m, round, 8), wt; \ bswapq wt; \ - movq wt, ((idx&0xf)*8)(w); + movq wt, ((idx&0xf)*8)(w) /* * Update message schedule and return current value in wt: @@ -83,7 +83,7 @@ xorq tmp3, tmp2; /* sigma0 */ \ addq tmp2, wt; /* sigma0 */ \ \ - movq wt, ((idx&0xf)*8)(w); + movq wt, ((idx&0xf)*8)(w) /* * Compute a SHA-512 round: @@ -134,14 +134,14 @@ xorq tmp2, tmp3; /* T2 Maj */ \ addq tmp3, h; /* T2 Maj */ \ \ - addq $1, round; + addq $1, round #define sha512_round_load(idx, a, b, c, d, e, f, g, h) \ - sha512_message_schedule_load(idx, in, %rsp, tmp0) \ + sha512_message_schedule_load(idx, in, %rsp, tmp0); \ sha512_round(idx, a, b, c, d, e, f, g, h, k512, %rsp, tmp0) #define sha512_round_update(idx, a, b, c, d, e, f, g, h) \ - sha512_message_schedule_update(idx, %rsp, tmp0) \ + sha512_message_schedule_update(idx, %rsp, tmp0); \ sha512_round(idx, a, b, c, d, e, f, g, h, k512, %rsp, tmp0) .section .text -- cgit v1.2.3-55-g6feb