[go] crypto/internal/fips140/subtle: fix unalignment access and panic on mips64x

0 views
Skip to first unread message

Julian Zhu (Gerrit)

unread,
Jul 16, 2026, 1:34:51 PM (yesterday) Jul 16
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Keith Randall, Dmitri Shuralyov, Dmitri Shuralyov, golang...@luci-project-accounts.iam.gserviceaccount.com, Keith Randall, Filippo Valsorda, golang-co...@googlegroups.com

Julian Zhu submitted the change with unreviewed changes

Unreviewed changes

6 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: src/crypto/internal/fips140/subtle/xor_mips64x.s
Insertions: 1, Deletions: 18.

@@ -87,7 +87,7 @@

xor_16_check:
SGTU $16, R4, R5
- BNE R5, xor_8_check
+ BNE R5, xor_8
xor_16:
MOVV (R2), R6
MOVV 8(R2), R7
@@ -103,9 +103,6 @@
SUBV $16, R4
BEQ R4, end

-xor_8_check:
- SGTU $8, R4, R5
- BNE R5, xor_4
xor_8:
MOVV (R2), R6
MOVV (R3), R7
@@ -115,20 +112,6 @@
ADDV $8, R2
ADDV $8, R3
SUBV $8, R4
- BEQ R4, end
-
-xor_4:
- SGTU $4, R4, R5
- BNE R5, end
- MOVW (R2), R6
- MOVW (R3), R7
- XOR R6, R7
- MOVW R7, (R1)
- ADDV $4, R2
- ADDV $4, R3
- ADDV $4, R1
- SUBV $4, R4
- BNE R4, xor_4

end:
RET
```

Change information

Commit message:
crypto/internal/fips140/subtle: re-add assembly implementation of xorBytes for mips64x

This CL reapplies CL 666255 , and fixes the previous implementation's unaligned access and panic on mips64x.

Updates #74998
Change-Id: I8e58d25ba5f11520bfbe6e515d378c805bd5984f
Reviewed-by: Keith Randall <k...@golang.org>
Reviewed-by: Keith Randall <k...@google.com>
Reviewed-by: Dmitri Shuralyov <dmit...@google.com>
Files:
  • M src/crypto/internal/fips140/subtle/xor_generic.go
  • A src/crypto/internal/fips140/subtle/xor_mips64x.s
  • M src/crypto/internal/fips140/subtle/xor_mipsx.go
Change size: M
Delta: 3 files changed, 119 insertions(+), 2 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I8e58d25ba5f11520bfbe6e515d378c805bd5984f
Gerrit-Change-Number: 696075
Gerrit-PatchSet: 8
Gerrit-Owner: Julian Zhu <jz53...@gmail.com>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
Gerrit-Reviewer: Julian Zhu <jz53...@gmail.com>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@google.com>
Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages