TinyCrypto —— 一个适用于C与C++的加密、解密库.
支持的操作系统 (Win/BSD/Linux/MacOS等)
无需外部库依赖, 无平台与硬件依赖
功能小巧且丰富, 方便自行定制环境
接口易用性好, 无门槛即可上手
可读性好、可维护性高、重复构建成本低
Note: 经过一些平台的不完全测试后, 在使用CMAKE的Release模式构建后大小约为60KB ~ 80KB.
推荐使用者通过以下2种方式获取使用方法:
阅读
inc文件夹下的相关源码头文件.阅读
test文件夹下的测试用例文件.
构建环境
cd tc && cmake -B build -DENABLE_TEST=1.编译
cmake --build build --config Release.cd build运行make install或ninja install或其他安装命令.
在使用默认参数安装后, 目录格式如下所示:
├── include
│ └── tc
│ ├── ...
│ └── tc.h
├── lib
│ ├── libtccrypto.a
│ └── libtccrypto.so使用CMAKE的时候如果不出意外的话, 最终的安装目录结构应该会如上所示. 然而您可以通过定义CMAKE_INSTALL_PREFIX宏来改变安装目录.(一般是: C:\Program files(x86)或/usr/local)
如果您想构建出测试用例, 那么使用CMAKE定义ENABLE_TEST宏为1即可.
如果您喜欢它并且想为它贡献部分代码, 请保证您遵循以下的代码贡献规范:
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 theTCrelated source code implementation. And willing to write code in the same canonical syntax asTC)由于您的代码将被冠以
TC的前缀, 所以希望您的代码像其它算法实现一样可以兼容之前提到的平台. (Since your code will be prefixed withTC, expect your code to be as compatible with the aforementioned platforms as any other algorithmic implementation.)尽可能的复用
TC已经实现的算法与接口, 编写的算法也尽可能让其它接口使用. (As far as possible to reuse theTCalgorithm and interface has been implemented, the algorithm is written as far as possible to let other interfaces use.)TC不依赖非标准库, 希望您贡献的代码也同样遵守. (TCdoes 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 theTC, make sure your contribution has at least test cases.)