Skip to content
/ tc Public

A suitable for C/C++ encryption and decryption library.

License

Notifications You must be signed in to change notification settings

CandyMi/tc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyCrypto

TinyCrypto —— 一个适用于CC++的加密、解密库.

Features

  • 支持的操作系统 (Win/BSD/Linux/MacOS等)

  • 无需外部库依赖, 无平台与硬件依赖

  • 功能小巧且丰富, 方便自行定制环境

  • 接口易用性好, 无门槛即可上手

  • 可读性好、可维护性高、重复构建成本低

Note: 经过一些平台的不完全测试后, 在使用CMAKERelease模式构建后大小约为60KB ~ 80KB.

Usage

推荐使用者通过以下2种方式获取使用方法:

  1. 阅读inc文件夹下的相关源码头文件.

  2. 阅读test文件夹下的测试用例文件.

Install

  1. 构建环境 cd tc && cmake -B build -DENABLE_TEST=1.

  2. 编译 cmake --build build --config Release.

  3. cd build 运行 make installninja install 或其他安装命令.

1. Folder

在使用默认参数安装后, 目录格式如下所示:

├── include
│   └── tc
│       ├── ...
│       └── tc.h
├── lib
│   ├── libtccrypto.a
│   └── libtccrypto.so

2. path

使用CMAKE的时候如果不出意外的话, 最终的安装目录结构应该会如上所示. 然而您可以通过定义CMAKE_INSTALL_PREFIX宏来改变安装目录.(一般是: C:\Program files(x86)/usr/local)

Test Case

如果您想构建出测试用例, 那么使用CMAKE定义ENABLE_TEST宏为1即可.

Contribution

如果您喜欢它并且想为它贡献部分代码, 请保证您遵循以下的代码贡献规范:

If you like it and want to contribute some code to it, please follow these code contribution rules:

  • 请保证您以熟读TC相关源码实现. 并且愿意以TC相同规范的语法形式编写代码. (Please ensure that you are familiar with the TC related source code implementation. And willing to write code in the same canonical syntax as TC)

  • 由于您的代码将被冠以TC的前缀, 所以希望您的代码像其它算法实现一样可以兼容之前提到的平台. (Since your code will be prefixed with TC, expect your code to be as compatible with the aforementioned platforms as any other algorithmic implementation.)

  • 尽可能的复用TC已经实现的算法与接口, 编写的算法也尽可能让其它接口使用. (As far as possible to reuse the TC algorithm and interface has been implemented, the algorithm is written as far as possible to let other interfaces use.)

  • TC不依赖非标准库, 希望您贡献的代码也同样遵守. (TC does not rely on non-standard libraries, and we expect your code contributions to do the same)

  • 为了保证贡献到TC的代码质量, 请保证您的贡献至少拥有测试用例. (To ensure the quality of the code you contribute to the TC, make sure your contribution has at least test cases.)

License

BSD 3-Clause "New" or "Revised" License.