ladnir / cryptotools Goto Github PK
View Code? Open in Web Editor NEWA repo to hold common tools used by my crypto projects
License: Other
A repo to hold common tools used by my crypto projects
License: Other
In the Unix subsection in the install section in readme.md , there is a call to make
right after installing boost. But it did not succeed for me without applying cmake first. (on macos)
[Btw, the boost.get also fails on macos, and it only works after commenting out lines as described here: https://github.com/zcash/zcash/issues/4333 . - This is not an issue in cryptoTools obviously.]
Once again in the readme file, it says the binary name is ./frontend_libOTe . But that's just a copy-paste issue from the libOTe project. Instaed it should be ./frontend_cryptoTools/frontend_cryptoTools
Trying make install
also fails. It looks for a file cryptoools-config.cmake in the project root directory. There is no such file there. But there is a file in another directory named cryptoToolsconfig.cmake (no dash, and capital T). Could it be this file? Seemed to do some install process on my laptop
When building the cryptoTools without span-lite, i got error:
In included file: no type named 'const_iterator' in 'std::span<osuCrypto::block, 18446744073709551615>'clang(typename_nested_not_found)
MatrixView.h(16, 32): Error occurred here
Matrix.h(16, 27): In instantiation of template class 'osuCrypto::MatrixViewosuCrypto::block' requested here
KkrtNcoOtReceiver.h(34, 23): In instantiation of template class 'osuCrypto::MatrixosuCrypto::block' requested here
Because const_iterator in std::span was removed as a result of LWG3320.
May i pull request to fix it?
It is better to change CMake 3.15+ is required
to CMake 3.18+ is required
in readme
. Since boost installation involves a new function called ARCHIVE_EXTRACT
of CMake.
Hi,
The IOService class member mLog is accessed from Channel.cpp (lines 46 and 70) whether ENABLE_NET_LOG was defined or not. Naturally, when ENABLE_NET_LOG is not defined the build fails.
A missing file Backtrace.h is included from cryptoTools/frontend_cryptoTools/main.cpp line 13.
FYI.
locomotive@locomotive-VirtualBox:~/sknn/libOTe/cryptoTools$ make
[ 2%] Built target sha_asm
[ 5%] Building CXX object cryptoTools/CMakeFiles/cryptoTools.dir/Network/Channel.cpp.o
In file included from /home/locomotive/sknn/libOTe/cryptoTools/cryptoTools/Network/Channel.h:5:0,
from /home/locomotive/sknn/libOTe/cryptoTools/cryptoTools/Network/Channel.cpp:1:
/home/locomotive/sknn/libOTe/cryptoTools/cryptoTools/Network/SocketAdapter.h: In member function ‘virtual void osuCrypto::BoostSocketInterface::send(osuCrypto::spanboost::asio::mutable_buffer, bool&, osuCrypto::u64&)’:
/home/locomotive/sknn/libOTe/cryptoTools/cryptoTools/Network/SocketAdapter.h:166:25: error: no match for ‘operator!=’ (operand types are ‘boost::system::error_code’ and ‘int’)
error = (ec != 0);
~~~^~~~
compilation terminated due to -Wfatal-errors.
cryptoTools/CMakeFiles/cryptoTools.dir/build.make:354: recipe for target 'cryptoTools/CMakeFiles/cryptoTools.dir/Network/Channel.cpp.o' failed
make[2]: *** [cryptoTools/CMakeFiles/cryptoTools.dir/Network/Channel.cpp.o] Error 1
CMakeFiles/Makefile2:86: recipe for target 'cryptoTools/CMakeFiles/cryptoTools.dir/all' failed
make[1]: *** [cryptoTools/CMakeFiles/cryptoTools.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Hi,
This is a great implementation of PPA. But there is a tiny typo here:
cryptoTools/cryptoTools/Circuit/BetaLibrary.cpp
Line 1036 in 534e348
I think this should be 'G[i] = G[i:0] = G[i:j] ^ G[j-1:0] & P[i:j]' with 'P[j:0]' replaced with 'P[i:j]'.
PS:
Maybe some more notes for others to understand why your elegant implementation works:
In textbook, the prefix in PPA is updated as: G[i:j] = G[i:k] + P[i:k]*G[k-1:j]. So, G[i]=G[i:0] = G[i:j] + P[i:j]G[j-1:0]. The '+' is 'OR' and '' is 'AND'.
But this will require us to introduce another costly 'AND' operation since we need to implement 'OR' with 'AND' in MPC scenario. Generally, 'G[i:j] + P[i:j]*G[j-1:0]' is not equivalent to 'G[i:j] ^ G[j-1:0] & P[i:j]', when all of them are '1'. But the bad case will not occur here since we have constraints: G=X AND Y, and P=X XOR Y. So we are safe to use G[i:j] ^ G[j-1:0] & P[i:j], in which only one ADD is used.
Why does this error occur?Thank you
/root/PSU_gai/BloomFilter/bloom_filter.h:17:18: error: ‘osuCrypto::Sodium’ has not been declared
17 | using osuCrypto::Sodium::Rist25519;
Hi, the following code aborts on the receiver side. It works fine when replacing the use of BitVector to vector. Can you please help me figuring out how to fix this issue?
`
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include
#include <cryptoTools/Common/BitVector.h>
#include <cryptoTools/Network/Channel.h>
#include <cryptoTools/Network/Session.h>
#include <cryptoTools/Network/IOService.h>
using namespace osuCrypto;
using namespace std;
std::string addr = "localhost";
void sender(){
setThreadName("Sender");
// get up the networking
IOService ios(0);
Session sess(ios, addr, 1212, EpMode::Client);
Channel chl = sess.addChannel();
chl.resetStats();
BitVector outputBitMap(900);
// transfer tables and labels
chl.send(outputBitMap.data(), outputBitMap.size());
std::cout
<< " Sent: " << chl.getTotalDataSent() << std::endl
<< " received: " << chl.getTotalDataRecv() << std::endl << std::endl;
chl.close();
sess.stop();
ios.stop();
return;
}
void receiver(){
setThreadName("Receiver");
// get up the networking
IOService ios(0);
Session sess(ios, addr, 1212, EpMode::Server);
Channel chl = sess.addChannel();
chl.resetStats();
// get garbled tables and output maps
BitVector outputBitMap(900);
chl.recv(outputBitMap.data(), outputBitMap.size());
std::cout
<< " Sent: " << chl.getTotalDataSent() << std::endl
<< " received: " << chl.getTotalDataRecv() << std::endl << std::endl;
chl.resetStats();
chl.close();
sess.stop();
ios.stop();
return;
}
int main(int argc, char** argv) {
int role = atoi(argv[1]); // 0: send, 1: recv
role ? receiver() : sender();
}
`
This is the abort message I get:
"malloc.c:2394: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Aborted"
Thanks a lot.
The address of boost is outdated in the /thirdparty/linux/boost.get, please change it.
This problem not only make the Build process fail, but also affect the "libOTe" repository's Build process
The useful address is "https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.bz2"
Hi,
I run into this:
cryptoTools/cryptoTools/Common/Timer.cpp
Line 46 in 4364c7c
CMakeList.txt
configure_file(cryptoTools/Common/config.h.in "cryptoTools/Common/config.h" )
shoud add ${PROJECT_SOURCE_DIR}
configure_file(cryptoTools/Common/config.h.in "${PROJECT_SOURCE_DIR}/cryptoTools/Common/config.h" )
I'm having issues buidling the latest version and I think it's related to the most recent commit. This is the error message I recieved when running make:
[ 65%] Building CXX object tests_cryptoTools/CMakeFiles/tests_cryptoTools.dir/AES_Tests.cpp.o
In file included from /home/yangziling/cryptoTools/tests_cryptoTools/AES_Tests.cpp:9:
/home/yangziling/cryptoTools/cryptoTools/Crypto/AES.h: In static member function ‘static osuCrypto::block osuCrypto::details::AES<types>::finalEnc(osuCrypto::block, const osuCrypto::block&) [with osuCrypto::details::AESTypes types = osuCrypto::details::NI]’:
/home/yangziling/cryptoTools/cryptoTools/Crypto/AES.h:195:20: error: ‘_mm_aesenclast_si128’ was not declared in this scope; did you mean ‘_mm_testnzc_si128’?
195 | return _mm_aesenclast_si128(state, roundKey);
| ^~~~~~~~~~~~~~~~~~~~
| _mm_testnzc_si128
compilation terminated due to -Wfatal-errors.
make[2]: *** [tests_cryptoTools/CMakeFiles/tests_cryptoTools.dir/build.make:63: tests_cryptoTools/CMakeFiles/tests_cryptoTools.dir/AES_Tests.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:163: tests_cryptoTools/CMakeFiles/tests_cryptoTools.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
In cryptoTools/Common/CuckooIndex.cpp, the function selectParams is used to set CuckooHash Params,
what is the basis for setting the parameters, and are there any research papers on the relevant experimental conclusions and formulas?
For example, is there rigorous evidence supporting the lines in the figure below,
or which article proposed the formula for calculating the statSecParam parameter?
Thank you for your time and assistance. I truly appreciate your help in addressing my questions. Looking forward to hearing from you soon.
compile with ENABLE_SSE=OFF, throw error :
"definition of 'roundEnc' does not match any declaration in 'osuCrypto::details::AESosuCrypto::details::Portable'"
AES.h roundEnc finalEnc declaration
static block roundEnc(block state, const block& roundKey);
should change to
static block roundEnc(block& state, const block& roundKey);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.