Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny0826 committed Apr 22, 2024
0 parents commit c7f328e
Show file tree
Hide file tree
Showing 161 changed files with 33,673 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
26 changes: 26 additions & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test deployment

on:
pull_request:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
140 changes: 140 additions & 0 deletions blog/2022-10-12-C-code-style/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
title: 铜锁的 C 代码风格
authors: [InfoHunter]
tags: [code style, c]
---
# 总述

铜锁采用类似于OpenSSL的代码风格(Coding Style)。因铜锁项目中存在多种编程语言,而C语言作为其中占比最大的一种,所以本文对铜锁的C语言代码风格进行定义。

# 一、缩进
缩进采用4个空格,禁止使用Tab。预处理指令,按照嵌套层次,使用1个空格作为缩进,例如:
```c
#if
# define
# if
# define
# else
# define
# endif
#else
# define
#endif

#define
```

# 二、换行

禁止一行中写多个语句,例如下例是禁止的:
```c
if (condition) do_this();
do_something_everytime();
```
原则上每行的长度为80个字符,即超过80个字符的行需要进行换行;除非换行后严重影响可读性,可不受80字符的行长度限制。对于用户可见的字符串,例如输出到命令行对用户起提示作用的字符串,则禁止换行,以防止无法使用grep等工具在代码中查找。

# 三、大括号配对和空格

对于非函数类语句,铜锁采用如下的大括号对齐风格:
```c
if (x is true) {
we do y
} else if (conidtion) {
we do z
} else {
do something...
}

do {
...
} while (1);

switch (suffix) {
case 'G':
case 'g':
mem <<= 30;
break;
case 'M':
case 'm':
mem <<= 20;
break;
case 'K':
case 'k':
mem <<= 10;
/* fall through */
default:
break;
}
```
需要注意的是,对于switch语句,其中的case需要和switch对齐,而非进一步进行缩进。
对于函数,则大括号的起始位置有变化:
```c
int function(int x)
{
body of function
}
```
此外,关于空格也有相关约定。在绝大部分的关键字后面,都需要加1个空格,例如:
```c
if, switch, case, for, do, while, return
```
对于函数,以及行为类似函数的关键字,如sizeof, typeof, alignof和__attribute__等,其后则不需要添加空格,例如:
```c
SOMETYPE *p = OPENSSL_malloc(sizeof(*p) * num_of_elements);
```
双元和三元运算符的两侧也需要添加1个空格,而一元运算符则无需添加空格:
```c
= + - < > * / % | & ^ <= >= == != ? : +=

以下无需添加空格:

& * + - ~ ! defined

foo++
--bar

foo.bar
foo->bar
```
定义指针的时候,型号需要靠近变量一侧,而不是类型一侧:
```c
char *p = "something";
int *a = NULL;
```

# 四、命名规则

变量和函数的命名禁止使用匈牙利命名法或者任何的驼峰式命名法,例如下列变量和函数名称都是禁止的:
```c
int iVar;
int myVar;
char *pChar;
int AFunctionThatHandlesSomething()
```
相反,使用小写字母加下划线为主的命名方式:
```c
int temp;
int ctx;
char *p;
int do_signature();
```
铜锁继承自OpenSSL,因此部分导出的API也延续了OpenSSL的命名规律,也就是大写字母开头,后加下划线和小写字母表明函数用途的方式。此部分风格暂时继续沿用,后续根据铜锁重构的进展再进行调整。

# 五、注释

禁止使用//风格的注释。对于单行注释,使用:
```c
/* .... */
```
对于多行注释,使用:
```c
/*-
* This is the preferred style for multi-line
* comments in the OpenSSL source code.
* Please use it consistently.
*
* Description: A column of asterisks on the left side,
* with beginning and ending almost-blank lines.
*/
```

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions blog/2023-01-28-certificates/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: 铜锁的商用密码产品认证证书
authors: [InfoHunter]
tags: [荣誉]
---

本页面提供铜锁全部的商用密码产品认证证书(即俗称的国密资质)高清版本下载,铜锁的用户可以自由取用。

## Android:BabaSSL移动端软件密码模块

证书编号:GM003312220220743

