Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
ef14e4851c | |||
2a238f75c6 | |||
960fdef63f | |||
06aa815950 | |||
6e07893e0d | |||
53ec2773ac | |||
1b75a45984 | |||
65862575ff | |||
33acaf7330 | |||
2fdc0b2991 | |||
297838dab1 | |||
a7f5aec8ad | |||
66f324cba2 | |||
34432e77c7 |
77
.gitea/workflows/build-image.yaml
Normal file
77
.gitea/workflows/build-image.yaml
Normal 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
|
22
.gitignore
vendored
22
.gitignore
vendored
@@ -18,3 +18,25 @@ venv
|
||||
lib
|
||||
include
|
||||
/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
|
||||
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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",
|
Reference in New Issue
Block a user