jiangjianyu / damgard_jurik

Damgård–Jurik Cryptosystem
1 stars 3 forks source link

Example does not work #1

Open kholoudAlSaleh opened 7 years ago

kholoudAlSaleh commented 7 years ago

Hi, the example provided does not work I think something is missing. Can you please check it out.

jiangjianyu commented 7 years ago

Hi,

Can you show me the error? As it is an old project, and i stop maintaining it.

kholoudAlSaleh commented 7 years ago

Thank you for taking the time to see it. 1)At first it gives an error for the header :No such file or directory  #include , I changed it to  #include 2)Then after fixing that, the errors are the following:  error: ‘text_1_c’ was not declared in this scope  damgard_jurik_ciphertext_t c_3 = (c_1^text_1_c) (c_2^text_2_c);                                          ^ encryption.cpp:23:60: error: ‘text_2_c’ was not declared in this scope  damgard_jurik_ciphertext_t c_3 = (c_1^text_1_c) (c_2^text_2_c);                                                             ^ encryption.cpp:25:45: error: invalid conversion from ‘void’ to ‘unsigned char’ [-fpermissive]  unsigned char select_text = se_p->to_bytes() Fixing : damgard_jurik_ciphertext_t c_3 = (c_1^text_1_c) (c_2^text_2_c); to damgard_jurik_ciphertext_t c_3 = (c_1^text_1) (c_2^*text_2);

3) Third  error:no match for ‘operator’ (operand type is ‘damgard_jurik_plaintext_t’)  damgard_jurik_ciphertext_t c_3 = (c_1^text_1) (c_2^text_2);                                         ^ encryption.cpp:23:40: note: candidate is: In file included from encryption.cpp:4:0: ../src/damgard_jurik.h:112:28: note: damgard_jurik_ciphertext_t operator(damgard_jurik_ciphertext_t, damgard_jurik_ciphertext_t)  damgard_jurik_ciphertext_t operator(damgard_jurik_ciphertext_t a, damgard_jurik_ciphertext_t b);                             ^ ../src/damgard_jurik.h:112:28: note:   candidate expects 2 arguments, 1 provided encryption.cpp:23:57: error: no match for ‘operator’ (operand type is ‘damgard_jurik_plaintext_t’)  damgard_jurik_ciphertext_t c_3 = (c_1^text_1) (c_2^text_2);                                                          ^ encryption.cpp:23:57: note: candidate is: In file included from encryption.cpp:4:0: ../src/damgard_jurik.h:112:28: note: damgard_jurik_ciphertext_t operator(damgard_jurik_ciphertext_t, damgard_jurik_ciphertext_t)  damgard_jurik_ciphertext_t operator(damgard_jurik_ciphertext_t a, damgard_jurik_ciphertext_t b);                             ^ ../src/damgard_jurik.h:112:28: note:   candidate expects 2 arguments, 1 provided encryption.cpp:25:45: error: invalid conversion from ‘void’ to ‘unsigned char’ [-fpermissive]  unsigned char select_text = se_p->to_bytes();  Fixing it and removing the to become: damgard_jurik_ciphertext_t c_3 = (c_1^text_1) (c_2^text_2); 4)Fourth error: invalid conversion from ‘void’ to ‘unsigned char’ [-fpermissive]  unsigned char select_text = se_p->to_bytes(); If you could please provide me with a working example and how to use it to perform onion encryption I would be very grateful. Thank you and regards,Kholoud

  From: Jianyu <notifications@github.com>

To: jianyu-m/damgard_jurik damgard_jurik@noreply.github.com Cc: kholoudAlSaleh kholoud_alsaleh@yahoo.com; Author author@noreply.github.com Sent: Monday, November 6, 2017 5:24 AM Subject: Re: [jianyu-m/damgard_jurik] Example does not work (#1)

Hi,Can you show me the error? As it is an old project, and i stop maintaining it.— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

jiangjianyu commented 7 years ago

You can refer my another repository OnionRam for onion encryption / decryption. As for your current problems, I just add a linking option (link gmp) in cmake and it works.

jiangjianyu commented 7 years ago

Sorry just check it with the example and I find out that there are typos. I will sort that out soon. Or you can refer the OnionRam programs.

SuviSree commented 3 years ago

Thank you for taking the time to see it. 1)At first it gives an error for the header :No such file or directory #include , I changed it to #include 2)Then after fixing that, the errors are the following: error: ‘text_1_c’ was not declared in this scope damgard_jurik_ciphertext_t c_3 = (c_1^text_1_c) (c_2^text_2_c); ^ encryption.cpp:23:60: error: ‘text_2_c’ was not declared in this scope damgard_jurik_ciphertext_t c_3 = (c_1^text_1_c) (c_2^text_2_c); ^ encryption.cpp:25:45: error: invalid conversion from ‘void’ to ‘unsigned char’ [-fpermissive] unsigned char select_text = se_p->to_bytes() Fixing : damgard_jurik_ciphertext_t c_3 = (c_1^text_1_c) (c_2^text_2_c); to damgard_jurik_ciphertext_t c_3 = (c_1^text_1) (c_2^text_2); 3) Third error:no match for ‘operator’ (operand type is ‘damgard_jurik_plaintext_t’) damgard_jurik_ciphertext_t c_3 = (c_1^text_1) (c_2^text_2); ^ encryption.cpp:23:40: note: candidate is: In file included from encryption.cpp:4:0: ../src/damgard_jurik.h:112:28: note: damgard_jurik_ciphertext_t operator(damgard_jurik_ciphertext_t, damgard_jurik_ciphertext_t) damgard_jurik_ciphertext_t operator(damgard_jurik_ciphertext_t a, damgard_jurik_ciphertext_t b); ^ ../src/damgard_jurik.h:112:28: note: candidate expects 2 arguments, 1 provided encryption.cpp:23:57: error: no match for ‘operator’ (operand type is ‘damgard_jurik_plaintext_t’) damgard_jurik_ciphertext_t c_3 = (c_1^text_1) (c_2^text_2); ^ encryption.cpp:23:57: note: candidate is: In file included from encryption.cpp:4:0: ../src/damgard_jurik.h:112:28: note: damgard_jurik_ciphertext_t operator(damgard_jurik_ciphertext_t, damgard_jurik_ciphertext_t) damgard_jurik_ciphertext_t operator(damgard_jurik_ciphertext_t a, damgard_jurik_ciphertext_t b); ^ ../src/damgard_jurik.h:112:28: note: candidate expects 2 arguments, 1 provided encryption.cpp:25:45: error: invalid conversion from ‘void’ to ‘unsigned char’ [-fpermissive] unsigned char select_text = se_p->to_bytes(); Fixing it and removing the to become: damgard_jurik_ciphertext_t c_3 = (c_1^text_1) (c_2^text_2); 4)Fourth error: invalid conversion from ‘void’ to ‘unsigned char’ [-fpermissive] unsigned char *select_text = se_p->to_bytes(); If you could please provide me with a working example and how to use it to perform onion encryption I would be very grateful. Thank you and regards,Kholoud From: Jianyu notifications@github.com To: jianyu-m/damgard_jurik damgard_jurik@noreply.github.com Cc: kholoudAlSaleh kholoud_alsaleh@yahoo.com; Author author@noreply.github.com Sent: Monday, November 6, 2017 5:24 AM Subject: Re: [jianyu-m/damgard_jurik] Example does not work (#1) Hi,Can you show me the error? As it is an old project, and i stop maintaining it.— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

