现在的位置: 首页 > 综合 > 正文

libtomcrypt使用

2018年02月21日 ⁄ 综合 ⁄ 共 407字 ⁄ 字号 评论关闭

要使用库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

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

抱歉!评论已关闭.