add: 修改支持NTRU

This commit is contained in:
2020-09-18 15:00:28 +08:00
parent b9a78cd79c
commit b775cb4f8c
2 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ void BlockChainLogger::run() {
int offset = 0;
while (true) {
if (expectedSize <= 0) { // 读取一个整型,表示后面跟着的json串的大小
if (expectedSize <= 0) { // 读取一个整型,表示后面跟着的json串
size = ringBuffer.read(buffer, 4);
if (size <= 0) { // 没有数据
// std::cout << "wait for data" << std::endl;
+4 -5
View File
@@ -1,9 +1,7 @@
#include <iostream>
#include <thread>
#include "utils/RedisUtil.h"
#include "Server.h"
#include "BlockChainLogger.h"
#include <ndn-cxx/util/NTRUSignUtil.hpp>
/**
*
1. 接收区块链下发的登录信息,加载相应用户的证书到redis数据库中。下发登录信息应包含登录超时时间。
@@ -20,13 +18,14 @@ using namespace std;
int main() {
ndn::security::ntru::NTRUSignUtil::init();
Server server;
server.run();
std::thread t([]() {
BlockChainLogger blockChainLogger;
blockChainLogger.run();
});
server.run();
ndn::security::ntru::NTRUSignUtil::clean();
// AddOrUpdateCertificateRequestMessage addOrUpdateCertificateRequestMessage;
// addOrUpdateCertificateRequestMessage.parse("{\n"