hey, after you fixed, include with , there is an error "undefined reference to randombytes_buf. Could you kindly throw some light ?

jiangjianyu commented 3 years ago

Thank you for taking the time to see it. 1)At first it gives an error for the header :No such file or directory #include , I changed it to #include 2)Then after fixing that, the errors are the following: error: ‘text_1_c’ was not declared in this scope damgard_jurik_ciphertext_t c_3 = (c_1^text_1_c) (c_2^text_2_c); ^ encryption.cpp:23:60: error: ‘text_2_c’ was not declared in this scope damgard_jurik_ciphertext_t c_3 = (c_1^text_1_c) (_c_2^_text_2c); ^ encryption.cpp:25:45: error: invalid conversion from ‘void’ to ‘unsigned char_’ [-fpermissive] unsigned char select_text = se_p->to_bytes() Fixing : damgard_jurik_ciphertext_t c_3 = (c_1^text_1_c) (c_2^text_2_c); to damgard_jurik_ciphertext_t c_3 = (c_1^text_1) (c_2^_text2); 3) Third error:no match for ‘operator’ (operand type is ‘damgard_jurik_plaintext_t’) damgard_jurik_ciphertext_t c_3 = (c_1^_text_1) (_c_2^_text_2); ^ encryption.cpp:23:40: note: candidate is: In file included from encryption.cpp:4:0: ../src/damgard_jurik.h:112:28: note: damgard_jurik_ciphertextt operator(damgard_jurik_ciphertext_t, damgard_jurik_ciphertext_t) damgard_jurik_ciphertextt operator(damgard_jurik_ciphertext_t a, damgard_jurik_ciphertext_t b); ^ ../src/damgardjurik.h:112:28: note: candidate expects 2 arguments, 1 provided encryption.cpp:23:57: error: no match for ‘operator’ (operand type is ‘damgard_jurik_plaintext_t’) damgard_jurik_ciphertext_t c_3 = (_c_1^_text_1) (_c_2^_text_2); ^ encryption.cpp:23:57: note: candidate is: In file included from encryption.cpp:4:0: ../src/damgard_jurik.h:112:28: note: damgard_jurik_ciphertextt operator(damgard_jurik_ciphertext_t, damgard_jurik_ciphertext_t) damgard_jurik_ciphertextt operator(damgard_jurik_ciphertext_t a, damgard_jurik_ciphertext_t b); ^ ../src/damgardjurik.h:112:28: note: candidate expects 2 arguments, 1 provided encryption.cpp:25:45: error: invalid conversion from ‘void’ to ‘unsigned char_’ [-fpermissive] unsigned char select_text = se_p->to_bytes(); Fixing it and removing the to become: damgard_jurik_ciphertext_t c_3 = (_c_1^text_1) (_c_2^text2); 4)Fourth error: invalid conversion from ‘void’ to ‘unsigned char_’ [-fpermissive] unsigned char *select_text = se_p->to_bytes(); If you could please provide me with a working example and how to use it to perform onion encryption I would be very grateful. Thank you and regards,Kholoud From: Jianyu notifications@github.com To: jianyu-m/damgard_jurik damgard_jurik@noreply.github.com Cc: kholoudAlSaleh kholoud_alsaleh@yahoo.com; Author author@noreply.github.com Sent: Monday, November 6, 2017 5:24 AM Subject: Re: [jianyu-m/damgard_jurik] Example does not work (#1) Hi,Can you show me the error? As it is an old project, and i stop maintaining it.— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

hey, after you fixed, include with , there is an error "undefined reference to randombytes_buf. Could you kindly throw some light ?

You should also link with sodium. you can do this by adding -lsodium to the g++ flag.