Compare commits

9 Commits

Author SHA1 Message Date
ef14e4851c update test code
Some checks failed
Build and Push Base Image / build-and-push (push) Failing after 7m15s
Test CI / test speed (push) Successful in 5s
2025-03-30 21:38:30 +08:00
2a238f75c6 test
All checks were successful
Build and Push Base Image / build-and-push (push) Successful in 4m0s
2025-01-16 11:22:34 +08:00
960fdef63f update
Some checks failed
Build and Push Base Image / build-and-push (push) Failing after 1m25s
2025-01-16 10:44:02 +08:00
06aa815950 add compile dependency
Some checks failed
Build and Push Base Image / build-and-push (push) Failing after 56s
2025-01-16 10:27:26 +08:00
6e07893e0d update ci
Some checks failed
Build and Push Base Image / build-and-push (push) Failing after 2m21s
2025-01-16 10:17:42 +08:00
53ec2773ac update
Some checks failed
Test CI / test speed (push) Successful in 19s
Test CI / build-and-push (push) Failing after 1m42s
2025-01-15 15:17:37 +08:00
1b75a45984 add env
Some checks failed
Test CI / test speed (push) Successful in 16s
Test CI / build-and-push (push) Failing after 6m39s
2025-01-15 14:27:11 +08:00
65862575ff test
Some checks failed
Test CI / test speed (push) Successful in 7s
Test CI / build-and-push (push) Failing after 2m6s
2025-01-15 14:23:53 +08:00
33acaf7330 test 2025-01-15 14:17:46 +08:00
4 changed files with 81 additions and 8 deletions

View File

@@ -4,7 +4,8 @@ on:
push:
paths:
- "basedockerfile"
- ".gitea/workflows/build_image.yaml"
- ".gitea/workflows/build-image.yaml"
- "requirements.txt"
schedule:
- cron: "0 0 1 * *" # 每月1号00:00执行
@@ -15,22 +16,59 @@ env:
jobs:
build-and-push:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout repository
uses: https://git.mamahaha.work/actions/checkout@v4
with:
submodules: "recursive"
- name: Install build dependencies
run: |
apt-get update
apt-get install -y build-essential cmake git
# 编译 GMSSL
- name: Build GMSSL
run: |
cd gmssl
mkdir build
cd build
cmake ..
make
# 复制库文件
- name: Copy library files
run: |
pwd
mkdir -p $GITHUB_WORKSPACE/lib
ls $GITHUB_WORKSPACE
cd gmssl/build/bin
cp libgmssl.so \
libgmssl.so.3 \
libgmssl.so.3.1 \
libsdf_dummy.so \
libsdf_dummy.so.3 \
libsdf_dummy.so.3.1 \
libskf_dummy.so \
libskf_dummy.so.3 \
libskf_dummy.so.3.1 \
$GITHUB_WORKSPACE/lib/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: https://git.mamahaha.work/actions/setup-buildx-action@v3
- name: Login to Private Registry
uses: docker/login-action@v3
uses: https://git.mamahaha.work/actions/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
uses: https://git.mamahaha.work/actions/build-push-action@v5
with:
context: .
file: basedockerfile

24
.gitignore vendored
View File

@@ -17,4 +17,26 @@ src/tpre.cpython-311-x86_64-linux-gnu.so
venv
lib
include
/frontend/node_modules/
/frontend/node_modules/
## LaTeX 临时文件
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
*.dvi
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml

View File

@@ -1,10 +1,12 @@
# tpre-python
This project is designed for the National Cryptography Competition and is implemented in Python to execute the TPRE algorithm.
This project is designed for the National Cryptography Competition
and is implemented in Python to execute the TPRE algorithm.
## Project Principle
The project uses the Chinese national standard cryptography algorithm to implement distributed proxy re-encryption (TPRE).
The project uses the Chinese national standard cryptography algorithm
to implement distributed proxy re-encryption (TPRE).
## Project Structure
@@ -13,6 +15,8 @@ The project uses the Chinese national standard cryptography algorithm to impleme
├── dockerfile (being used to build application)
├── doc (development documents)
├── gmssl (gmssl source code)
├── include (gmssl header files)
├── lib (gmssl shared lib)
├── LICENSE
├── README_en.md
├── README.md

View File

@@ -1,10 +1,19 @@
from tpre import *
from tpre import (
GenerateKeyPair,
Encrypt,
GenerateReKey,
ReEncrypt,
MergeCFrag,
DecryptFrags,
)
import time
import openpyxl
# 初始化Excel工作簿和工作表
wb = openpyxl.Workbook()
ws = wb.active
if ws is None:
raise Exception("无法创建Excel文件")
ws.title = "算法性能结果"
headers = [
"门限值 N",