Hello,
Detailed explanations on your example codes are very helpful to me in understanding how to use the library and general FHE.
However, due to the lack of knowledge of FHE and C++, I have questions about using OpenFHE.
All of my questions are based on RNS-CKKS.
- I want to get the coefficient of plaintext and keys (eval, secret, public, etc.).
How can I print that values?
-
1.1.
std::cout<< plaintext <<std::endl;
print the values in the slot, not the coefficient. -
1.2.
std::cout<< cc->GetAllEvalMultKeys()<<std::endl;
print the below errors:
In file included from /usr/local/include/openfhe/pke/openfhe.h:41:
In file included from /usr/local/include/openfhe/core/openfhecore.h:41:
In file included from /usr/local/include/openfhe/core/math/hal.h:55:
In file included from /usr/local/include/openfhe/core/math/hal/bigintbackend.h:71:
In file included from /usr/local/include/openfhe/core/math/hal/bigintdyn/backenddyn.h:41:
In file included from /usr/local/include/openfhe/core/math/hal/bigintdyn/mubintvecdyn.h:45:
/usr/local/include/openfhe/core/math/hal/bigintdyn/ubintdyn.h:408:37: error: no member named
'ConvertToInt' in 'std::map<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >,
std::vector<std::shared_ptr<lbcrypto::EvalKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned
int> > > > >,
std::allocator<std::shared_ptr<lbcrypto::EvalKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned
int> > > > > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > >, std::allocator<std::pair<const std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::vector<std::shared_ptr<lbcrypto::EvalKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned
int> > > > >,
std::allocator<std::shared_ptr<lbcrypto::EvalKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned
int> > > > > > > > > >'
ubint(const T& val) : ubint(val.ConvertToInt()) {} // NOLINT
~~~ ^
/home/hhlee/openfhe_test/test.cpp:215:39: note: in instantiation of function template specialization
'bigintdyn::ubint<unsigned int>::ubint<std::map<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::vector<std::shared_ptr<lbcrypto::EvalKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned
int> > > > >,
std::allocator<std::shared_ptr<lbcrypto::EvalKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned
int> > > > > > >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > >, std::allocator<std::pair<const std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::vector<std::shared_ptr<lbcrypto::EvalKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned
int> > > > >,
std::allocator<std::shared_ptr<lbcrypto::EvalKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint<unsigned
int> > > > > > > > > >, true>' requested here
std::cout << "EvalMultKey : " << cc->GetAllEvalMultKeys() << std::endl;
^
1 error generated.
CMakeFiles/test.dir/build.make:75: recipe for target 'CMakeFiles/test.dir/test.cpp.o' failed
make[2]: *** [CMakeFiles/test.dir/test.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/test.dir/all' failed
make[1]: *** [CMakeFiles/test.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
How can I see the evalmultkeys? or fix this error?
- 1.3. also,
cc->GetPrivateKey()
print the ‘0’,cc->GetCryptoParameters()
andcc->GetScheme()
print the address of them (0x…). How can I show any information? - 1.4. Are there functions to see the information of cipher/plaintext, evaluation key, secret key, and public key?
Like prime, coefficient values, level, etc.
- I can print the coefficient of ciphertext by simply
std::cout<<ciphertext;.
From the printed results of the ciphertext, I can show the
Element 0: 0: EVAL: […], 1: EVAL […] , 2: …,
Element 1: 0: EVAL: […], 1: EVAL […], 3: …,
- 2.1. EVAL means the NTT form of the polynomials?
- 2.2. What does (Element 0,Element 1) mean, (m+as+e,a) or (a,m+as+e) ?
- Can I see the intra-operation results?
I want to see the primitive level operations result like NTT/iNTT, base conversion (with modup and moddown result), automorphism (rotated result before key switching), etc.
Just code each primitive operation and print the results? Or exist any functions to see that?
I’m sorry about the basic question about using your library.
Thank you for reading the long questions.