-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sam Yuan <[email protected]>
- Loading branch information
1 parent
b922d29
commit 8e39b8d
Showing
18 changed files
with
218 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_run: | ||
workflows: ["Github workflow test"] | ||
types: [completed] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@master | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
registry: ghcr.io | ||
username: SamYuan1990 | ||
password: ${{ secrets.TESTDOCKERLOGIN }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v3 | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
context: ./go_crypto | ||
platforms: linux/amd64,linux/s390x,linux/arm64 | ||
push: true | ||
tags: ghcr.io/samyuan1990/Trash | ||
labels: Crypto | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v3 | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
context: ./go_pqc | ||
platforms: linux/amd64,linux/s390x,linux/arm64 | ||
push: true | ||
tags: ghcr.io/samyuan1990/Trash | ||
labels: PostCrypto |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module github.com/SamYuan1990/Trash/IntExample | ||
|
||
go 1.20 | ||
go 1.21 |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module consensusCFT | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
require ( | ||
github.com/onsi/ginkgo/v2 v2.2.0 | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module controller-runtime | ||
|
||
go 1.18 | ||
go 1.21 | ||
|
||
require ( | ||
github.com/prometheus/client_golang v1.14.0 | ||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module github.com/SamYuan1990/Trash | ||
|
||
go 1.20 | ||
go 1.21 |
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 |
---|---|---|
@@ -1,10 +1,21 @@ | ||
go 1.20 | ||
go 1.21.1 | ||
|
||
use ./controller-runtime | ||
|
||
use ./consensusPBFT | ||
|
||
use ./consensusCFT | ||
|
||
use ./lattigoLearninng | ||
|
||
use ./otelPrometheus | ||
|
||
use ./otel | ||
|
||
use ./IntExample | ||
use ./prometheusExample | ||
|
||
use ( | ||
./go_crypto | ||
./prometheusExample | ||
./go_pqc | ||
) |
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,14 @@ | ||
From ghcr.io/samyuan1990/liboqs-go:latest | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
COPY main.go . | ||
COPY go.mod . | ||
|
||
ENV GOPROXY=https://goproxy.cn,direct | ||
|
||
RUN go mod tidy | ||
RUN go build main.go | ||
#RUN ls main | ||
|
||
CMD [main] |
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,3 @@ | ||
module github.com/SamYuan1990/Trash/go_crypto | ||
|
||
go 1.18 |
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,21 @@ | ||
package main | ||
|
||
import ( | ||
"crypto/ecdsa" | ||
"crypto/elliptic" | ||
"crypto/rand" | ||
) | ||
|
||
func main() { | ||
msg := []byte("test") | ||
priv, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) | ||
|
||
for i := 0; i < 100; i++ { | ||
go func() { | ||
for { | ||
r, s, _ := ecdsa.Sign(rand.Reader, priv, msg) | ||
ecdsa.Verify(&priv.PublicKey, msg, r, 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,14 @@ | ||
From ghcr.io/samyuan1990/liboqs-go:latest | ||
|
||
RUN mkdir -p /app | ||
WORKDIR /app | ||
COPY main.go . | ||
COPY go.mod . | ||
|
||
ENV GOPROXY=https://goproxy.cn,direct | ||
|
||
RUN go mod tidy | ||
RUN go build main.go | ||
#RUN ls main | ||
|
||
CMD [main] |
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,5 @@ | ||
module github.com/SamYuan1990/Trash/go_pqc | ||
|
||
go 1.18 | ||
|
||
require github.com/open-quantum-safe/liboqs-go v0.0.0-20230829040711-e3e87437a36c |
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 @@ | ||
github.com/open-quantum-safe/liboqs-go v0.0.0-20230829040711-e3e87437a36c h1:UFF48Vtv/EzRxnBAPU9HOY/qHevxG0iawNAwUyxQgu0= | ||
github.com/open-quantum-safe/liboqs-go v0.0.0-20230829040711-e3e87437a36c/go.mod h1:7o26+0OF/Oh1Vo1sWUN+2jZavRhXvuLldh++utxFvRI= |
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,23 @@ | ||
package main | ||
|
||
import "github.com/open-quantum-safe/liboqs-go/oqs" | ||
|
||
func main() { | ||
msg := []byte("test") | ||
var signer, verifier oqs.Signature | ||
sigName := "Dilithium2" | ||
defer signer.Clean() | ||
defer verifier.Clean() | ||
// ignore potential errors everywhere | ||
_ = signer.Init(sigName, nil) | ||
_ = verifier.Init(sigName, nil) | ||
pubKey, _ := signer.GenerateKeyPair() | ||
for i := 0; i < 100; i++ { | ||
go func() { | ||
for { | ||
signature, _ := signer.Sign(msg) | ||
verifier.Verify(msg, signature, pubKey) | ||
} | ||
}() | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module lattigoLearninng | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
require github.com/tuneinsight/lattigo/v3 v3.0.5 | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/SamYuan1990/Trash/otel | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
require ( | ||
github.com/prometheus/client_golang v1.14.0 | ||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module github.com/SamYuan1990/Trash/prometheusExample | ||
|
||
go 1.20 | ||
go 1.21 |