Closed Ldisi closed 5 years ago
You can do it by changing plaintext space from 2^r to 2^(r-1), look https://github.com/homenc/HElib/blob/master/src/Test_extractDigits.cpp
thanks, but the operation "dividend by two" is not easy to realize,am i right?
You are right for plaintext spaces mod p where p>2. In the binary case it's easy.
Le mer. 22 mai 2019 à 14:27, Ldisi notifications@github.com a écrit :
thanks, but the operation "dividend by two" is not easy to realize,am i right?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/homenc/HElib/issues/299?email_source=notifications&email_token=ABRE3FVCP7FMZF2Z5XDO6V3PWU3Z5A5CNFSM4HOTVAV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV64BRA#issuecomment-494780612, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRE3FWVSJYHZPGRM6CPTIDPWU3Z5ANCNFSM4HOTVAVQ .
Yes! My work is in plaintext spaces mod p where p >> 2, is there method to do that?
No efficient one as I know. You can express the div by 2 function as a polynomial of degree log(p) evaluation. Usually it's costly
Le mer. 22 mai 2019 à 15:54, Ldisi notifications@github.com a écrit :
Yes! My work is in plaintext spaces mod p where p >> 2, is there method to do that?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/homenc/HElib/issues/299?email_source=notifications&email_token=ABRE3FRHSSXMMP4JREF6MTTPWVGAJA5CNFSM4HOTVAV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV7D36A#issuecomment-494812664, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRE3FXEKGMIHQUDJTYVJ7TPWVGAJANCNFSM4HOTVAVQ .
THX ^-^
If your plaintext space is an odd number p, then divide-by-two is the same as multiplying by (p+1)/2.
Thanks,you are right.But it still seems difficult to implement (p+1)/2.
it's not difficult, just use ctxt.multByConstant(to_ZZ((p+1)/2))
THX!I will try it later
------------------ Original ------------------ From: Shai Halevi notifications@github.com Date: Thu,May 23,2019 11:49 AM To: homenc/HElib HElib@noreply.github.com Cc: Ldisi 1725983010@qq.com, Author author@noreply.github.com Subject: Re: [homenc/HElib] Can Helib has can implement a Ctxt divided by two? (#299)
You are right,I have tried it!
------------------ Original ------------------ From: Shai Halevi notifications@github.com Date: Thu,May 23,2019 11:49 AM To: homenc/HElib HElib@noreply.github.com Cc: Ldisi 1725983010@qq.com, Author author@noreply.github.com Subject: Re: [homenc/HElib] Can Helib has can implement a Ctxt divided by two? (#299)
it's not difficult, just use ctxt.multByConstant(to_ZZ((p+1)/2))
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Your Contact: Your environment (OS/HW): Detailed Description: Such as, m1 = [2], implement m1/2 = [1], Is there such function?