From 4de50e2390a2779a10ef850a2a5d3d7243af409f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Pr=C3=BC=C3=9Fner?= Date: Sat, 3 May 2014 13:51:00 +0200 Subject: [PATCH] removed redundant multiplication functions --- src/ntru_decrypt.c | 17 +++-------------- src/ntru_decrypt.h | 2 -- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/ntru_decrypt.c b/src/ntru_decrypt.c index d7562a2..cfe08f4 100644 --- a/src/ntru_decrypt.c +++ b/src/ntru_decrypt.c @@ -20,6 +20,7 @@ */ #include "ntru_decrypt.h" +#include "poly.h" /* * Legend @@ -38,7 +39,7 @@ int ntru_decrypt(char *encr_msg, pb_poly *private_key, ntru_context *context, char ** decr_msg){ // toDo q = ?, p = ?, fp = ? - pb_poly *a = first_multiply(private_key, encr_msg, q);// StarMultiply(f, e, a, N, q) + //toDO StarMultiply(f, e, a, N, q) for(int i = 0, i < N, i++){ if(a[i] < 0 ) { @@ -48,20 +49,8 @@ int ntru_decrypt(char *encr_msg, pb_poly *private_key, ntru_context *context, ch a[i] = a[i] - q // Shift coefficients of a into range (−q/2, q/2) } } - char* d = second_multiply(a, fp, p)// StarMultiply(a, Fp , d, N, p) + //toDo StarMultiply(a, Fp , d, N, p) // {Decode returns the decrypted message, d, through the argument list.} return d; } - -// toDo fix header file definition and types if needed! -pb_poly* first_multiply(pb_poly *private_key, char *encr_msg, int q) { - // toDo a= f*e mod q - return NULL; -} - -// toDo fix header file definition and types if needed! -char* second_multiply(pb_poly *a, pb_poly *fp, int p) { - //toDo a*Fp mod p - return NULL; -} diff --git a/src/ntru_decrypt.h b/src/ntru_decrypt.h index 92ac915..9da81cc 100644 --- a/src/ntru_decrypt.h +++ b/src/ntru_decrypt.h @@ -26,7 +26,5 @@ #include "context.h" int ntru_decrypt(char *encr_msg, pb_poly *private_key, ntru_context *context, char ** decr_msg); -pb_poly* first_multiply(pb_poly*, char*, int); -char* first_multiply(pb_poly*, pb_poly*, int); #endif /* NTRU_DECRYPT */