libtomcrypt使用

来源:互联网 发布:阶梯外圆数控车编程 编辑:程序博客网 时间:2024/06/08 03:37
要使用库libtomcrypt,还要下载其依赖的库libtommath,libtomfastmath,基本步骤如下:

1.下载依赖库:libtommath,libtomfastmath。


2.编译安装libtommath:

make install


3.编译安装libtomfastmath:

make install


4.编译libtomcrypt:
CFLAGS="-DLTM_DESC -DTFM_DESC" make install



编译自带的测试程序
1. 编译库:libtomcrypt_prof.a
CFLAGS="-DLTM_DESC -DTFM_DESC -DUSE_TFM" make 
2. 编译测试程序ht_test:


gcc -DTFM_DESC -DUSE_TFM -o ht_test ht_test_run.c -L .  -ltomcrypt -ltfm -I ./h


自带的测试程序有些问题,老是编译有错误。实在编不过,就放弃好了,直接用库就行。