OpenIPMP中Cryptopp库的重编译

author: A.TNG <jiyucn@163.com>

一直在琢磨怎么把OpenIPMP的东西成功的放到嵌入式开发板上。

OpenIPMP中使用了很多外部库,都是开源的项目,其中的Crypto++是一个与密码学相关的库,支持许多算法,应该负责对多媒体文件的加密和解密功能。

通过比较OpenIPMP中/ext/Crypt++/include/*.h与Crypto++各个较新版本的头文件,发现OpenIPMP使用的版本是5.2.x。下载了对应版本(Version 5.2.1)的源代码后,曾尝试在Fedora5下编译libcryptopp.a,出现很多编译错误,如下:

make: Warning: File `GNUmakefile' has modification time 8.7e+05 s in the future
g++ -g -msse2 -I../../include -pipe -c 3way.cpp
../../include/seckey.h: In function avoid CryptoPP::CheckedSetKey(T*, CryptoPP::CipherDir, const byte*, unsigned int, const CryptoPP::NameValuePairs&) [with T = CryptoPP::BlockCipherFinal<DECRYPTION, CryptoPP::ThreeWay::Dec>]a:
../../include/seckey.h:179:   instantiated from avoid CryptoPP::BlockCipherFinal<DIR, BASE>::SetKey(const byte*, unsigned int, const CryptoPP::NameValuePairs&) [with CryptoPP::CipherDir DIR = DECRYPTION, BASE = CryptoPP::ThreeWay::Dec]a
3way.cpp:139:   instantiated from here
../../include/seckey.h:137: error: no matching function for call to aCryptoPP::BlockCipherFinal<DECRYPTION, CryptoPP::ThreeWay::Dec>::UncheckedSetKey(CryptoPP::CipherDir&, const byte*&, unsigned int&)a
3way.cpp:64: note: candidates are: void CryptoPP::ThreeWay::Base::UncheckedSetKey(CryptoPP::CipherDir, const byte*, unsigned int, unsigned int)
../../include/seckey.h: In function avoid CryptoPP::CheckedSetKey(T*, CryptoPP::CipherDir, const byte*, unsigned int, const CryptoPP::NameValuePairs&) [with T = CryptoPP::BlockCipherFinal<ENCRYPTION, CryptoPP::ThreeWay::Enc>]a:
../../include/seckey.h:179:   instantiated from avoid CryptoPP::BlockCipherFinal<DIR, BASE>::SetKey(const byte*, unsigned int, const CryptoPP::NameValuePairs&) [with CryptoPP::CipherDir DIR = ENCRYPTION, BASE = CryptoPP::ThreeWay::Enc]a
3way.cpp:139:   instantiated from here
../../include/seckey.h:137: error: no matching function for call to aCryptoPP::BlockCipherFinal<ENCRYPTION, CryptoPP::ThreeWay::Enc>::UncheckedSetKey(CryptoPP::CipherDir&, const byte*&, unsigned int&)a
3way.cpp:64: note: candidates are: void CryptoPP::ThreeWay::Base::UncheckedSetKey(CryptoPP::CipherDir, const byte*, unsigned int, unsigned int)
make: *** [3way.o] Error 1

错误的地方大概是在seckey.h中
template <class T>
static inline void CheckedSetKey(T *obj, CipherDir dir, const byte *key, unsigned int length, const NameValuePairs &param)
{
 obj->ThrowIfInvalidKeyLength(length);
 obj->UncheckedSetKey(dir, key, length); // UncheckedSetKey 未定义
}
查看当前使用的gcc版本为4.1.1。尔后尝试在Redhat9下编译,查看gcc版本为3.2.2,并且编译成功。猜测与编译对模板的支持不同有关,对于5.2.1版本,没有找到合适的解决方法,建议使用5.3或者更高版本。 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值