14 Commits
main ... v1.0.0

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
2fdc0b2991 Merge branch 'temp' into main-paper 2025-01-15 13:41:47 +08:00
297838dab1 test 2025-01-15 13:35:36 +08:00
a7f5aec8ad rename 2025-01-14 10:59:03 +08:00
66f324cba2 remove dispatch 2025-01-14 09:06:24 +08:00
34432e77c7 add base image ci 2025-01-14 09:02:37 +08:00
4 changed files with 116 additions and 4 deletions

View File

@@ -0,0 +1,77 @@
name: Build and Push Base Image
on:
push:
paths:
- "basedockerfile"
- ".gitea/workflows/build-image.yaml"
- "requirements.txt"
schedule:
- cron: "0 0 1 * *" # 每月1号00:00执行
env:
REGISTRY: git.mamahaha.work
IMAGE_NAME: tpre
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: https://git.mamahaha.work/actions/setup-buildx-action@v3
- name: Login to Private Registry
uses: https://git.mamahaha.work/actions/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Build and push
uses: https://git.mamahaha.work/actions/build-push-action@v5
with:
context: .
file: basedockerfile
push: true
tags: |
${{ env.REGISTRY }}/sangge/${{ env.IMAGE_NAME }}:base

24
.gitignore vendored
View File

@@ -17,4 +17,26 @@ src/tpre.cpython-311-x86_64-linux-gnu.so
venv venv
lib lib
include 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 # 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 ## 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 ## Project Structure
@@ -13,6 +15,8 @@ The project uses the Chinese national standard cryptography algorithm to impleme
├── dockerfile (being used to build application) ├── dockerfile (being used to build application)
├── doc (development documents) ├── doc (development documents)
├── gmssl (gmssl source code) ├── gmssl (gmssl source code)
├── include (gmssl header files)
├── lib (gmssl shared lib)
├── LICENSE ├── LICENSE
├── README_en.md ├── README_en.md
├── README.md ├── README.md

View File

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