From b4ba4112e5a283166fb09e3ad10a295a60f5dcc3 Mon Sep 17 00:00:00 2001 From: Alexander Rolfes Date: Sat, 3 May 2014 13:32:59 +0200 Subject: [PATCH] Revert "first implementation of "pseudocode algorithm" (ms_corourke.pdf)" This reverts commit ecdc32f5e0a55fc6ce647105d0234a97a3f6481e. --- src/ntru_decrypt.c | 37 +++---------------------------------- src/ntru_decrypt.h | 2 -- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/src/ntru_decrypt.c b/src/ntru_decrypt.c index d7562a2..3a46676 100644 --- a/src/ntru_decrypt.c +++ b/src/ntru_decrypt.c @@ -19,27 +19,9 @@ * MA 02110-1301 USA */ -#include "ntru_decrypt.h" - -/* - * Legend - * - * N : highest degree of the polynom - * q : "is given" (... mod q) - * p : "is given" (... mod p) - * f : private key - * Fp: inverse of "modulo p" - * e : encrypted message - * a : result of first multiplication (StarMultiply(f, e, a, N, q)) - * d : result of second multiplication (StarMultiply(a, Fp , d, N, p)), decrypted message - * */ - // Require: N , q, p, secret key f , inverse polynomial Fp , and encrypted message e. 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) - + // StarMultiply(f, e, a, N, q) for(int i = 0, i < N, i++){ if(a[i] < 0 ) { a[i] = a[i] + q; // Make all coefficients positive @@ -48,20 +30,7 @@ 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) - + // 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; + return 0; } 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 */