Skip to content

Commit

Permalink
Merge pull request #39 from dongbeiouba/release/1.0.0
Browse files Browse the repository at this point in the history
prepare for 1.0.0
  • Loading branch information
dongbeiouba authored Jan 7, 2025
2 parents 0032cda + 834bef7 commit 758b40a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Version 1.0.0 (2025-01-07)

Initial release based on Tongsuo 8.3-stable.

New Features:

- Support hash algorithms: SM3, MD5, SHA1, SHA256
- Support SM4 symmetric encryption algorithm, including CBC/ECB/CFB/OFB/CTR/GCM/CCM mode
- Support SM2 keygen, encryption and decryption
- Support SM2withSM3 digital signature algorithm
- Support HMAC
- Support issuing SM2 certificate
- Support secure transport protocols, including TLCP, TLSv1.0/1.1/1.2/1.3
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# tongsuo-go-sdk
# Tongsuo-Go-SDK

Tongsuo bindings for Go.
Tongsuo-Go-SDK uses Tongsuo to provide cryptographic primitives and secure transport protocols for
golang applications.

## Feature
## Features

- Symmetric algorithms: SM4
- Digital signature algorithms: SM2withSM3
- Hash algorithms: SM3, MD5, SHA1, SHA256
- Secure transport protocol: TLCP, TLSv1.0/1.1/1.2/1.3

## quick start
- Symmetric algorithms: SM4
- SM2 keygen, encryption and decryption
- Digital signature algorithm: SM2withSM3
- Message Authentication Code: HMAC
- Support issuing SM2 certificate
- Secure transport protocols: TLCP, TLSv1.0/1.1/1.2/1.3

### Install Tongsuo
## Installation

tongsuo-go-sdk is based on Tongsuo, so we must install Tongsuo firstly.
Build and install Tongsuo from source code is as follows:
Expand All @@ -27,34 +29,40 @@ make -j
make install
```

### Test tongsuo-go-sdk
Then install tongsuo-go-sdk:

```bash
go get github.com/Tongsuo-Project/tongsuo-go-sdk
```

### Run examples

On Linux:

```bash
TONGSUO_HOME=/opt/tongsuo
LD_LIBRARY_PATH=${TONGSUO_HOME}/lib CGO_CFLAGS="-I${TONGSUO_HOME}/include -Wno-deprecated-declarations" CGO_LDFLAGS="-L${TONGSUO_HOME}/lib" go test ./...
LD_LIBRARY_PATH=${TONGSUO_HOME}/lib CGO_CFLAGS="-I${TONGSUO_HOME}/include -Wno-deprecated-declarations" CGO_LDFLAGS="-L${TONGSUO_HOME}/lib" go run examples/sm4/main.go
```

On MacOS:

```bash
TONGSUO_HOME=/opt/tongsuo
DYLD_LIBRARY_PATH=${TONGSUO_HOME}/lib CGO_CFLAGS="-I${TONGSUO_HOME}/include -Wno-deprecated-declarations" CGO_LDFLAGS="-L${TONGSUO_HOME}/lib" go test ./...
DYLD_LIBRARY_PATH=${TONGSUO_HOME}/lib CGO_CFLAGS="-I${TONGSUO_HOME}/include -Wno-deprecated-declarations" CGO_LDFLAGS="-L${TONGSUO_HOME}/lib" go run examples/sm4/main.go
```

### Run example
### Run tests

On Linux:

```bash
TONGSUO_HOME=/opt/tongsuo
LD_LIBRARY_PATH=${TONGSUO_HOME}/lib CGO_CFLAGS="-I${TONGSUO_HOME}/include -Wno-deprecated-declarations" CGO_LDFLAGS="-L${TONGSUO_HOME}/lib" go run examples/sm4/main.go
LD_LIBRARY_PATH=${TONGSUO_HOME}/lib CGO_CFLAGS="-I${TONGSUO_HOME}/include -Wno-deprecated-declarations" CGO_LDFLAGS="-L${TONGSUO_HOME}/lib" go test ./...
```

On MacOS:

```bash
TONGSUO_HOME=/opt/tongsuo
DYLD_LIBRARY_PATH=${TONGSUO_HOME}/lib CGO_CFLAGS="-I${TONGSUO_HOME}/include -Wno-deprecated-declarations" CGO_LDFLAGS="-L${TONGSUO_HOME}/lib" go run examples/sm4/main.go
DYLD_LIBRARY_PATH=${TONGSUO_HOME}/lib CGO_CFLAGS="-I${TONGSUO_HOME}/include -Wno-deprecated-declarations" CGO_LDFLAGS="-L${TONGSUO_HOME}/lib" go test ./...
```

0 comments on commit 758b40a

Please sign in to comment.