From 834bef71929b97bbf9a29fc340bce94593738540 Mon Sep 17 00:00:00 2001 From: K1 Date: Tue, 7 Jan 2025 13:53:42 +0800 Subject: [PATCH] prepare for 1.0.0 Update readme. Add CHANGELOG. --- CHANGELOG.md | 13 +++++++++++++ README.md | 38 +++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5099fa8 --- /dev/null +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 02d51e9..84cfe59 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 ./... ```