-
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.
- go inlining - optimized AMD64 using github.com/minio/c2goasm - support arm64 NEON using github.com/gorse-io/goat - tested in Mac Mini M1
- Loading branch information
Showing
32 changed files
with
7,220 additions
and
5,300 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.s | ||
*.o |
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,28 @@ | ||
EXECUTABLES=clang c2goasm asm2plan9s asmfmt as yasm | ||
K := $(foreach exec,$(EXECUTABLES),\ | ||
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH"))) | ||
|
||
C2GOASM=c2goasm | ||
|
||
CC=clang | ||
CFLAGS=-O3 -fno-asynchronous-unwind-tables -fno-exceptions -fno-rtti -mno-red-zone -mstackrealign -mllvm -inline-threshold=1000 | ||
CFLAGS_ARCH=-arch x86_64 -masm=intel | ||
|
||
CFLAGS_SSE2=-msse -msse2 | ||
CFLAGS_SSSE3=${CFLAGS_SSE2} -mssse3 | ||
CFLAGS_AVX2=${CFLAGS_SSSE3} -mavx -mavx2 | ||
|
||
|
||
all: sse2 avx2 init | ||
|
||
sse2: | ||
${CC} ${CFLAGS} ${CFLAGS_ARCH} ${CFLAGS_SSE2} -S src/lea_sse2.c -o src/lea_sse2.s | ||
${C2GOASM} -a -f src/lea_sse2.s lea_amd64_sse2.s | ||
|
||
avx2: | ||
${CC} ${CFLAGS} ${CFLAGS_ARCH} ${CFLAGS_AVX2} -S src/lea_avx2.c -o src/lea_avx2.s | ||
${C2GOASM} -a -f src/lea_avx2.s lea_amd64_avx2.s | ||
|
||
init: | ||
${CC} ${CFLAGS} ${CFLAGS_ARCH} ${CFLAGS_SSE2} -S src/lea_init.c -o src/lea_init.s | ||
${C2GOASM} -a -f src/lea_init.s lea_init.s |
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,11 @@ | ||
//go:build amd64 && gc && !purego | ||
|
||
package lea | ||
|
||
import "unsafe" | ||
|
||
//go:noescape | ||
func __lea_encrypt_8block(ct, pt, rk unsafe.Pointer, round uint64) | ||
Check failure on line 8 in lea/amd64_c2goasm/lea_amd64_avx2.go GitHub Actions / build
|
||
|
||
//go:noescape | ||
func __lea_decrypt_8block(pt, ct, rk unsafe.Pointer, round uint64) | ||
Check failure on line 11 in lea/amd64_c2goasm/lea_amd64_avx2.go GitHub Actions / build
|
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,11 @@ | ||
//go:build amd64 && gc && !purego | ||
|
||
package lea | ||
|
||
import "unsafe" | ||
|
||
//go:noescape | ||
func __lea_encrypt_4block(ct, pt, rk unsafe.Pointer, round uint64) | ||
Check failure on line 8 in lea/amd64_c2goasm/lea_amd64_sse2.go GitHub Actions / build
|
||
|
||
//go:noescape | ||
func __lea_decrypt_4block(pt, ct, rk unsafe.Pointer, round uint64) | ||
Check failure on line 11 in lea/amd64_c2goasm/lea_amd64_sse2.go GitHub Actions / build
|
Oops, something went wrong.