TYPE REQUIRED
)
-find_package(QCA2)
-set_package_properties(QCA2 PROPERTIES
- DESCRIPTION "Qt Cryptographic Architecture"
- URL "https://github.com/fluxer/qca"
- PURPOSE "Support for encrypted OpenDocument Text documents in Okular"
- TYPE REQUIRED
-)
-
find_package(LibGcrypt)
set_package_properties(LibGcrypt PROPERTIES
DESCRIPTION "General purpose cryptographic library based on the code from GnuPG"
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-include_directories(${LIBGCRYPT_INCLUDE_DIR} ${QCA2_INCLUDE_DIR})
+include_directories(${LIBGCRYPT_INCLUDE_DIR})
remove_definitions(-DQT_NO_HTTP)
set(libktorrent_SRC
# kde4_add_kcfg_files(libktorrent_SRC settings.kcfgc)
add_library(ktorrent SHARED ${libktorrent_SRC})
-target_link_libraries(ktorrent PRIVATE ${KDE4_KIO_LIBS} ${GMP_LIBRARIES} ${KDE4_SOLID_LIBS} ${LIBGCRYPT_LIBRARIES} ${QCA2_LIBRARIES})
+target_link_libraries(ktorrent PRIVATE ${KDE4_KIO_LIBS} ${GMP_LIBRARIES} ${KDE4_SOLID_LIBS} ${LIBGCRYPT_LIBRARIES})
target_link_libraries(ktorrent PUBLIC ${KDE4_KDEUI_LIBS})
set_target_properties(ktorrent PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
install(TARGETS ktorrent ${INSTALL_TARGETS_DEFAULT_ARGS} )
#include "sha1hashgen.h"
#include <stdio.h>
#include <string.h>
-#include <arpa/inet.h>
-#include <QtCrypto>
#include "functions.h"
namespace bt
{
- static QCA::Initializer qca_init;
-
- SHA1HashGen::SHA1HashGen() : h(new QCA::Hash("sha1"))
+ SHA1HashGen::SHA1HashGen() : h(new QCryptographicHash(QCryptographicHash::Sha1))
{
memset(result,9,20);
}
SHA1Hash SHA1HashGen::generate(const Uint8* data,Uint32 len)
{
- h->update((const char*)data,len);
- return SHA1Hash((const bt::Uint8*)h->final().constData());
+ h->addData((const char*)data,len);
+ return SHA1Hash((const bt::Uint8*)h->result().constData());
}
void SHA1HashGen::start()
{
- h->clear();
+ h->reset();
}
void SHA1HashGen::update(const Uint8* data,Uint32 len)
{
- h->update((const char*)data,len);
+ h->addData((const char*)data,len);
}
void SHA1HashGen::end()
{
- memcpy(result,h->final().constData(),20);
+ memcpy(result,h->result().constData(),20);
}
#include "constants.h"
#include "sha1hash.h"
-namespace QCA
-{
- class Hash;
-}
+#include <QCryptographicHash>
namespace bt
{
SHA1Hash get() const;
private:
- QCA::Hash* h;
+ QCryptographicHash* h;
Uint8 result[20];
};