-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- see `dev_asm` branch. - minify binary - optimized AMD64 using github.com/minio/c2goasm - optimized arm64 NEON using github.com/gorse-io/goat
- Loading branch information
Showing
72 changed files
with
17,174 additions
and
75,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2022 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package subtle | ||
|
||
// XORBytes sets dst[i] = x[i] ^ y[i] for all i < n = min(len(x), len(y)), | ||
// returning n, the number of bytes written to dst. | ||
// If dst does not have length at least n, | ||
// XORBytes panics without writing anything to dst. | ||
func XORBytes(dst, x, y []byte) int { | ||
n := len(x) | ||
if len(y) < n { | ||
n = len(y) | ||
} | ||
if n == 0 { | ||
return 0 | ||
} | ||
if n > len(dst) { | ||
panic("subtle.XORBytes: dst too short") | ||
} | ||
xorBytes(&dst[0], &x[0], &y[0], n) // arch-specific | ||
return n | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// https://github.com/golang/go/blob/release-branch.go1.21/src/crypto/subtle/xor_arm64.go | ||
|
||
// Copyright 2020 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build !purego | ||
|
||
package subtle | ||
|
||
//go:noescape | ||
func xorBytes(dst, a, b *byte, n int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// https://github.com/golang/go/blob/release-branch.go1.21/src/crypto/subtle/xor_arm64.go | ||
|
||
// Copyright 2020 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build !purego | ||
|
||
package subtle | ||
|
||
//go:noescape | ||
func xorBytes(dst, a, b *byte, n int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// https://github.com/golang/go/blob/release-branch.go1.21/src/crypto/subtle/xor_arm64.s | ||
|
||
// Copyright 2020 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build !purego | ||
|
||
#include "textflag.h" | ||
|
||
// func xorBytes(dst, a, b *byte, n int) | ||
TEXT ·xorBytes(SB), NOSPLIT|NOFRAME, $0 | ||
MOVD dst+0(FP), R0 | ||
MOVD a+8(FP), R1 | ||
MOVD b+16(FP), R2 | ||
MOVD n+24(FP), R3 | ||
CMP $64, R3 | ||
BLT tail | ||
loop_64: | ||
VLD1.P 64(R1), [V0.B16, V1.B16, V2.B16, V3.B16] | ||
VLD1.P 64(R2), [V4.B16, V5.B16, V6.B16, V7.B16] | ||
VEOR V0.B16, V4.B16, V4.B16 | ||
VEOR V1.B16, V5.B16, V5.B16 | ||
VEOR V2.B16, V6.B16, V6.B16 | ||
VEOR V3.B16, V7.B16, V7.B16 | ||
VST1.P [V4.B16, V5.B16, V6.B16, V7.B16], 64(R0) | ||
SUBS $64, R3 | ||
CMP $64, R3 | ||
BGE loop_64 | ||
tail: | ||
// quick end | ||
CBZ R3, end | ||
TBZ $5, R3, less_than32 | ||
VLD1.P 32(R1), [V0.B16, V1.B16] | ||
VLD1.P 32(R2), [V2.B16, V3.B16] | ||
VEOR V0.B16, V2.B16, V2.B16 | ||
VEOR V1.B16, V3.B16, V3.B16 | ||
VST1.P [V2.B16, V3.B16], 32(R0) | ||
less_than32: | ||
TBZ $4, R3, less_than16 | ||
LDP.P 16(R1), (R11, R12) | ||
LDP.P 16(R2), (R13, R14) | ||
EOR R11, R13, R13 | ||
EOR R12, R14, R14 | ||
STP.P (R13, R14), 16(R0) | ||
less_than16: | ||
TBZ $3, R3, less_than8 | ||
MOVD.P 8(R1), R11 | ||
MOVD.P 8(R2), R12 | ||
EOR R11, R12, R12 | ||
MOVD.P R12, 8(R0) | ||
less_than8: | ||
TBZ $2, R3, less_than4 | ||
MOVWU.P 4(R1), R13 | ||
MOVWU.P 4(R2), R14 | ||
EORW R13, R14, R14 | ||
MOVWU.P R14, 4(R0) | ||
less_than4: | ||
TBZ $1, R3, less_than2 | ||
MOVHU.P 2(R1), R15 | ||
MOVHU.P 2(R2), R16 | ||
EORW R15, R16, R16 | ||
MOVHU.P R16, 2(R0) | ||
less_than2: | ||
TBZ $0, R3, end | ||
MOVBU (R1), R17 | ||
MOVBU (R2), R19 | ||
EORW R17, R19, R19 | ||
MOVBU R19, (R0) | ||
end: | ||
RET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# [Source Code](https://seed.kisa.or.kr/kisa/Board/20/detailView.do) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.