PDF格式:
[BabaSSL移动端软件密码模块.pdf](https://www.yuque.com/attachments/yuque/0/2022/pdf/29531143/1670553015579-50fb989e-44cb-40d7-afd8-8a6b5fd5b9c1.pdf)

PNG格式
![BabaSSL移动端软件密码模块.png](./BabaSSL移动端软件密码模块.png)

## iOS:BabaSSL IOS端软件密码模块

证书编号:GM003312220230052

PDF格式:
[BabaSSL IOS端软件密码模块.pdf](https://www.yuque.com/attachments/yuque/0/2023/pdf/21453368/1674895586995-c344f657-68a7-4145-a986-7cf4f9495985.pdf)

PNG格式:
![Page 0001.png](./ios.png)

## Linux:应用安全软件密码模块(Linux版)

证书编号:GM003312220230044

PDF格式:
[应用安全软件密码模块(Linux版).pdf](https://www.yuque.com/attachments/yuque/0/2023/pdf/21453368/1674895607850-cc070f6b-e2b9-4fde-bd38-d4d7bca903e8.pdf)

PNG格式:
![Page 0001.png](./linux.png)
Binary file added blog/2023-01-28-certificates/ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blog/2023-01-28-certificates/linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blog/2024-01-05-2023-Award/award-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions blog/2024-01-05-2023-Award/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: 铜锁获2023开源创新榜“优秀开源项目
authors: [InfoHunter]
tags: [荣誉]
---

![tongsuo_cert.jpg](./tongsuo_cert.jpg)
2023年12月15日,由**中国科协科学技术传播中心****中国计算机学会****中国通信学会****中国科学院软件研究所**共同主办,CSDN 承办的 2023 开源创新榜专家评审会在国家科技传播中心成功举办。评委会主任、中国计算机学会开源发展委员会主任王怀民院士,评委会副主任、中国科协科学技术传播中心副主任陈锐,评委会副主任、中国通信学会副理事长兼秘书长张延川,评委会副主任、中国科学院软件研究所所长赵琛与来自全国学会、大学、科研院所、企业、开源基金会、行业联盟等二十多位开源专家共同参与了本届榜单评审工作,会议由陈锐主持。

2023 年开源创新榜相较往年有以下几个变化:

**一是进一步提升权威性**,主办单位新加入中国计算机学会、中国通信学会、中国科学院软件研究所,四家主办单位优势互补,共同推动榜单策划、征集申报、专家评审等工作重点。

**二是进一步提升公信力**,由王怀民院士担任评委会主任,指导组建了结构更加科学、领域更加全面的评审专家库,从中提名形成最终评审专家。

**三是进一步提升专业度**,围绕项目、社区、人物三大类别,四家主办单位打磨了更加客观、严谨、贴合实际的评审标准和更加开放、公平、科学的评审办法,在征集过程中公开标准细节,接受社会的意见反馈,形成良性循环。

评审委员会主任王怀民院士指出,人类文明和科技文明发展中,一项成果得以记录、传播、共享才对推动社会进步有价值,开源是群体智慧的现代表征,在当下推动高质量发展、高水平安全具有重要现实意义。通过开源创新榜征集评选工作,可以挖掘和推广我国在开源技术领域的优秀成果和先进经验,为一线科技工作者及其创新成果创造更多展示、交流、推广的机会,希望大家共同努力,将开源创新榜打造成为业界最最权威、最典型和最具影响力的标杆。

评委会最终评选出优秀开源项目 20 个,开放原子开源基金会旗下“孵化期”开源项目“铜锁开源密码学算法库”入选其中:

![Screen Shot](./award-list.png)

铜锁(Tongsuo)是一个提供现代密码学算法和安全通信协议的开源基础密码库,为存储、网络、密钥管理、隐私计算等诸多业务场景提供底层的密码学基础能力,实现数据在传输、使用、存储等过程中的私密性、完整性和可认证性,为数据生命周期中的隐私和安全提供保护能力。

铜锁于2020年10月开源,已获得国家密码管理局商用密码检测中心颁发的商用密码产品认证证书,符合GM/T 0028《密码模块安全技术要求》的安全一级要求,助力用户在密改、密评、等保检查等过程中,更加严谨地满足商用密码技术合规的要求。
当前,铜锁开源项目已经由蚂蚁集团完成了向开放原子开源基金会的捐赠,成为基金会的“孵化期”项目,也是基金会唯一的密码学方向开源项目。在基金会孵化过程中,铜锁开源社区先后启动了“铜锁嵌入式版”和“RustyVault密钥管理系统”两个新项目的开发,已从单一开源项目发展为项目群。蚂蚁集团在铜锁完成捐赠后持续对项目进行投入,成立了铜锁项目管理委员会,引入多家领军企业参与铜锁开源项目的管理,推动铜锁进入到了独立发展的新阶段。
Binary file added blog/2024-01-05-2023-Award/tongsuo_cert.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c7f328e

Please sign in to comment.