├── README.md ├── access.c ├── access.h ├── alu.c ├── alu.h ├── crypto.c ├── crypto.h ├── cu.c ├── cu.h ├── key1024.pk ├── key1024.sk ├── key384.pk ├── key384.sk ├── key512.pk ├── key512.sk ├── key768.pk ├── key768.sk ├── kit.c ├── kit.h ├── test.c ├── trans.c └── trans.h /README.md: -------------------------------------------------------------------------------- 1 | Shape CPU (C Implementation) 2 | ============================ 3 | 4 | Introduction 5 | ============ 6 | 7 | A growing number of compute and data storage jobs is performed on remote resources. In a cloud environment the customer can’t be sure where a particular job is physically executed and thus cannot rely on the security and confidentiality of the remote resource. A solution for this problem is the operation on encrypted functions and encrypted data. This enables a customer to generate a program that can be executed by a third party, without revealing the underlying algorithm or the processed data. This helps securing applications and data in a distributed digital ecosystem. The shapeCPU is a method to compute a secret program on an untrusted resource using fully homomorphic encrypted circuits. The concept solves the problems of encrypted storage access with encrypted addresses and encrypted branching: in contrast to other approaches, like static one-pass circuit simulations, our system supports dynamic parameters and non-sequential programs, that render branch-decisions at runtime and cannot be represented in a circuit with hard-wired in-circuit parameters and data. 8 | 9 | Currently the runtime properties of the shapeCPU are very slow due to the underlying homomorphic cryptographic operations. We hope this open source project can serve as a foundation to actively encourage research and participation into optimizing both the cryptographic performance as well as the CPU performance. If you are interested in collaborating with us please drop us a line. 10 | 11 | The C implementation is currently limited to memory access and a rudimentary control unit. Our Java implementation comprises the reference runtime environment for an encrypted program and an assembler skeleton to generate the encrypted machine code. However, the Java version does not encrypt but feel free to interface with libScarab via JNI. Find the source code on github under hcrypt-project/obliviousJ. 12 | 13 | I'm currently converting the Java-based control unit and the loader to C. Should be ready during Jan-2014 (edit April-13: didn't have the time so far, hold on) 14 | 15 | References 16 | ========== 17 | 18 | [1] M. Brenner, J. Wiebelitz, G. v. Voigt, M. Smith, Secret Program Execution in the Cloud applying Homomorphic Encryption, Proceedings of the 5th IEEE International Conference on Digital Ecosystems and Technologies (IEEE DEST 2011) 19 | 20 | [2] M. Brenner, J. Wiebelitz, G. v. Voigt, M. Smith, A Smart-Gentry based Software System for Secret Program Execution, Proceedings of the 6th International Conference on Security and Cryptography (SECRYPT 2011) 21 | 22 | [3] H. Perl, M. Brenner, M. Smith, POSTER: An Implementation of the Fully Homomorphic Smart-Vercauteren Crypto-System, Proceedings of the 18th ACM Conference on Computer and Communications Security (ACM CCS 2011) 23 | 24 | [4] H. Perl, Y. Mohammed, M. Brenner, M. Smith, Fast Confidential Search for Bio-Medical Data Using Bloom Filters and Homomorphic Cryptography,Proceedings of the 8th IEEE International Conference on eScience (IEEE eScience 2012) 25 | 26 | [5] M. Brenner, H. Perl, M. Smith, Practical Applications of Homomorphic Encryption,Proceedings of the 7th International Conference on Security and Cryptography (SECRYPT 2012) 27 | 28 | [6] M. Brenner, H. Perl, M. Smith, How Practical is Homomorphically Encrypted Program Execution? An Implementation and Performance Evaluation,11th IEEE International Conference on Trust, Security and Privacy in Computing and Communications (IEEE TrustCom-2012) 29 | 30 | [7] M. Brenner, M. Smith, POSTER: Caching Oblivious Memory Access under Fully Homomorphic Encryption, Proceedings of the 20th ACM Conference on Computer and Communications Security (ACM CCS 2013) 31 | 32 | License 33 | ======= 34 | 35 | Copyright © 2011 36 | 37 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 38 | 39 | SOFTWARE AND SOURCE CODE MAY BE DOWNLOADED AND MODIFIED FOR EDUCATIONAL OR ACADEMIC USE. PATENT PCT/EP2678772B1. 40 | -------------------------------------------------------------------------------- /access.c: -------------------------------------------------------------------------------- 1 | /* 2 | * access.c 3 | * 4 | * Created on: 13.03.2012 5 | * Author: michaelbrenner 6 | */ 7 | #include "access.h" 8 | #include "crypto.h" 9 | #include "integer-fhe.h" 10 | #include 11 | 12 | void access_set(fhe_int_t m,int i,fhe_pk_t pk) 13 | { 14 | fhe_int_encrypt(m,pk,i); 15 | } 16 | 17 | void access_init(int rows,int cols,fhe_pk_t pk) 18 | { 19 | access_rowselect=malloc(rows*sizeof(_fhe_int)); 20 | 21 | for(int i=0;impz,sk)); 65 | } 66 | printf("\n"); 67 | } 68 | printf("---dump %d end ---\n",count); 69 | } 70 | 71 | 72 | // implements oblivious memory access 73 | // 74 | clock_t accessr(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk) 75 | { 76 | //timeval start, end; 77 | clock_t _clock; 78 | // adr[0] is lsb 79 | fhe_int_t sel,nsel; 80 | fhe_int_t temp,temp2; 81 | //fhe_int_t nrw; 82 | _fhe_int *nadr; 83 | //fmpz *reg; 84 | //gettimeofday(&start, 0); 85 | _clock=clock(); 86 | 87 | fhe_int_init(temp); 88 | fhe_int_init(temp2); 89 | fhe_int_init(sel); 90 | //fhe_int_init(nrw); 91 | fhe_int_init(nsel); 92 | 93 | //fhe_int_not(nrw,rw,pk); 94 | 95 | //generate inverse address bits 96 | nadr=vec_init(ADR_BITS); 97 | 98 | 99 | for(int i=0;i0)?&adr[i]:&nadr[i],pk); 117 | } 118 | fhe_int_not(nsel,sel,pk); 119 | 120 | //printf("row %d %d\n",a,fhe_decrypt(sel->mpz,sk)); 121 | 122 | for(int i=0;inoise); 128 | } 129 | printf(")"); 130 | } 131 | printf("\n"); 132 | vec_clear(nadr,ADR_BITS); 133 | //_fmpz_vec_clear(reg,DATA_BITS); 134 | fhe_int_clear(temp); 135 | fhe_int_clear(temp2); 136 | fhe_int_clear(sel); 137 | fhe_int_clear(nsel); 138 | //fhe_int_clear(nrw); 139 | 140 | //gettimeofday(&end, 0); 141 | 142 | return clock()-_clock; 143 | } 144 | 145 | // implements oblivious memory access 146 | // 147 | clock_t accessr_thr0(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y) 148 | { 149 | //timeval start, end; 150 | clock_t _clock; 151 | // adr[0] is lsb 152 | fhe_int_t sel,nsel; 153 | fhe_int_t temp,temp2; 154 | //fhe_int_t nrw; 155 | _fhe_int *nadr; 156 | //fmpz *reg; 157 | //gettimeofday(&start, 0); 158 | _clock=clock(); 159 | 160 | fhe_int_init(temp); 161 | fhe_int_init(temp2); 162 | fhe_int_init(sel); 163 | //fhe_int_init(nrw); 164 | fhe_int_init(nsel); 165 | 166 | //fhe_int_not(nrw,rw,pk); 167 | 168 | //generate inverse address bits 169 | nadr=vec_init(ADR_BITS); 170 | 171 | 172 | for(int i=0;i0)?&adr[i]:&nadr[i],pk); 190 | } 191 | fhe_int_not(nsel,sel,pk); 192 | 193 | //printf("row %d %d\n",a,fhe_decrypt(sel->mpz,sk)); 194 | 195 | for(int i=0;inoise); 201 | } 202 | //printf(")"); 203 | } 204 | //printf("\n"); 205 | vec_clear(nadr,ADR_BITS); 206 | //_fmpz_vec_clear(reg,DATA_BITS); 207 | fhe_int_clear(temp); 208 | fhe_int_clear(temp2); 209 | fhe_int_clear(sel); 210 | fhe_int_clear(nsel); 211 | //fhe_int_clear(nrw); 212 | 213 | //gettimeofday(&end, 0); 214 | 215 | return clock()-_clock; 216 | } 217 | clock_t accessr_thr1(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y) 218 | { 219 | //timeval start, end; 220 | clock_t _clock; 221 | // adr[0] is lsb 222 | fhe_int_t sel,nsel; 223 | fhe_int_t temp,temp2; 224 | //fhe_int_t nrw; 225 | _fhe_int *nadr; 226 | //fmpz *reg; 227 | //gettimeofday(&start, 0); 228 | _clock=clock(); 229 | 230 | fhe_int_init(temp); 231 | fhe_int_init(temp2); 232 | fhe_int_init(sel); 233 | //fhe_int_init(nrw); 234 | fhe_int_init(nsel); 235 | 236 | //fhe_int_not(nrw,rw,pk); 237 | 238 | //generate inverse address bits 239 | nadr=vec_init(ADR_BITS); 240 | 241 | 242 | for(int i=0;i0)?&adr[i]:&nadr[i],pk); 260 | } 261 | fhe_int_not(nsel,sel,pk); 262 | 263 | //printf("row %d %d\n",a,fhe_decrypt(sel->mpz,sk)); 264 | 265 | for(int i=0;inoise); 271 | } 272 | //printf(")"); 273 | } 274 | //printf("\n"); 275 | vec_clear(nadr,ADR_BITS); 276 | //_fmpz_vec_clear(reg,DATA_BITS); 277 | fhe_int_clear(temp); 278 | fhe_int_clear(temp2); 279 | fhe_int_clear(sel); 280 | fhe_int_clear(nsel); 281 | //fhe_int_clear(nrw); 282 | 283 | //gettimeofday(&end, 0); 284 | 285 | return clock()-_clock; 286 | } 287 | clock_t accessr_thr2(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y) 288 | { 289 | //timeval start, end; 290 | clock_t _clock; 291 | // adr[0] is lsb 292 | fhe_int_t sel,nsel; 293 | fhe_int_t temp,temp2; 294 | //fhe_int_t nrw; 295 | _fhe_int *nadr; 296 | //fmpz *reg; 297 | //gettimeofday(&start, 0); 298 | _clock=clock(); 299 | 300 | fhe_int_init(temp); 301 | fhe_int_init(temp2); 302 | fhe_int_init(sel); 303 | //fhe_int_init(nrw); 304 | fhe_int_init(nsel); 305 | 306 | //fhe_int_not(nrw,rw,pk); 307 | 308 | //generate inverse address bits 309 | nadr=vec_init(ADR_BITS); 310 | 311 | 312 | for(int i=0;i0)?&adr[i]:&nadr[i],pk); 330 | } 331 | fhe_int_not(nsel,sel,pk); 332 | 333 | //printf("row %d %d\n",a,fhe_decrypt(sel->mpz,sk)); 334 | 335 | for(int i=0;inoise); 341 | } 342 | //printf(")"); 343 | } 344 | //printf("\n"); 345 | vec_clear(nadr,ADR_BITS); 346 | //_fmpz_vec_clear(reg,DATA_BITS); 347 | fhe_int_clear(temp); 348 | fhe_int_clear(temp2); 349 | fhe_int_clear(sel); 350 | fhe_int_clear(nsel); 351 | //fhe_int_clear(nrw); 352 | 353 | //gettimeofday(&end, 0); 354 | 355 | return clock()-_clock; 356 | } 357 | clock_t accessr_thr3(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y) 358 | { 359 | //timeval start, end; 360 | clock_t _clock; 361 | // adr[0] is lsb 362 | fhe_int_t sel,nsel; 363 | fhe_int_t temp,temp2; 364 | //fhe_int_t nrw; 365 | _fhe_int *nadr; 366 | //fmpz *reg; 367 | //gettimeofday(&start, 0); 368 | _clock=clock(); 369 | 370 | fhe_int_init(temp); 371 | fhe_int_init(temp2); 372 | fhe_int_init(sel); 373 | //fhe_int_init(nrw); 374 | fhe_int_init(nsel); 375 | 376 | //fhe_int_not(nrw,rw,pk); 377 | 378 | //generate inverse address bits 379 | nadr=vec_init(ADR_BITS); 380 | 381 | 382 | for(int i=0;i0)?&adr[i]:&nadr[i],pk); 400 | } 401 | fhe_int_not(nsel,sel,pk); 402 | 403 | //printf("row %d %d\n",a,fhe_decrypt(sel->mpz,sk)); 404 | 405 | for(int i=0;inoise); 411 | } 412 | //printf(")"); 413 | } 414 | //printf("\n"); 415 | vec_clear(nadr,ADR_BITS); 416 | //_fmpz_vec_clear(reg,DATA_BITS); 417 | fhe_int_clear(temp); 418 | fhe_int_clear(temp2); 419 | fhe_int_clear(sel); 420 | fhe_int_clear(nsel); 421 | //fhe_int_clear(nrw); 422 | 423 | //gettimeofday(&end, 0); 424 | 425 | return clock()-_clock; 426 | } 427 | // implements oblivious memory access on memory bank 0 428 | // 429 | clock_t accessr0(_fhe_int *adr,_fhe_int *data,fhe_int_t *row,fhe_pk_t pk,fhe_sk_t sk) 430 | { 431 | //timeval start, end; 432 | clock_t _clock; 433 | // adr[0] is lsb 434 | fhe_int_t sel,nsel; 435 | fhe_int_t temp,temp2; 436 | //fhe_int_t nrw; 437 | _fhe_int *nadr; 438 | //fmpz *reg; 439 | //gettimeofday(&start, 0); 440 | _clock=clock(); 441 | 442 | fhe_int_init(temp); 443 | fhe_int_init(temp2); 444 | fhe_int_init(sel); 445 | //fhe_int_init(nrw); 446 | fhe_int_init(nsel); 447 | 448 | fhe_int_encrypt(*row,pk,0); //row signal aus bank 0 449 | 450 | //fhe_int_not(nrw,rw,pk); 451 | 452 | //generate inverse address bits 453 | nadr=vec_init(ADR_BITS); 454 | 455 | 456 | for(int i=0;i0)?&adr[i]:&nadr[i],pk); 474 | } 475 | fhe_int_not(nsel,sel,pk); 476 | fhe_int_xor(*row,*row,sel,pk); 477 | 478 | printf("bank0:rowsel%d=%d (row=%d)\n",a,fhe_decrypt(sel->mpz,sk),fhe_decrypt((*row)->mpz,sk)); 479 | 480 | //printf("row %d %d\n",a,fhe_decrypt(sel->mpz,sk)); 481 | 482 | for(int i=0;inoise); 488 | } 489 | //printf(")"); 490 | } 491 | //printf("\n"); 492 | vec_clear(nadr,ADR_BITS); 493 | //_fmpz_vec_clear(reg,DATA_BITS); 494 | fhe_int_clear(temp); 495 | fhe_int_clear(temp2); 496 | fhe_int_clear(sel); 497 | fhe_int_clear(nsel); 498 | //fhe_int_clear(nrw); 499 | 500 | //gettimeofday(&end, 0); 501 | 502 | return clock()-_clock; 503 | } 504 | 505 | // implements oblivious memory access on memory bank 1 506 | // 507 | clock_t accessr1(_fhe_int *adr,_fhe_int *data,fhe_int_t *row,fhe_pk_t pk,fhe_sk_t sk) 508 | { 509 | //timeval start, end; 510 | clock_t _clock; 511 | // adr[0] is lsb 512 | fhe_int_t sel,nsel; 513 | fhe_int_t temp,temp2; 514 | //fhe_int_t nrw; 515 | _fhe_int *nadr; 516 | //fmpz *reg; 517 | //gettimeofday(&start, 0); 518 | _clock=clock(); 519 | 520 | fhe_int_init(temp); 521 | fhe_int_init(temp2); 522 | fhe_int_init(sel); 523 | //fhe_int_init(nrw); 524 | fhe_int_init(nsel); 525 | 526 | fhe_int_encrypt(*row,pk,0); //row signal aus bank 1 527 | //fhe_int_not(nrw,rw,pk); 528 | 529 | //generate inverse address bits 530 | nadr=vec_init(ADR_BITS); 531 | 532 | 533 | for(int i=0;i0)?&adr[i]:&nadr[i],pk); 551 | } 552 | fhe_int_not(nsel,sel,pk); 553 | fhe_int_xor(*row,*row,sel,pk); 554 | 555 | printf("bank1:rowsel%d=%d (row=%d)\n",a,fhe_decrypt(sel->mpz,sk),fhe_decrypt((*row)->mpz,sk)); 556 | 557 | //printf("row %d %d\n",a,fhe_decrypt(sel->mpz,sk)); 558 | 559 | for(int i=0;inoise); 565 | } 566 | //printf(")"); 567 | } 568 | //printf("\n"); 569 | vec_clear(nadr,ADR_BITS); 570 | //_fmpz_vec_clear(reg,DATA_BITS); 571 | fhe_int_clear(temp); 572 | fhe_int_clear(temp2); 573 | fhe_int_clear(sel); 574 | fhe_int_clear(nsel); 575 | //fhe_int_clear(nrw); 576 | 577 | //gettimeofday(&end, 0); 578 | 579 | return clock()-_clock; 580 | } 581 | 582 | 583 | clock_t accessw(/*fhe_int_t rw,*/_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk) 584 | { 585 | //timeval start, end; 586 | clock_t _clock; 587 | // adr[0] is lsb 588 | fhe_int_t sel,nsel; 589 | fhe_int_t temp,temp2; 590 | //fhe_int_t nrw; 591 | _fhe_int *nadr; 592 | //fmpz *reg; 593 | //gettimeofday(&start, 0); 594 | _clock=clock(); 595 | 596 | fhe_int_init(temp); 597 | fhe_int_init(temp2); 598 | fhe_int_init(sel); 599 | //fhe_int_init(nrw); 600 | fhe_int_init(nsel); 601 | 602 | //fhe_int_not(nrw,rw,pk); 603 | 604 | //generate inverse address bits 605 | nadr=vec_init(ADR_BITS); 606 | 607 | 608 | for(int i=0;i0)?&adr[i]:&nadr[i],pk); 625 | } 626 | fhe_int_not(nsel,sel,pk); 627 | 628 | for(int i=0;i 14 | #include 15 | 16 | #define RUNS 10 17 | #define WORD_SIZE 11 18 | #define DATA_BITS 8 19 | #define ADR_BITS 5 20 | // ROWS = 2^ADR_BITS 21 | #define ROWS 32 22 | #define READ 1 23 | #define WRITE 0 24 | 25 | int access_array_noises[RUNS][ROWS*WORD_SIZE]; 26 | int access_reg_noises[RUNS]; 27 | _fhe_int* access_array; 28 | _fhe_int* access_rowselect; 29 | int *access_array_noise; 30 | 31 | clock_t accessr_thr0(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y); 32 | clock_t accessr_thr1(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y); 33 | clock_t accessr_thr2(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y); 34 | clock_t accessr_thr3(_fhe_int *adr,_fhe_int *data,fhe_pk_t pk,fhe_sk_t sk,int x,int y); 35 | clock_t accessr(/*fhe_int_t rw*/_fhe_int *adr, _fhe_int *data,fhe_pk_t pk,fhe_sk_t sk); 36 | clock_t accessr0(/*fhe_int_t rw*/_fhe_int *adr, _fhe_int *data,fhe_int_t *row,fhe_pk_t pk,fhe_sk_t sk); 37 | clock_t accessr1(/*fhe_int_t rw*/_fhe_int *adr, _fhe_int *data,fhe_int_t *row,fhe_pk_t pk,fhe_sk_t sk); 38 | clock_t accessw(/*fhe_int_t rw*/_fhe_int *adr, _fhe_int *data,fhe_pk_t pk,fhe_sk_t sk); 39 | void access_init(int rows,int cols,fhe_pk_t pk); 40 | void access_clear(int rows,int cols); 41 | void access_dump(int rows,int cols,fhe_sk_t sk); 42 | void access_set(fhe_int_t m,int i,fhe_pk_t pk); 43 | _fhe_int* vec_init(int size); 44 | void vec_clear(_fhe_int *vec,int size); 45 | 46 | #endif /* ACCESS_H_ */ 47 | -------------------------------------------------------------------------------- /alu.c: -------------------------------------------------------------------------------- 1 | /* 2 | * alu.c 3 | * 4 | * Created on: 17.03.2012 5 | * Author: michaelbrenner 6 | */ 7 | 8 | /* this ALU has 2-bit opcodes 9 | * 10 | * 00 or 11 | * 01 xor 12 | * 10 and 13 | * 11 add 14 | */ 15 | 16 | #include "alu.h" 17 | 18 | clock_t alu3(_fhe_int *into,_fhe_int *opcode,fhe_int_t carry, 19 | _fhe_int *op1, _fhe_int *op2,fhe_pk_t pk,fhe_sk_t sk) 20 | { 21 | clock_t _clock; 22 | _fhe_int *or; 23 | _fhe_int *xor; 24 | _fhe_int *and; 25 | _fhe_int *add; 26 | _fhe_int *nopcode; 27 | fhe_int_t temp; 28 | fhe_int_t sel_or; 29 | fhe_int_t sel_xor; 30 | fhe_int_t sel_and; 31 | fhe_int_t sel_add; 32 | 33 | _clock=clock(); 34 | 35 | nopcode=vec_init(2); 36 | for(int i=0;i<2;i++) 37 | { 38 | fhe_int_not(&nopcode[i],&opcode[i],pk); 39 | } 40 | 41 | or=vec_init(DATA_BITS); 42 | xor=vec_init(DATA_BITS); 43 | and=vec_init(DATA_BITS); 44 | add=vec_init(DATA_BITS+1); 45 | fhe_int_init(temp); 46 | fhe_int_init(sel_or); 47 | fhe_int_init(sel_xor); 48 | fhe_int_init(sel_and); 49 | fhe_int_init(sel_add); 50 | 51 | for(int i=0;i 16 | 17 | #define OPCODE_OR 0 18 | #define OPCODE_XOR 1 19 | #define OPCODE_AND 2 20 | #define OPCODE_ADD 3 21 | 22 | clock_t alu3(_fhe_int *into,_fhe_int *opcode,fhe_int_t carry, 23 | _fhe_int *op1, _fhe_int *op2,fhe_pk_t pk,fhe_sk_t sk); 24 | 25 | #endif /* ALU_H_ */ 26 | -------------------------------------------------------------------------------- /crypto.c: -------------------------------------------------------------------------------- 1 | /* 2 | * crypto.c 3 | * 4 | * Created on: 13.03.2012 5 | * Author: michaelbrenner 6 | */ 7 | 8 | #include "crypto.h" 9 | 10 | void crypto_add(mpz_t into,mpz_t a,mpz_t b,fhe_pk_t pk) 11 | { 12 | fhe_add(into,a,b,pk); 13 | } 14 | 15 | void crypto_mul(mpz_t into,mpz_t a,mpz_t b,fhe_pk_t pk) 16 | { 17 | fhe_mul(into,a,b,pk); 18 | } 19 | 20 | void crypto_xor(mpz_t into,mpz_t a,mpz_t b,fhe_pk_t pk) 21 | { 22 | fhe_add(into,a,b,pk); 23 | } 24 | 25 | void crypto_and(mpz_t into,mpz_t a,mpz_t b,fhe_pk_t pk) 26 | { 27 | fhe_mul(into,a,b,pk); 28 | } 29 | 30 | void crypto_or(mpz_t into,mpz_t a,mpz_t b,fhe_pk_t pk) 31 | { 32 | mpz_t temp; 33 | mpz_init(temp); 34 | 35 | fhe_mul(temp,a,b,pk); 36 | fhe_add(into,a,b,pk); 37 | fhe_add(into,into,temp,pk); 38 | 39 | mpz_clear(temp); 40 | } 41 | 42 | void crypto_not(mpz_t into,mpz_t a,fhe_pk_t pk) 43 | { 44 | mpz_t one; 45 | mpz_init(one); 46 | 47 | fhe_encrypt(one,pk,1); 48 | fhe_add(into,a,one,pk); 49 | 50 | mpz_clear(one); 51 | } 52 | -------------------------------------------------------------------------------- /crypto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * crypto.h 3 | * 4 | * Created on: 13.03.2012 5 | * Author: michaelbrenner 6 | */ 7 | 8 | #ifndef CRYPTO_H_ 9 | #define CRYPTO_H_ 10 | 11 | #include "integer-fhe.h" 12 | 13 | void crypto_xor(mpz_t into,mpz_t a,mpz_t b,fhe_pk_t pk); 14 | 15 | void crypto_and(mpz_t into,mpz_t a,mpz_t b,fhe_pk_t pk); 16 | 17 | void crypto_add(mpz_t into,mpz_t a,mpz_t b,fhe_pk_t pk); 18 | 19 | void crypto_mul(mpz_t into,mpz_t a,mpz_t b,fhe_pk_t pk); 20 | 21 | void crypto_or(mpz_t into,mpz_t a,mpz_t b,fhe_pk_t pk); 22 | 23 | void crypto_not(mpz_t into,mpz_t a,fhe_pk_t pk); 24 | 25 | #endif /* CRYPTO_H_ */ 26 | -------------------------------------------------------------------------------- /cu.c: -------------------------------------------------------------------------------- 1 | /* 2 | * cu.c 3 | * 4 | * Created on: 19.03.2012 5 | * Author: michaelbrenner 6 | */ 7 | 8 | #include "cu.h" 9 | extern clock_t _mem; 10 | 11 | clock_t cu(fhe_pk_t pk,fhe_sk_t sk) 12 | { 13 | clock_t _clock; 14 | int brk=0; 15 | _fhe_int *ac,*temp,*temp2,*alu_i,*alu_a; 16 | _fhe_int *pc; 17 | fhe_int_t carry; 18 | fhe_int_t zero; 19 | fhe_int_t read; 20 | fhe_int_t write; 21 | 22 | access_init(ROWS,WORD_SIZE,pk); 23 | 24 | fhe_int_init(carry); 25 | fhe_int_init(zero); 26 | fhe_int_init(read); 27 | fhe_int_init(write); 28 | ac=vec_init(DATA_BITS); 29 | pc=vec_init(ADR_BITS); 30 | temp=vec_init(WORD_SIZE); 31 | temp2=vec_init(WORD_SIZE); 32 | alu_i=vec_init(DATA_BITS); 33 | alu_a=vec_init(DATA_BITS); 34 | fhe_int_encrypt(read,pk,READ); 35 | fhe_int_encrypt(write,pk,WRITE); 36 | 37 | trans_int2data(3,ac,pk); 38 | trans_int2adr(0,pc,pk); 39 | trans_int2vec(0,temp,WORD_SIZE,pk); 40 | trans_int2vec(0,temp2,WORD_SIZE,pk); 41 | 42 | trans_int2mem(3+8,0,pk); 43 | trans_int2mem(16,1,pk); 44 | 45 | //access_dump(ROWS,WORD_SIZE,sk); 46 | 47 | _clock=clock(); 48 | 49 | while(!brk) 50 | { 51 | clock_t c=0; 52 | //FETCH immediate 53 | c=accessr(pc,temp,pk,sk); 54 | //printf("CU access i = ");trans_print(temp,WORD_SIZE,sk);printf("\n"); 55 | printf("m1=%ld ",c/CLOCKS_PER_SEC);fflush(stdout); 56 | _mem+=c; 57 | //printf("CU addr a = ");trans_print(&temp[3],ADR_BITS,sk);printf("\n"); 58 | //FETCH absolute 59 | c=accessr(&temp[3],temp2,pk,sk); 60 | //printf("CU access a = ");trans_print(temp2,WORD_SIZE,sk);printf("\n"); 61 | printf("m2=%ld ",c/CLOCKS_PER_SEC);fflush(stdout); 62 | _mem+=c; 63 | //ALU immediate 64 | alu3(alu_i,temp,carry,ac,&temp[3],pk,sk); 65 | //printf("CU alu i = ");trans_print(alu_i,DATA_BITS,sk);printf("\n"); 66 | 67 | //ALU absolute 68 | alu3(alu_a,temp,carry,ac,&temp2[3],pk,sk); 69 | //printf("CU alu a = ");trans_print(alu_a,DATA_BITS,sk);printf("\n"); 70 | 71 | c=accessw(&temp[3],temp2,pk,sk); 72 | printf("m3=%ld ",c/CLOCKS_PER_SEC);fflush(stdout); 73 | _mem+=c; 74 | 75 | brk=1; 76 | } 77 | _clock=clock()-_clock; 78 | printf("%ld",_clock/CLOCKS_PER_SEC); 79 | 80 | fhe_int_clear(carry); 81 | fhe_int_clear(zero); 82 | fhe_int_clear(read); 83 | fhe_int_clear(write); 84 | vec_clear(ac,DATA_BITS); 85 | vec_clear(pc,ADR_BITS); 86 | vec_clear(temp,DATA_BITS); 87 | vec_clear(temp2,DATA_BITS); 88 | vec_clear(alu_i,DATA_BITS); 89 | vec_clear(alu_a,DATA_BITS); 90 | 91 | return _clock; 92 | } 93 | -------------------------------------------------------------------------------- /cu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cu.h 3 | * 4 | * Created on: 19.03.2012 5 | * Author: michaelbrenner 6 | */ 7 | 8 | #ifndef CU_H_ 9 | #define CU_H_ 10 | 11 | #include "access.h" 12 | #include "alu.h" 13 | #include "trans.h" 14 | #include "crypto.h" 15 | #include 16 | 17 | clock_t cu(fhe_pk_t pk,fhe_sk_t sk); 18 | 19 | #endif /* CU_H_ */ 20 | -------------------------------------------------------------------------------- /key1024.pk: -------------------------------------------------------------------------------- 1 | mlee public key (p,alpha,{c[i],B[i]} 2 | 29060014629553407467379951765788641217719927073293164082817988486499186740437592280421434065741829694090984485643264842532703818594725318206555082964514981513195117402514750517466251211615687073163117569633662828170207327320473455962788367969260817741478388227161429788466741670717018265767280625541203585405644154134758080906664009823190623766943445596986985273279784088998769283475131311647332843603531764823034227570768627058085163655404449803110069232826531738116967410492589587013761771783080742112893344501396010157104424225271666571886798788000728139469884053149180330906085536752334787422765387619832619447816707560739813456996946007642987441137773725495160352608656990410392276930380107831627315347530273529301429411837579444726539609210671985406839282709089865760908606156473611467288740113535313530472085018549165984766140310107742785933072402501294325133643572192335032107275529901071439868911345505877431054126716692491293025087461455759094596965810951777296726634072141012645149825479224959874079059225085000633305874708965346699393685885852945004690171281262674004750201702986168495628367365434546466089531613807094842611423596438044895208823179950139559399076729571963440901732948167111997922490294979005058205845468516893626583226122916200432854799774805490343123693082459694908401624890812806089850411874482994304612322519254115365909387928529626809823326028155597492583045259626680227951357943554693618434264323332574814842239075563637794993640103054299338616563159800433018831295128850112019432687668538182402280746487137103306434877826660815645496840237766136010024979475831607936752542785811354620551591643918599994601960044539071288499361664251444090573788609546316331099080980608892117007987706827356766965403227821033879939909650642407122058980429434932884575872332510561606317165990997041725596233604394072835495558675130517865374119908359644600096939241099195161881987891583973599254792025294955440934915853465482847171892970994224194448621978822284764015604395355409674539184162201953085108246791356643605295484722261556696113222178067970313924850582671916746783205361544648319047244425802780130831263731966889408919931628060774422006780061472463181267330551280855135493917299060446726394620253379933111479551940818251556352432261701308481854679252965316611233180695729401502034565265904897601349633272542417507270003400809748828622046444214146943103178425770572423032059361418080898816608175486834897071847314810667132574944720516317851169 3 | 6954885382267243074160975056799976063741753324245929560196802427417987497168665457437947419604320135462311952802083362192829038459876321706634643465177636701458007244649991042417731384840752089172926649492824705146587086039675498901905754619232244278771808823463202692688949054945177120885024339981911527577996035801950330159009770883979437957030417223576043328322107732674945413265501960288622527298739091129129795019589419427160459251862454504318966600932166593084883397767850354269118067475128809889463306545784030592570461287953244477653593329031890941759105198284025329587150873552884264540026514731982177847791227223960742536736859100086873508813499425699096599876225724439239008126086904290900023526458250730597944733536637908364808536566413155267935974824698549627007635564467121945581330805045594587505397842034518005535388645990222295117815507991750825363475449695388277939006237585704723741397193400340444990077823458612699807774496162728492165200432930011250597224685911990106200516036220732535030513786500529417533431602316551099380680538797662092624010752021570214312274871375981070204768075152543304386650591704463358810649400965546093578964727783636852603048342883195471170178693680591621574335597452322590207574665815429799843038148161452978199092448120911996063091843283547003566279837579441420375985133403625485612664918784986745882427219575881063181737444686006152128641725569085681525870275728477350403577096312930289639979895699851245955847289081773558817069396348027260836340912005528291113018879196829476663894412397884564762381915552781305274624434840203282505817719449510090100193355127994085170342538528743772899746631241283055003511883420554713735684815622869734894348822215706604080703352863865959838382578947919297728118088658155802059335717725484674524150918838142601482575423692872639680320223166978478092854342048956173054601161801419997694214553502150964307783744717656490424481995500006080826412968281115220090934686035358128410893067324109327988016418954682859347612876202755036441736247979972894065756808415661974438479747475359569916423245869071769290761378155194976876280742297408495273025565534853406560192437893840333434502646006927306495400389620828897675751954624285013043513444525215669300348048504600906913169231594956136116121416984428643190702935665035222044789704574771048171942087124343281273820822307735686168770905653721588446192478501125325333884473179929228399508905153366336287585966185737020150963467271699581787 4 | 27654642087561027531236592434339256574141313612901479240515038551076141456641376455501290301292856595572227539992165748081240190738890887582897711541932499594263632385606870149716415892878252998603103272433952516963756388379899844964343484239770846584646924901475108099293950403820612034561551141124932014646831339328971410783764255388470470372689949905579966228108520634331053153825917385485303974849550579028723486666975742799958573893034786207075740788740945111057700419941060452780529818670476390373422214551857625934549327430511167569803537947883455575076287200469696799095332329468260440295387470315894195821165183572178479266194405511189672106081891797773536898273935399426655888092924631092716603933957625195624423419744895094543517303540266750931183243618059589761133202850391393329038055988385831537115229719032480746506815672703057761615158903790646615256533297585541297276665930112107974112113214236736431358380214321480965980599761908807557003167352523219162180741666035259958923018458290263132365531357415806560019893139213101704090068157983618587058781807667399162351968410532309133525258208858346508250358871435040449507235146692475464352429416214263007603692165282713109413641522940413351836556942043498604088544689738356708894558766648156166137254974971801669088721871280048475655749655140115578546650566037858113931899104331556170977175873234816136932906213795963523973955177276279767668194721526997516622362844386276895676987522902405080133166907762637665591501736857605409455268397479700930741319583119554903060747875464202660241632291311808105390885708912226242824481493089568791463786329866225702845306053537892436002530017340096187543459915011522095692738220296666147866028444466937339953371457639306582823529940745465349767851451441274220446275915377714271590392202745182917432838578138472114307261542562915681703444390111342661836234836141766647989166390905844812815550203416640946019612630519199799628322082808413470161661074438206119842515276769320547372511218099222461171137226589970105005238658029625587336606866107984666536599430225463328963758291590977848753316832010375339861714427981139563989963050665929655341095631729670406919846805402595989413091798015886926723838873396290224049970218574139364996723673833868877589657826241655538480538735522073210689812012835751476996216677284926882861298775260801720483168232749450925614038721148717733414512561331055333649882620508888262990131425853069798897805660185691937169902260306816228116 5 | 20049077620967981597340113607301130667301390007044175069928511477520514865596997757450319817193877116290362586314782275110747328447101287081493232757024960281208514060234126633498107405991437752221394516877591266888308631655256932343457946626667543465274991845986142262211088631467471550589228750422207598619650539302804327942541405643770174954572831218941767321835469183802171270941001524760309071248488236298696008434301683714739280260399975588635760632341411224231003191486256868676350141891481524247978125562214277613544020572974483388333444090806959786363111526607077878041921319555960678650709758805067292684128623761722302050115864821574074861095926439855213237521708256826925128807894692640436361083704996967874593299819012792561298270752528564711224890573892829069983803681010768815676591542331072396509309363906404551959338907660583981046022819190130861764017311811124881246275084234497304957212768764917706497094495041671099837511580329720247485879986016495099910093506614016134790648209885565149553672561056656063410382819284560089997454951975973777208508431799879838046459364762220037716949396840679463112459405816123343323854206626877007355880196982510632395633975060695135259092101506816800241664352411654608485465078098853887612896704766869306048072043112283864793565925190573949480251682144418003143789222727080948802941092062740566591747721759818623766757527927649487349637903141621463483513135074053096848990103931598374326995679719083880545837006412735996005265248520563870269122560504871159520822054329317220665344715120527799670338506339109069328565478859687773289775540884165588420534201543432746613230389613767944245279612537331113067607938135908401258670944128026238315619649385319633940578489507002788812553051695530392020015204355729631993245973697894726109999840198369024610003578990790429936277328653573156321325822019414423284422178139057422559265553786989330202350854341454326501858020228518714531886658751702189958483480601599487312842048285638983649758211858013640114690814676805049473467955713886720091258473366458670810302103606834397924049433044097531186223704169532088392590025703583620928508004217108803350074981922879483676693164149163548371803913840761823904170915498282081206458947184865944129806140329842448283699381036943944744665972561098428018373619855432830484039446941883091839914696888839021667262130303130519243580424387192927153518516119698851894699011362187070346193173793116657845490561928192356890791631905484315017 6 | 27654642087561027531236592434339256574141313612901479240515038551076141456641376455501290301292856595572227539992165748081240190738890887582897711541932499594263632385606870149716415892878252998603103272433952516963756388379899844964343484239770846584646924901475108099293950403820612034561551141124932014646831339328971410783764255388470470372689949905579966228108520634331053153825917385485303974849550579028723486666975742799958573893034786207075740788740945111057700419941060452780529818670476390373422214551857625934549327430511167569803537947883455575076287200469696799095332329468260440295387470315894195821165183572178479266194405511189672106081891797773536898273935399426655888092924631092716603933957625195624423419744895094543517303540266750931183243618059589761133202850391393329038055988385831537115229719032480746506815672703057761615158903790646615256533297585541297276665930112107974112113214236736431358380214321480965980599761908807557003167352523219162180741666035259958923018458290263132365531357415806560019893139213101704090068157983618587058781807667399162351968410532309133525258208858346508250358871435040449507235146692475464352429416214263007603692165282713109413641522940413351836556942043498604088544689738356708894558766648156166137254974971801669088721871280048475655749655140115578546650566037858113931899104331556170977175873234816136932906213795963523973955177276279767668194721526997516622362844386276895676987522902405080133166907762637665591501736857605409455268397479700930741319583119554903060747875464202660241632291311808105390885708912226242824481493089568791463786329866225702845306053537892436002530017340096187543459915011522095692738220296666147866028444466937339953371457639306582823529940745465349767851451441274220446275915377714271590392202745182917432838578138472114307261542562915681703444390111342661836234836141766647989166390905844812815550203416640946019612630519199799628322082808413470161661074438206119842515276769320547372511218099222461171137226589970105005238658029625587336606866107984666536599430225463328963758291590977848753316832010375339861714427981139563989963050665929655341095631729670406919846805402595989413091798015886926723838873396290224049970218574139364996723673833868877589657826241655538480538735522073210689812012835751476996216677284926882861298775260801720483168232749450925614038721148717733414512561331055333649882620508888262990131425853069798897805660185691937169902260306816228115 7 | -2096722919072072729564973303965376219541588984307800513265355239265903284621068899229046527468668701783975388124202801082769258010285712135394359671666697233608490938890977963539496452602027593384014459946917879570824778721733599404786858458301124117566959342915008998851528045220237453926105744865934742071540250475231117368938784422834968915279364642028681560590655640742261921843677006106577894393094305749369963243177428436880926437002490678046779268795540683848244852547987998041969319259729876989945949153934144519272700524632018854169867967033206238481603874874729608467693466292627589226324919293862140747855425636917911514434924252134827896777462200227822170735609239049720692052280256854864696038598453929815404474621141264535983595781010999876172871539868227020734946050164971527158179586282193837370815221060544212901193435446376826824460779399531382598623535737502483777113947958269470354094950905437483002774911208072311335550354402141253039350804163971578789358143160465621996896528708744749728748763965925505835057377946061867995437042577978938953013800356786093518906078293946093783835453349032904895436993167602936780362172399607105018051627283682908461131246848712086476772042209127801255289655283643657563241833495969413758229770472172093108910979584855520286709354535647017858516582695094393924476935186262645508373628860904437694730488447898049230236318722762005238877121731409782993120527112084011525826464841226739054881742986880567222461192099908099620658283720565374041106967424317749454569419976395759703543723017562834353693245198488427113194880480499461918608679394575725718974252254382367155484490411808273719738880844021672265463724726934049084187156026288797228511519208301813187793205925631378428317907324004714092143921897925671975577695230636291794673809504515218704010524395097153706922624509310048584211036014560008752689416670583089070954707452852464829988177202925756647402515110911724527386385373489234513449781772195080933815935029156438396919854750212377703573664862485609850235294738322051433599551232727878516740670850547018538813403841739522847727605539316522419628688084819339014900068042386081768206605053898213098013776792009770926103490174140837085576134332588934199622895549541066676651798604096761595118644942489023489633575269492255858189301764082788322489101801937738750940611826132347008744550989129442375063161287183176419959163701906150663434139698103985099377646284561348885876799251894601164030422858979933038 8 | 27654642087561027531236592434339256574141313612901479240515038551076141456641376455501290301292856595572227539992165748081240190738890887582897711541932499594263632385606870149716415892878252998603103272433952516963756388379899844964343484239770846584646924901475108099293950403820612034561551141124932014646831339328971410783764255388470470372689949905579966228108520634331053153825917385485303974849550579028723486666975742799958573893034786207075740788740945111057700419941060452780529818670476390373422214551857625934549327430511167569803537947883455575076287200469696799095332329468260440295387470315894195821165183572178479266194405511189672106081891797773536898273935399426655888092924631092716603933957625195624423419744895094543517303540266750931183243618059589761133202850391393329038055988385831537115229719032480746506815672703057761615158903790646615256533297585541297276665930112107974112113214236736431358380214321480965980599761908807557003167352523219162180741666035259958923018458290263132365531357415806560019893139213101704090068157983618587058781807667399162351968410532309133525258208858346508250358871435040449507235146692475464352429416214263007603692165282713109413641522940413351836556942043498604088544689738356708894558766648156166137254974971801669088721871280048475655749655140115578546650566037858113931899104331556170977175873234816136932906213795963523973955177276279767668194721526997516622362844386276895676987522902405080133166907762637665591501736857605409455268397479700930741319583119554903060747875464202660241632291311808105390885708912226242824481493089568791463786329866225702845306053537892436002530017340096187543459915011522095692738220296666147866028444466937339953371457639306582823529940745465349767851451441274220446275915377714271590392202745182917432838578138472114307261542562915681703444390111342661836234836141766647989166390905844812815550203416640946019612630519199799628322082808413470161661074438206119842515276769320547372511218099222461171137226589970105005238658029625587336606866107984666536599430225463328963758291590977848753316832010375339861714427981139563989963050665929655341095631729670406919846805402595989413091798015886926723838873396290224049970218574139364996723673833868877589657826241655538480538735522073210689812012835751476996216677284926882861298775260801720483168232749450925614038721148717733414512561331055333649882620508888262990131425853069798897805660185691937169902260306816228116 9 | 10958191957089952028165957693928930533783319700592048704416353195746858955573262385176748103125403936462711558454835249125430606176143816912679246755131100143692205353449923520216938630759458735783940905614715501105517439577462547019000907471552510235638882215300726137367556105055839974701572548204144972419438664132702942077901568781430992450022988052818640638103282342234706777539679751909598819118692616502166355359038710111620271598179867930650948706569028045066529212390693578087077212179313285979180677972037331981347206692952569236804085775767370825935302254931655919193117216650816466870223622862086645423238074834560759301891971800052785376283522665242352033807868164681307712103594232091884040642625695924758575949253158809746772460490726518627744879876744663291785041700462924751770101169368323197941963158342585545422256787320972107978460280869372399677855776536565772787421133505615869025334260972047333140872984272279044839128231814121150347118325367086620431397880207421268478872039657353765147265391505236895360849390274006390416912135251999439102905437296494377492523572113279079773564001083600125399392977903104773667388703220566511099298106970459644029914369449028430628616159265435600021238168572231210001750747679307606280309178589206037233043430171676321898396556742514227262176751015908998436820535092581486673585767350783070534099529652579986486639622505565824910663688731065270045008718658314339418561679197622514798923583860662765253625625546257082296325876645782044909782737219695014225254512962450056827180223708491420519574171057192882115499912299179938328399016364118966790631253750764569866804297114304126860817965670728111973966646990904164284378761231433782993025055493737619398786794038465787677096379957728273970744427121268187878784301814106302094358532858136673167881192210047720832486574463784511008313004600578611507932020182674646415560789092651268068588427143871196323184331608096748263736839919110215040704599793512442277073976128412716296201255686183530965988248225615045234746403779893742014695816237351721148339902418264119230655943725876918250260056959845471623136321032132258990962957027771657211100455673954559334250100924630637078099293066606176082179258313945154206615157396742059065563491646751218363414171396353904418266414709196301494723908339284408117635930994659882922670755981051963273372880024695234719950890979383667814111712419277449610371905420970687480666169374401016489447327742229841335371682618801132694 10 | 27654642087561027531236592434339256574141313612901479240515038551076141456641376455501290301292856595572227539992165748081240190738890887582897711541932499594263632385606870149716415892878252998603103272433952516963756388379899844964343484239770846584646924901475108099293950403820612034561551141124932014646831339328971410783764255388470470372689949905579966228108520634331053153825917385485303974849550579028723486666975742799958573893034786207075740788740945111057700419941060452780529818670476390373422214551857625934549327430511167569803537947883455575076287200469696799095332329468260440295387470315894195821165183572178479266194405511189672106081891797773536898273935399426655888092924631092716603933957625195624423419744895094543517303540266750931183243618059589761133202850391393329038055988385831537115229719032480746506815672703057761615158903790646615256533297585541297276665930112107974112113214236736431358380214321480965980599761908807557003167352523219162180741666035259958923018458290263132365531357415806560019893139213101704090068157983618587058781807667399162351968410532309133525258208858346508250358871435040449507235146692475464352429416214263007603692165282713109413641522940413351836556942043498604088544689738356708894558766648156166137254974971801669088721871280048475655749655140115578546650566037858113931899104331556170977175873234816136932906213795963523973955177276279767668194721526997516622362844386276895676987522902405080133166907762637665591501736857605409455268397479700930741319583119554903060747875464202660241632291311808105390885708912226242824481493089568791463786329866225702845306053537892436002530017340096187543459915011522095692738220296666147866028444466937339953371457639306582823529940745465349767851451441274220446275915377714271590392202745182917432838578138472114307261542562915681703444390111342661836234836141766647989166390905844812815550203416640946019612630519199799628322082808413470161661074438206119842515276769320547372511218099222461171137226589970105005238658029625587336606866107984666536599430225463328963758291590977848753316832010375339861714427981139563989963050665929655341095631729670406919846805402595989413091798015886926723838873396290224049970218574139364996723673833868877589657826241655538480538735522073210689812012835751476996216677284926882861298775260801720483168232749450925614038721148717733414512561331055333649882620508888262990131425853069798897805660185691937169902260306816228116 11 | 16383041751725482736202539518262753674943434216823669028475804575725463333165027932117512766989283125517934916556771314771907640538100658110629975760101312448055243139130725800630009360660504099938810046255730632608413729853275145922991066267579904961854708996640547176930228038584686273662517368118976575915260459080222984860897914166128032980250214807577407235589909304083268126522027800243593423706797825046171369054227645472287037530193674401931992630656985591795993431095833059302519438197034492563410587014197173626287831403931915372152333422907736309237083930560555933199229071541319043783044733901886928916510581460679405741836090987140002970381184111096820349211033456593953007892440693106423714889596040363984324521268762482728193924114735154468995964813943161259034053612766885159654896525271722188913499703627610055368106501180510237396952520989501827581121278248577155953557114584217846453649462762301096394017026688325924813337651471822237303076612884971590623367669049166622800452131121126138219266894833695374288848929941717118988647797604371823390013436858925707075657312537184342491420083426871510668292134206902888826603429091978043530208705121198782011653001336981206284612842454080391341067177330507390937573562592826549237005536304132021677719955651393331707782193967513105961948118294318130334180940386687094659309938880747578468376284571648999433320101940127661777779047956770332042790406544723820565828501087775325186468924937460521273360515718627927683594022195671916576842781559141458172452826872842630433787376691601591752229740780880818584411448456101532213729199174240968751045265428826109151207193835462643339646783568951197167924312025095521456633376127964152374028533113645858098915303122442364281184686755436845846457714942835892196098672012754835476618052660473734545969574716470238485508359139119479265264439895885310022621145366831090797690977662915133042939217211961336507276026275843226652557369848551733381764225665556271419046066907024711865970461513437318898050102509440744409834669601444435406825512151090615009241161893964388760513307750244390563769330816124664734697878388006771981605922263105618179679869996166116223087109246045838412823255397491330742160177103602035734656566011677284528898339359441905290603231989729007687973784451146714273370628238175485422899260268912787524202693195683872580693604803991847281341463522834191838907848181959616502076383438342876815671620474341913083425379411928274523384201216521371303 12 | 27654642087561027531236592434339256574141313612901479240515038551076141456641376455501290301292856595572227539992165748081240190738890887582897711541932499594263632385606870149716415892878252998603103272433952516963756388379899844964343484239770846584646924901475108099293950403820612034561551141124932014646831339328971410783764255388470470372689949905579966228108520634331053153825917385485303974849550579028723486666975742799958573893034786207075740788740945111057700419941060452780529818670476390373422214551857625934549327430511167569803537947883455575076287200469696799095332329468260440295387470315894195821165183572178479266194405511189672106081891797773536898273935399426655888092924631092716603933957625195624423419744895094543517303540266750931183243618059589761133202850391393329038055988385831537115229719032480746506815672703057761615158903790646615256533297585541297276665930112107974112113214236736431358380214321480965980599761908807557003167352523219162180741666035259958923018458290263132365531357415806560019893139213101704090068157983618587058781807667399162351968410532309133525258208858346508250358871435040449507235146692475464352429416214263007603692165282713109413641522940413351836556942043498604088544689738356708894558766648156166137254974971801669088721871280048475655749655140115578546650566037858113931899104331556170977175873234816136932906213795963523973955177276279767668194721526997516622362844386276895676987522902405080133166907762637665591501736857605409455268397479700930741319583119554903060747875464202660241632291311808105390885708912226242824481493089568791463786329866225702845306053537892436002530017340096187543459915011522095692738220296666147866028444466937339953371457639306582823529940745465349767851451441274220446275915377714271590392202745182917432838578138472114307261542562915681703444390111342661836234836141766647989166390905844812815550203416640946019612630519199799628322082808413470161661074438206119842515276769320547372511218099222461171137226589970105005238658029625587336606866107984666536599430225463328963758291590977848753316832010375339861714427981139563989963050665929655341095631729670406919846805402595989413091798015886926723838873396290224049970218574139364996723673833868877589657826241655538480538735522073210689812012835751476996216677284926882861298775260801720483168232749450925614038721148717733414512561331055333649882620508888262990131425853069798897805660185691937169902260306816228116 13 | -894287922497964413900687994230988927676260607190830270311887670594138369635140426070286182121636667725433884297165090955759465409785252974314322529033402451843774708791175126399053458826301270883157357334176875529908077373237095744988531614982650276403161894469127914962086101960768573725669665879403410305323232470209719529109722811972706657683965668159255800224396165602322323151340927918126332230623404713088113166439018322928945864052740268486652073205639129906370795469375822676409790626717136042151946510824071698614941820137223537811811753831169670135679981413516623321338052715839744630904083779131003362915369644732307248740449370917616592903215708202205341510204531639636054285563600813539559224734045992287039856535391379833317198167587169682726918576116848735615833620523353374363364944739471836356918229267515014547494203009158886277491211487713733850509875117074172100280126486078241447120969832935757463636717541742328602608322811455065620002060018562330422881230378472070727630553632627138133504673977556966763626759562600534662381355562417811369175540585442074996777219387251820273519505025541098481914956794621452350634940055810775262361455620183388898571033082803729866581244712182888918297347134757088609158981892292619539189459223462528816106403415952860975595640826583303473928188329480925934702866417926198555291625402479530534345406283142085086880503050654222781410691631502252496983750863705714362032508652851035563371458042876627468000010658118417716637883493914032518810484072470555868314236703840023360848940025536601605514262031863872061556113333077010925520541580727265454470488261061444926857301293288110803871896061402770000698679142772368772422184777077573277819930887795127381334243446130727955641303638801180133693036168994045991014579391033561690311243079894826713552752154395914293137872910065045490725285481297865693658622810057625266475140451991222976444035824283067731731926580077394349753683186133985972131167002160735120370325182004835953834683640832327653267459985514348982590097935523836472413514691883975673055037422077181048631803106451102717141859190923632952699379925808246521668828181006102816546040229517607996353166553096787435440165312478910363665382201969652679462389201827840677465941181437390771372334236237575648630640503778728270428295558732065562781280323829340608603443150049590772800268514034221840656388108007678357529286966209330007751892242551214039170909331713415728666862213023502411898497910775377792 14 | 27654642087561027531236592434339256574141313612901479240515038551076141456641376455501290301292856595572227539992165748081240190738890887582897711541932499594263632385606870149716415892878252998603103272433952516963756388379899844964343484239770846584646924901475108099293950403820612034561551141124932014646831339328971410783764255388470470372689949905579966228108520634331053153825917385485303974849550579028723486666975742799958573893034786207075740788740945111057700419941060452780529818670476390373422214551857625934549327430511167569803537947883455575076287200469696799095332329468260440295387470315894195821165183572178479266194405511189672106081891797773536898273935399426655888092924631092716603933957625195624423419744895094543517303540266750931183243618059589761133202850391393329038055988385831537115229719032480746506815672703057761615158903790646615256533297585541297276665930112107974112113214236736431358380214321480965980599761908807557003167352523219162180741666035259958923018458290263132365531357415806560019893139213101704090068157983618587058781807667399162351968410532309133525258208858346508250358871435040449507235146692475464352429416214263007603692165282713109413641522940413351836556942043498604088544689738356708894558766648156166137254974971801669088721871280048475655749655140115578546650566037858113931899104331556170977175873234816136932906213795963523973955177276279767668194721526997516622362844386276895676987522902405080133166907762637665591501736857605409455268397479700930741319583119554903060747875464202660241632291311808105390885708912226242824481493089568791463786329866225702845306053537892436002530017340096187543459915011522095692738220296666147866028444466937339953371457639306582823529940745465349767851451441274220446275915377714271590392202745182917432838578138472114307261542562915681703444390111342661836234836141766647989166390905844812815550203416640946019612630519199799628322082808413470161661074438206119842515276769320547372511218099222461171137226589970105005238658029625587336606866107984666536599430225463328963758291590977848753316832010375339861714427981139563989963050665929655341095631729670406919846805402595989413091798015886926723838873396290224049970218574139364996723673833868877589657826241655538480538735522073210689812012835751476996216677284926882861298775260801720483168232749450925614038721148717733414512561331055333649882620508888262990131425853069798897805660185691937169902260306816228115 15 | -2906827522856523959258420267380836104409726318043502826391123775584951873070424093327922127544885286353001903090622459431486565838351427421066656584825241380374559600330584936546115315785626825849290364332337383908941079224225780044182675120625925270970097062917971571474891588701293642222223308492627402876835060273013944396062487333920572905440419960673877169578009929451288744666487879011500851544222697366432039517371335676780538760513681600641767993787025605200387908989778190781647851730521514838149673184098417621550485200910657176194290890907596491638288117972027864319924983924446655340854194850262640474773098313188267068274767196041922320758800342398535490064128142858468278518965715965486912865089259320934004259354705764517673690889015734722173552520255705190840323935441516479529879308907060357400224944456890068056626881578617721238678489661658055837063521591550842566171321471611950847706170049433785533341358741924854563536507345483612086954045656834261170114891798844850404811296641918926134480761548313116790839447742073538366047111459402892361412795559187863776019872963788421589761373615358438924229351871016877518113845398961645537084314627419194239341310423842395601434008257507073626871411142659070489510005017480052637370612512230350561914689224793975559794646182815402793783278281041223106338635738079233083167860980084529468413952707531777014055900125506278804200402325249485548404892415793165352722580292090474374766694637144179672627996263126099283139696677552371301350400930778350046752959931790691357265730564948010409018992223624676513507318244047543289776853259365442420632470405340173663503977980122503970943899038004554374999502668380557341815993181829495222311293530910025736026047383423998390229830126395802526054839130655652241304983903866247076718393573295427058981705329937742668354600148847349067518559010792831452998891147022451012982584924428678137105439729745247021184015573138146058249635602304090164080852611374607648502962679712130087238040901663947356876145646455629463350831382289025443963152828791297608085461203209598467010919440387752348407948936973478397556273693769794506907924470263104615781766364681330110279114633715787110139247806355436090570320806287231767039476039881600545530266288687380469755121661570992489093646441437491253896395457335860016835728149352205972340887051502308087904390336343698093967935621314129138365772790773901788754395161791730959055269998082217063133623336925410561349503082330763410 16 | 27654642087561027531236592434339256574141313612901479240515038551076141456641376455501290301292856595572227539992165748081240190738890887582897711541932499594263632385606870149716415892878252998603103272433952516963756388379899844964343484239770846584646924901475108099293950403820612034561551141124932014646831339328971410783764255388470470372689949905579966228108520634331053153825917385485303974849550579028723486666975742799958573893034786207075740788740945111057700419941060452780529818670476390373422214551857625934549327430511167569803537947883455575076287200469696799095332329468260440295387470315894195821165183572178479266194405511189672106081891797773536898273935399426655888092924631092716603933957625195624423419744895094543517303540266750931183243618059589761133202850391393329038055988385831537115229719032480746506815672703057761615158903790646615256533297585541297276665930112107974112113214236736431358380214321480965980599761908807557003167352523219162180741666035259958923018458290263132365531357415806560019893139213101704090068157983618587058781807667399162351968410532309133525258208858346508250358871435040449507235146692475464352429416214263007603692165282713109413641522940413351836556942043498604088544689738356708894558766648156166137254974971801669088721871280048475655749655140115578546650566037858113931899104331556170977175873234816136932906213795963523973955177276279767668194721526997516622362844386276895676987522902405080133166907762637665591501736857605409455268397479700930741319583119554903060747875464202660241632291311808105390885708912226242824481493089568791463786329866225702845306053537892436002530017340096187543459915011522095692738220296666147866028444466937339953371457639306582823529940745465349767851451441274220446275915377714271590392202745182917432838578138472114307261542562915681703444390111342661836234836141766647989166390905844812815550203416640946019612630519199799628322082808413470161661074438206119842515276769320547372511218099222461171137226589970105005238658029625587336606866107984666536599430225463328963758291590977848753316832010375339861714427981139563989963050665929655341095631729670406919846805402595989413091798015886926723838873396290224049970218574139364996723673833868877589657826241655538480538735522073210689812012835751476996216677284926882861298775260801720483168232749450925614038721148717733414512561331055333649882620508888262990131425853069798897805660185691937169902260306816228116 17 | 11624005851821362986951980706315456487087970829317265633127195394599674696175036912168573626296731877636393794257305937013081527437890127282622033185805992605278046961005900206986500484646274829265247027853465131268082930928189382385115347187704327096591355290864571915386696668286807306306912250216481434162256607511380133838057791444839123431790517102794639848826066166129455962962842037248843745460838818283486404920282255243929410881180194413183012474090446432796788759875851920847384250410278041687104361009406177880641029212430436114869512883912724312849954432671443276778232388758064111168268507947477465915240477603057539961275869559462311653714354376998045069757601336615637448629591504256301139347798171816082613478451385676300736864297600767031309704172115951221296766343429306338184556073057911486751963499152271284550551998288226860035986102390322838793121122869798409471743301459563194747268880666582594642086947115133435221842285201052142379018216062497745135494456373032988835585456757854478696675043354507841574113594984420766185158382317481807083062941342464461904465757506357909927103494081402500174557390282877388366802849720902696680756388363496417384657578190975260576434964628537475671418087794909030203907601619673855897755490109186209035682256379850164356037258768504494807612090781291051495021957947105832895136293222947921264969532425226381149959187330672187814167487049488703268582127353346385617836943891036294687254182618582634901205784254875647067136815967025949809234398802809269012553789365192471141365843873771052584157039036329724491730181570473058226595803710449564626935058115490495176096144817561650910468116428901913052200054502283929556815224177586650101213326776226996014236585805445053203798203692473582925881077562709916519278592033430575497666295659271151402575398440728118740283597336603025276044495258645119780329180219626383626510545022641127084358615718250947900146612883095323774606796333307538102205284764626866472147941534767893964523811354200540581365426356586622533864732789925265260091571765754257823707032624246431216646720353441934320777808188644647949431211299478601344852013831744993981077316840870637809419301941685809106821574248095105091211242178464904617067070347864361761700507538649545291586112546697320300568882804415678879009965218540164615448339470406605419546175728881316687132086654445844851054097695350777112252197438681646999848851994737355150840013577536542922424101717331742584412254457507860305 18 | 27654642087561027531236592434339256574141313612901479240515038551076141456641376455501290301292856595572227539992165748081240190738890887582897711541932499594263632385606870149716415892878252998603103272433952516963756388379899844964343484239770846584646924901475108099293950403820612034561551141124932014646831339328971410783764255388470470372689949905579966228108520634331053153825917385485303974849550579028723486666975742799958573893034786207075740788740945111057700419941060452780529818670476390373422214551857625934549327430511167569803537947883455575076287200469696799095332329468260440295387470315894195821165183572178479266194405511189672106081891797773536898273935399426655888092924631092716603933957625195624423419744895094543517303540266750931183243618059589761133202850391393329038055988385831537115229719032480746506815672703057761615158903790646615256533297585541297276665930112107974112113214236736431358380214321480965980599761908807557003167352523219162180741666035259958923018458290263132365531357415806560019893139213101704090068157983618587058781807667399162351968410532309133525258208858346508250358871435040449507235146692475464352429416214263007603692165282713109413641522940413351836556942043498604088544689738356708894558766648156166137254974971801669088721871280048475655749655140115578546650566037858113931899104331556170977175873234816136932906213795963523973955177276279767668194721526997516622362844386276895676987522902405080133166907762637665591501736857605409455268397479700930741319583119554903060747875464202660241632291311808105390885708912226242824481493089568791463786329866225702845306053537892436002530017340096187543459915011522095692738220296666147866028444466937339953371457639306582823529940745465349767851451441274220446275915377714271590392202745182917432838578138472114307261542562915681703444390111342661836234836141766647989166390905844812815550203416640946019612630519199799628322082808413470161661074438206119842515276769320547372511218099222461171137226589970105005238658029625587336606866107984666536599430225463328963758291590977848753316832010375339861714427981139563989963050665929655341095631729670406919846805402595989413091798015886926723838873396290224049970218574139364996723673833868877589657826241655538480538735522073210689812012835751476996216677284926882861298775260801720483168232749450925614038721148717733414512561331055333649882620508888262990131425853069798897805660185691937169902260306816228115 19 | 6858803446435151744625767383150607976794227529273859573597818710146437062217176878083809272728363776090874971310358116327819273109323559050514145702005780559956980640040141292852424325910508330508974629429249834154800421396131550147832444115081994558752365308460671421261829344752802008367015632465343788214080822377480100419976335801252342279805298400526826281878110714769622524154618655087077005434751436794642588376271807668118302611666591143462131778876375137346549178051512000992187079009805683669995056610222892615955054225126395798930850526732852634388746285384743941271897434273265250182064186263433029132172593685175333603174954107026343728888297586612818666020706401496977904732790520521439514183671031524136726738223326620274734907525061697480822844942332392110075458886580869367020237725100885590902774235893310142192312317867216721226352023633784328486444714329682919228143915070519312543808368785403011454857462633856516696870947389937356225875086803525532128250312925499502375937695522800609941439283291726901395165960296411718276229821022139774940211450496403016849852364716161205019943824360041982528978166568284615551629679912450604223400053051846047715059892183029472943992896195102804078973918575095858487999062119280409546199528384469836753136534698801636038113806797782347236229674201255936922964302050591768279295014791280903838518522926810537962991138944192104336854953086828870909040746666758561290176476743689163086008890355042433473827337707024702950881359076185931194734136533357580104796719123259704145245386268365715791432633072680534997670498389983599430750596143253589112363204405796188662771231216628535370172181737492958219510568249059292310650029534795631054358009048207090443791138531924945516787370586226315637873700580554821646167918605397008073932875953473481797477708306695629811781897853309876484213913133341151456910522604778371300747453640682874896694303259050643569006395106319674032210320713989886195006926376381278346003560397745967086872948406747193413172290550061558709101962850053158823618781032409290040526422888818870938854139505129497496756131090836447811848636229024928284775111558446898468302105870015786871861637528191598587857351353005274501844137843778088299277311410405251626584689064131730236285799219621975609311647463004762693594003212430440033860296633343208234234613013260992377515561636836647551182877281296910329365562795368734295283077127814584787008884428694000353940551344793297273042603426409111130 20 | -------------------------------------------------------------------------------- /key1024.sk: -------------------------------------------------------------------------------- 1 | mlee secret key (p,B) 2 | 29060014629553407467379951765788641217719927073293164082817988486499186740437592280421434065741829694090984485643264842532703818594725318206555082964514981513195117402514750517466251211615687073163117569633662828170207327320473455962788367969260817741478388227161429788466741670717018265767280625541203585405644154134758080906664009823190623766943445596986985273279784088998769283475131311647332843603531764823034227570768627058085163655404449803110069232826531738116967410492589587013761771783080742112893344501396010157104424225271666571886798788000728139469884053149180330906085536752334787422765387619832619447816707560739813456996946007642987441137773725495160352608656990410392276930380107831627315347530273529301429411837579444726539609210671985406839282709089865760908606156473611467288740113535313530472085018549165984766140310107742785933072402501294325133643572192335032107275529901071439868911345505877431054126716692491293025087461455759094596965810951777296726634072141012645149825479224959874079059225085000633305874708965346699393685885852945004690171281262674004750201702986168495628367365434546466089531613807094842611423596438044895208823179950139559399076729571963440901732948167111997922490294979005058205845468516893626583226122916200432854799774805490343123693082459694908401624890812806089850411874482994304612322519254115365909387928529626809823326028155597492583045259626680227951357943554693618434264323332574814842239075563637794993640103054299338616563159800433018831295128850112019432687668538182402280746487137103306434877826660815645496840237766136010024979475831607936752542785811354620551591643918599994601960044539071288499361664251444090573788609546316331099080980608892117007987706827356766965403227821033879939909650642407122058980429434932884575872332510561606317165990997041725596233604394072835495558675130517865374119908359644600096939241099195161881987891583973599254792025294955440934915853465482847171892970994224194448621978822284764015604395355409674539184162201953085108246791356643605295484722261556696113222178067970313924850582671916746783205361544648319047244425802780130831263731966889408919931628060774422006780061472463181267330551280855135493917299060446726394620253379933111479551940818251556352432261701308481854679252965316611233180695729401502034565265904897601349633272542417507270003400809748828622046444214146943103178425770572423032059361418080898816608175486834897071847314810667132574944720516317851169 3 | 58120029259106814934759903531577282435439854146586328165635976972998373480875184560842868131483659388181968971286529685065407637189450636413110165929029963026390234805029501034932502423231374146326235139267325656340414654640946911925576735938521635482956776454322859576933483341434036531534561251082407170811283037556900669190288957224195617158952585513973199244130330830647279814814210186244218727304194091417432024601411276219647054405900972065915062370452232163983943799379259604236921252051390208435521805047030889403205146062152180574347564419563621564249772163357216383891161943790320555841342539737387329576202388015287699806379347797311558268571771884990225348788006683078187243147957521281505696738990859080413067392256928381503684321488003835156548520860579756106483831717146531690922780365289557433759817495761356422752759991441134300179930511951614193965605614348992047358716507297815973736344403332912973210434735575667176109211426005260711895091080312488725677472281865164944177927283789272393483375216772539207870567974922103830925791911587409035415314706712322309522328787531789549635517470407012500872786951414386941834014248604513483403781941817482086923287890954876302882174823142687378357090438974545151019538008098369279488777450545931045178411281899250821780186293842522474038060453906455257475109789735529164475681466114739606324847662126131905749795936653360939070837435247443516342910636766731928089184719455181473436270913092913174506028921274378235335684079835129749046171994014046345062768946825962355706829219368855262920785195181648622458650907852365291132979018552247823134675290577452475880480724087808254552340582144509565261000272511419647784076120887933250506066633881134980071182929027225266018991018462367914629405387813549582596392960167152877488331478296355757012876992203640593701417986683015126380222476293225598901645901098131918132552725113205635421793078591254739500733064415476618873033981666537690511026423823134332360739707673839469822619056771002702906827131782933112669323663949626326300457858828771289118535163121232156083233601767209671603889040943223239747156056497393006724260069158724969905386584204353189047096509708429045534107871240475525456056210892324523085335351739321808808502537693247726457930562733486601502844414022078394395049826092700823077241697352033027097730878644406583435660433272229224255270488476753885561260987193408234999244259973686775754200067887682714612120508586658712922061272287539301527 4 | -------------------------------------------------------------------------------- /key384.pk: -------------------------------------------------------------------------------- 1 | mlee public key (p,alpha,{c[i],B[i]} 2 | 24232893977326515372576585879115875405637849106383493738669407869101893795788105581495100853520945318044318664512916736618635654916417706325074191748127555839500615864129150594412342858478458692197886059403103750013464736959085797321385049645993906901143726448002870303262201379439895255048597904829745500596056489108462589445035369437818286122857725184237299100605865451114588123543692195250947707783097642889181230360509662116621984931237027095946947457717722841397067115026066187714655211182538700828536176651470426241094581601835934627281350479432659590254960730235232049332937675610482127871417901487086189830907868141910692478608781435857924878072132059994715853501924226475901505722789889783129894283620879154737608903511163625417319849107510571564285386235591999251636256356350804926273141632166368675286300928689183595674441391380020762807671316344738923993299098784639679444004405577179310563903501490700523281362897 3 | 8244656136562541913154188175175310255265158832199945383647893178679304227562545524291690176212363687358727179580052493195109122377614034614684043968580661022278787027270669037969270562871278181427170752521563284797134216642241374460945942412155307346938503880440104028889304716197183000267353815078234304136894754922769767760762201476087387559219001982140610261352798926918681369288393864974064359320565722024394437865260574513689852668738790761993526046319743431961671041387223498641693376101910042684149978448266656603464039131950496902715835498692368060303688284750457541230254817925339188153694475549895397719435645787031193029562703902190567196758513397902422585020697220124790102881651525961344257948323010559874260551671813122340823942978120617310325972434925087742075031992126746555450516741179459283297992004152776844091481140630861063154886890235253151491562266169841636464454152288219866446662450549272924843453605 4 | 13349771109490852195673360563595936723951657501521677421585468692607150761822769228049576908037054078526573326688548764491321416201501987430252429141884824720929261791583202945578211124136338878635489084121000270861326029740676841425795202841710818980311734183649622613785015236635163761638744697576446712668359016316096498930991363567395432724554395370221116349494132008308343701282953855115603153892222070138053659373951506176259144613884234571731116660027492183534228466431662533512418880324158126614761976215610852768826122617304068446365153642627385113367457522259859479259944827068874362806211509300636808716828499537797420367280884639590658232956232026120275393019988725090979892031944855016127090444409104767851143124612713238140487146932733039822606366621456351368317636266862336060852968375757557447409845204162125466610397836051654975773987195372499110914558110305386244091110864970145334064250735017972124278541118 5 | -1027548220680844881004971785131303828437136905876888875992910772399327666399009637565444842994045391272556374851749962192189327647668338160589377483435621009228323481154575397565382839588599278431161253680552190052137086764903237821517548253567160466826879873109122374842893056423824191800358590209547052456243845289896148010610994094611590577855737935911824822278402744517010711771129539289674623094937244299026311971414019145095079430449940261051505658071928550205149378901125634922215848418962342213076674569756575636120395092898759386408812231067492893031877689174829961971690175966425190852093216150166870322574894823372684160325370560218837252365336116563364944512330628829813036107959154484407904599863208276323326383259836065063346648058574115835348368568277376815611006762761249113032020179496556638286427738775570243811468767041790289128746653854980800509346526468742615798123369053554641375484018561648343995554121 6 | 13349771109490852195673360563595936723951657501521677421585468692607150761822769228049576908037054078526573326688548764491321416201501987430252429141884824720929261791583202945578211124136338878635489084121000270861326029740676841425795202841710818980311734183649622613785015236635163761638744697576446712668359016316096498930991363567395432724554395370221116349494132008308343701282953855115603153892222070138053659373951506176259144613884234571731116660027492183534228466431662533512418880324158126614761976215610852768826122617304068446365153642627385113367457522259859479259944827068874362806211509300636808716828499537797420367280884639590658232956232026120275393019988725090979892031944855016127090444409104767851143124612713238140487146932733039822606366621456351368317636266862336060852968375757557447409845204162125466610397836051654975773987195372499110914558110305386244091110864970145334064250735017972124278541118 7 | 4869879054105981540841116275083825001201782542771041299580463525771634877415969425798410726862642848979769138348089550587397427637116850098831086108481132211385032574895820925664861690173141281703651269686440154277094411171295951878605009895618760325737049366159678340685385078321288026886990109693532646397648916102301081172765106059607450675104592916676033931729692629519215320019582475945456779077347932882550198264891323900185497312068273415332907576137709111747025156829161520752274881645989490760446436483113492627575824645744099000151835942203216249537188783614638257279724933542873348987726428663012635707977389661661184551299426562482212347537153551400129521424710924120818927941559522408513543990176078608971250263742852821240959850162809351401743813721946615972517806804221168562425887868977750405840084924740941781592277007594725562457271139139118757095304869522047162194868258792923110166372552789591122961201080 8 | 13349771109490852195673360563595936723951657501521677421585468692607150761822769228049576908037054078526573326688548764491321416201501987430252429141884824720929261791583202945578211124136338878635489084121000270861326029740676841425795202841710818980311734183649622613785015236635163761638744697576446712668359016316096498930991363567395432724554395370221116349494132008308343701282953855115603153892222070138053659373951506176259144613884234571731116660027492183534228466431662533512418880324158126614761976215610852768826122617304068446365153642627385113367457522259859479259944827068874362806211509300636808716828499537797420367280884639590658232956232026120275393019988725090979892031944855016127090444409104767851143124612713238140487146932733039822606366621456351368317636266862336060852968375757557447409845204162125466610397836051654975773987195372499110914558110305386244091110864970145334064250735017972124278541119 9 | 16959724153279954102866533477483775126852125266530646200624367071367377315847243538865227228996567851000627835680901331239667360745991485630874061684834854340703637535932428612131582910421398434902262086607134923956992724676430655111438332600096563298552384744797002996443253374000258031927615847665254099501986583933806396304968662825973170243509584766345809477001708738552143071562416482143881204187424121360666247778184256172856862089307763370495691254240827869454213676223883215074663045493847853931114550819793289471970608610643171454801256538880293282142239889438262723046955373751373578970290216514121569355839518443940097785331758400723917179184290606283878003923775096283516395707760579007775749449829169944975875356597579550650533001182086511364416562011176893826509396735031995500827958735590219261765430223501768380380663192059460818502178956076554023225637588294290677482274558846020887380416184609148819175391134 10 | 13349771109490852195673360563595936723951657501521677421585468692607150761822769228049576908037054078526573326688548764491321416201501987430252429141884824720929261791583202945578211124136338878635489084121000270861326029740676841425795202841710818980311734183649622613785015236635163761638744697576446712668359016316096498930991363567395432724554395370221116349494132008308343701282953855115603153892222070138053659373951506176259144613884234571731116660027492183534228466431662533512418880324158126614761976215610852768826122617304068446365153642627385113367457522259859479259944827068874362806211509300636808716828499537797420367280884639590658232956232026120275393019988725090979892031944855016127090444409104767851143124612713238140487146932733039822606366621456351368317636266862336060852968375757557447409845204162125466610397836051654975773987195372499110914558110305386244091110864970145334064250735017972124278541118 11 | 10537835834903490302450955332639830146603118066981222406577454923781975543824510494354864041744632682619492773450527287060534453007343998118313317366094609717766262474116280852812480809671331038731690381837695774935757590204895738856328232716983401692302317239484059583105395951160928339331890602674092712589479947941533900999562571235235418893155286264399062226387306560526285774860624212463760116688669659004005406093641659786317727109760273702840942269512740234416974799234726273723226594244076791068340260217346553277357841431059278862101404271774980567792380027266221906600541631456184222760657088859390301350444704277884647937986774112859375710434597839583606529778867875093024030897943921601051496057399818281812525779170507490230381539521555283376737304120857333467277774658426859343304445758595192143825201526474986823622079379410268447584230624003014805816745204416393175067572619823164961043813518216190849357097496 12 | 13349771109490852195673360563595936723951657501521677421585468692607150761822769228049576908037054078526573326688548764491321416201501987430252429141884824720929261791583202945578211124136338878635489084121000270861326029740676841425795202841710818980311734183649622613785015236635163761638744697576446712668359016316096498930991363567395432724554395370221116349494132008308343701282953855115603153892222070138053659373951506176259144613884234571731116660027492183534228466431662533512418880324158126614761976215610852768826122617304068446365153642627385113367457522259859479259944827068874362806211509300636808716828499537797420367280884639590658232956232026120275393019988725090979892031944855016127090444409104767851143124612713238140487146932733039822606366621456351368317636266862336060852968375757557447409845204162125466610397836051654975773987195372499110914558110305386244091110864970145334064250735017972124278541119 13 | 18664831843487616151900798402830629562304087784689041335088655427331622382054780919904838717795631386497828835523577317512291163170332596878504501066729298350446495639200153905617189723823571622623433167724918723067229285357959537265345690237282307816055565940129768275706928266704789433907940088166485416085340186868064483006451273254798809427004922001079146246607818079314997755518550508202873484955686331453977306616366534917421962041902241029762957545577534491356508730751192461848045185948013670418503530495073998518545414792928456444304046484083542065404357270121408246287026014857651936056012715891244273726602666434174593533383582578537650904311511009712701569235890649921120101483666705533613167984306559853564141511620200547756091103707388617483918663689412223213821038656022586215113896826996874742650420124065954882835115871997469453676662348951001822188573399794160653477136646709601540765330250882977474184433375 14 | 13349771109490852195673360563595936723951657501521677421585468692607150761822769228049576908037054078526573326688548764491321416201501987430252429141884824720929261791583202945578211124136338878635489084121000270861326029740676841425795202841710818980311734183649622613785015236635163761638744697576446712668359016316096498930991363567395432724554395370221116349494132008308343701282953855115603153892222070138053659373951506176259144613884234571731116660027492183534228466431662533512418880324158126614761976215610852768826122617304068446365153642627385113367457522259859479259944827068874362806211509300636808716828499537797420367280884639590658232956232026120275393019988725090979892031944855016127090444409104767851143124612713238140487146932733039822606366621456351368317636266862336060852968375757557447409845204162125466610397836051654975773987195372499110914558110305386244091110864970145334064250735017972124278541119 15 | -4466167811522665709165476068479793036473238300726930277833345747018614118090450923386965500437807673051136740195539566181650247540389008402504420820140173298221165190857834453491028398387706742981675526100551786135412110673260990355347609134705464961625536397201822902782007681337261009889849093772954589104982331520191105239590263497217362745087445023189063833794424668211226757411731257692633926766003664817755808942383639290201531443307639525481745704360136377464550580432323748126354007339913462108240344525160930138115463316019128760335358795527122857037005028692125476280359083334695885696006804103433883651172388963843177773286341330584450767575314492347591383247186488693346235855352842778218898605384660754677416623702458582801455547287839331769240710568644048922702209381648880022541454275765450228728768151003861296993080902464591873514002230050504515886639383257906934622279100609504669241703883778827068662070982 16 | 13349771109490852195673360563595936723951657501521677421585468692607150761822769228049576908037054078526573326688548764491321416201501987430252429141884824720929261791583202945578211124136338878635489084121000270861326029740676841425795202841710818980311734183649622613785015236635163761638744697576446712668359016316096498930991363567395432724554395370221116349494132008308343701282953855115603153892222070138053659373951506176259144613884234571731116660027492183534228466431662533512418880324158126614761976215610852768826122617304068446365153642627385113367457522259859479259944827068874362806211509300636808716828499537797420367280884639590658232956232026120275393019988725090979892031944855016127090444409104767851143124612713238140487146932733039822606366621456351368317636266862336060852968375757557447409845204162125466610397836051654975773987195372499110914558110305386244091110864970145334064250735017972124278541119 17 | 7614242178477520050520681594750788996337583819720832723991375838882644493449395395009060919279120944423589932211727583052691997428298863793621522997646072535602430614825630502258628761461936701148398310220751282945190997446642191044390636502274849914346960960811746798364161689344696267732399476895633727528873552110150782380146779189164694614161071279190914317787183027497413710231835349658828528366305359130745963115692660776725598549672989480033555415773379201630573821918107809566410245413209743902317492620308397966295955942466162822309838238392058742633890091849744811016511481182227713724305801122438331921698648986835116062832642315020866007228890182452655488248765213771694155562288307710841452458727875924118479670443519174552604607497626469629278293048176816924588937091941078606845740422269339892145496445564820470396152653035038767899171029242609248114482377601010373248125286470896196756029619190470798535762386 18 | 13349771109490852195673360563595936723951657501521677421585468692607150761822769228049576908037054078526573326688548764491321416201501987430252429141884824720929261791583202945578211124136338878635489084121000270861326029740676841425795202841710818980311734183649622613785015236635163761638744697576446712668359016316096498930991363567395432724554395370221116349494132008308343701282953855115603153892222070138053659373951506176259144613884234571731116660027492183534228466431662533512418880324158126614761976215610852768826122617304068446365153642627385113367457522259859479259944827068874362806211509300636808716828499537797420367280884639590658232956232026120275393019988725090979892031944855016127090444409104767851143124612713238140487146932733039822606366621456351368317636266862336060852968375757557447409845204162125466610397836051654975773987195372499110914558110305386244091110864970145334064250735017972124278541119 19 | 9693157590930606149030634351646350162255139642553397495467763147640757518315242232598040341408378127217727465805166666405750068451058484475123916232267512982132849649775094641629093249329800003923104509613063285958500224201942848266456762551237064016832343812134173791933083912178120680919526579738604663502804497847957639112994112943179827884897033255856701551900571294288331944975267770578237322685853036781908427141964953144200722809393838588702614627807901296244186412115214934590691117378789451535923807352503688954674129007504665490269945616457192808285870555679322576017533446614139335763650482356092572838242111225276657402065410490924495830787344326525410919540311117820746104224590687368502867821869736241995269978739710172539443291274815566677093202045030471260554290775336695075061535427272745916958144660532170609154712703656844291641002526054915144410513495607888692396314347854253488915018042725942505808378978 20 | -------------------------------------------------------------------------------- /key384.sk: -------------------------------------------------------------------------------- 1 | mlee secret key (p,B) 2 | 24232893977326515372576585879115875405637849106383493738669407869101893795788105581495100853520945318044318664512916736618635654916417706325074191748127555839500615864129150594412342858478458692197886059403103750013464736959085797321385049645993906901143726448002870303262201379439895255048597904829745500596056489108462589445035369437818286122857725184237299100605865451114588123543692195250947707783097642889181230360509662116621984931237027095946947457717722841397067115026066187714655211182538700828536176651470426241094581601835934627281350479432659590254960730235232049332937675610482127871417901487086189830907868141910692478608781435857924878072132059994715853501924226475901505722789889783129894283620879154737608903511163625417319849107510571564285386235591999251636256356350804926273141632166368675286300928689183595674441391380020762807671316344738923993299098784639679444004405577179310563903501490700523281362897 3 | 48465787954653030745153171758231750811275698212766987477338815738203787591576211162990201707041890636088637329025833332028750342255292422375619581161337564910664248248875473208145466246649000019615522548065316429792501121009714241332283812756185320084161719060670868959665419560890603404597632898693023317514022489239788195564970564715899139424485166279283507759502856471441659724876338852891186613429265183909542135709824765721003614046969192943513073139039506481220932060576074672953455586893947257679619036762518444773370645037523327451349728082285964041429352778396612880087667233070696678818252411780462864191210556126383287010327052454622479153936721632627054597701555589103730521122953436842514339109348681209976349893698550862697216456374077833385466010225152356302771453876683475375307677136363729584790723302660853045773563518284221458205012630274575722052567478039443461981571739271267444575090213629712529041894891 4 | -------------------------------------------------------------------------------- /key512.pk: -------------------------------------------------------------------------------- 1 | mlee public key (p,alpha,{c[i],B[i]} 2 | 17753707995031941950296042001716388616701158084309198297946338411961365506702250828925483209254206164743271250362377294836153510838309348203164537628392188011436182603864836040921972964378603628914872036704424180199503510698535590052963319817696185845452155502109601536753038807089767262288322095287583471214953282996986642107552582636700442629659566070027133779893072602905141180086540104426013276335059083223526160088093013173982319712078199181750135160342217432945400865800814156010211720090735640055900761259224345756511402995088355230139684586052493919237623443565991094129592323054217396680043306066002575255731764924216849927765005999479846360417605175919803620978079271830065242913148381007561556489115025210557048948893999752395319609858532018567764261263696379007710884675856979706685871815701498560600124405019240697538599320533465853998366157825587393913743845695865784204310064934086255894535462291729635978662525774357482173053777459025023541364449646929009980978696719930691056979252648014180507996695815392257378640042877289849490041951859222979437862555555454588433205342202491177649531359237346177270618422082962441894028858867589818783153004204066883158844403432193203520403968852757038128714987787349471143240176129 3 | 890816671879032265265301665894899270880047437611002359293850017184343266829373180862237474034149462211493995898189892911586108482543035402220298157902370847760820315911146811792945592368950047519798498825527115413694922608329087234994328108145281018806432053287643279044642492664769242374283871451530517504138704908126139031264008055645106385450189461977911106497741835426659275781144596835723778161505019869779658018299031986128890246754416794238142985499846283714514712608866634942812420184985288137213382004778687409138484161628502186641977716657414267943698642395145105473654655454296235812287721542657445475655473589210039576743305965793636140954335212762161772988733278720764520544353884604262806109482280144999910839102257627102412786167040265967893861235459252115008492363496686469114256708638564123529602041665588365968249465202444479829948589222469445382182455176660486930654301143230419592316115333885320835948551179924599827893478212822753713782831354348583147666742850569086127123460325540760806960464059322116113163426583515283425682319843405425764774440746949315687829419558230366222872472887446855756238658357538786845823918553958560702134228913391332925108518749688908100177510610044567782218491450471887885757491781 4 | 13462181923439114839315602555635484109324928091857745435070733262009165845864614909562049156401737468979339251774682947422559368217043655407470791503382479421502035886739972103239107724089884670002143729871953729326117253189308962514330781668972305439480428462766400806265203388239690062754681190748650049478222390832649495984708861739904456654442307907510946494450810676498661312370736168047518355335136747442542272143267294383367124796527366984203697679472617826283674021866828793036035291054579443066306679764151244956055163634255813773171529222918247275520205083134765035848492402561127647803962642014468864638959023543725952167171356804874473034241689008087541869223591656578025082054857154444931223116584021990605138582897600159493951499249048015436829437819436694544784335936886188536668686424734137883742696331287208887701413779603318259647524035840153900708376557651523105216075350111479796075967849106272461236377021697859469760690979131025174260286934853437148548833013366399015927305471605646920847622045835514880901653733715977979404435684116049213181469797913331151864782771061008023194609992420231045644390991496402189358179324398313530889499826430367922209005228631900670287372424176210650443232447820713558426403092656 5 | 3596271270952545605684833820486176018127353904232845240340354966981793562745000934382534728202266029664792085057112750914505897426237495872319571698894494365110409457239926588523636313497329814183747429312233722567047215087212098135049231472122354204676180478809694276142814383406717085214176737631843138863421343652859693370889819540792488831580788687057504714857532732605707986643045404134465212194549844468809638179415924411506664708711145844534797620635972294301798057457535958894280730491400960155509536453317426581290590269318569485506385123675369900391307855577610762726891483033166948789959661735121834937215092606418500958628168620009259637317087797067041905714880753245351352445017384970755791461214216109084898370928294743746710800530661768976058185059333491522736841989486318056173408441196456922923516392680980459975846776244214455811200743931847656000837615196026633477206206650219365079178343970599679911827737982312424732676195653912325585341700021379098574844374122203623274993332584938480361909313986496535138950274532366058531482630581394391027107706561537415542946142379771431890192131022290421190469491361083550443687769495911511064602148317556848046105140770878448017854718847608650549002982225021615806665040777 6 | 13462181923439114839315602555635484109324928091857745435070733262009165845864614909562049156401737468979339251774682947422559368217043655407470791503382479421502035886739972103239107724089884670002143729871953729326117253189308962514330781668972305439480428462766400806265203388239690062754681190748650049478222390832649495984708861739904456654442307907510946494450810676498661312370736168047518355335136747442542272143267294383367124796527366984203697679472617826283674021866828793036035291054579443066306679764151244956055163634255813773171529222918247275520205083134765035848492402561127647803962642014468864638959023543725952167171356804874473034241689008087541869223591656578025082054857154444931223116584021990605138582897600159493951499249048015436829437819436694544784335936886188536668686424734137883742696331287208887701413779603318259647524035840153900708376557651523105216075350111479796075967849106272461236377021697859469760690979131025174260286934853437148548833013366399015927305471605646920847622045835514880901653733715977979404435684116049213181469797913331151864782771061008023194609992420231045644390991496402189358179324398313530889499826430367922209005228631900670287372424176210650443232447820713558426403092655 7 | 14592290243626061564870426814141136556387863648202300201046496189426843721911779769726376952593127245672291487877768377627660425940005909076600593194693627661690799997292135184153717093718461817893170219390246002858320679529396589607890784779376931993605803140021033166003028560924284939597450001868545519529468714298080271645787692293952451463460616123867601234250471764985641826729229973180664201897609991702233725274386012368879263091071838053723853139262340100578621136693955950933096947322633567105473706600429497385131140972956431875418251440311444152584870435681396566465918779795693653901798930239750784414121486474264236210870059831320232370642587579013758270754352292378395441805117782529368563885596356084098986188651504635670265660654834270531215930569007714247929808380650116197146405432096211487101400797395322871877815873581126105908032945355091775914730731693442398464753364093555967695628053977091652641282847003529099203356920358962438697933076992672980318476033260561326358729316957671264175569258794292255914177972482268303106762612540850903504592172960442053523117655559805580541041714614501329350861611084115890273255124076104943574158514111290282721101052532346068595319773083662411446079752323845813680235603943 8 | 13462181923439114839315602555635484109324928091857745435070733262009165845864614909562049156401737468979339251774682947422559368217043655407470791503382479421502035886739972103239107724089884670002143729871953729326117253189308962514330781668972305439480428462766400806265203388239690062754681190748650049478222390832649495984708861739904456654442307907510946494450810676498661312370736168047518355335136747442542272143267294383367124796527366984203697679472617826283674021866828793036035291054579443066306679764151244956055163634255813773171529222918247275520205083134765035848492402561127647803962642014468864638959023543725952167171356804874473034241689008087541869223591656578025082054857154444931223116584021990605138582897600159493951499249048015436829437819436694544784335936886188536668686424734137883742696331287208887701413779603318259647524035840153900708376557651523105216075350111479796075967849106272461236377021697859469760690979131025174260286934853437148548833013366399015927305471605646920847622045835514880901653733715977979404435684116049213181469797913331151864782771061008023194609992420231045644390991496402189358179324398313530889499826430367922209005228631900670287372424176210650443232447820713558426403092656 9 | 7101483198012776780118416800686555446680463233723679319178535364784546202680900331570193283701682465897308500144950917934461404335323739281265815051356875194229252728014512707200279077313470802325978769864405069723528013982435226035935978361503581371838515239839004930073110371494029318059523621044864356044490914925530619662678848768523919958159608329679682265569007399068162346646703768158545673031178765149484798726261337113386026049646281911911235465610338493190199322405822641842609724663912468147364572369728097769889057626848171478601466889938695421965215537090274387945626059773598366480077133000444164637509285444596491401103832066263334555532662612807751236188050604725270827311250755937191527046252556767188625922564852478149023001170414575620767769083707655796674452205855809761648524485760603538156288924035684080692521371739887022655246655474321108284361625655431711724367898827911889001160484724071432131176071593021390136362877873001947694641411055586747267665859191729814090948914339707952814723419792303761551119454745302304890041412160922259354476514060774210065479368294931287139130867724160039982416283259646723532771551453995584605653187798100171962735053945956696863417112203868052719585682059560951110436570575 10 | 13462181923439114839315602555635484109324928091857745435070733262009165845864614909562049156401737468979339251774682947422559368217043655407470791503382479421502035886739972103239107724089884670002143729871953729326117253189308962514330781668972305439480428462766400806265203388239690062754681190748650049478222390832649495984708861739904456654442307907510946494450810676498661312370736168047518355335136747442542272143267294383367124796527366984203697679472617826283674021866828793036035291054579443066306679764151244956055163634255813773171529222918247275520205083134765035848492402561127647803962642014468864638959023543725952167171356804874473034241689008087541869223591656578025082054857154444931223116584021990605138582897600159493951499249048015436829437819436694544784335936886188536668686424734137883742696331287208887701413779603318259647524035840153900708376557651523105216075350111479796075967849106272461236377021697859469760690979131025174260286934853437148548833013366399015927305471605646920847622045835514880901653733715977979404435684116049213181469797913331151864782771061008023194609992420231045644390991496402189358179324398313530889499826430367922209005228631900670287372424176210650443232447820713558426403092655 11 | -16137096614438708775741825079159172480872507422853013557050212618275463201069761874957406973809642442331943146404989760309645921079686994216222210228271092894091524381036627461799111026692376170939328969131146219226636350645195267601833889611980517156269953223019918750975150886403519624869980702294088400149600677402268815337521531259268555427928071541407684884757490445237764199750212517355391550430739838019452426553059992821937339058514610990757535987437865338911507844293249924717976051472857742227787646978503586948452992800392313065333012469803138807574019706931132231980511541173780184541019875542467820872843850165132106770693454178353146715507538873169329240277754492619553343500985252845248253477846926259871911844538583211374744539894406779313105637325432882304600188500022274083992561105183702043591541289730241913518427727309140240137810870443685451231909081010240219533012723457752402128115137820083134081067497760415882104383984543470963303886017861339703100929275759490403764168322860556420549891181949699458324816626577224195747242072655515047945103006998834936345157623548131975491395302210133215051315727651994521311456930249407777397770255232870831220618513720037567887225105092031946498030517365252679462949030781 12 | 13462181923439114839315602555635484109324928091857745435070733262009165845864614909562049156401737468979339251774682947422559368217043655407470791503382479421502035886739972103239107724089884670002143729871953729326117253189308962514330781668972305439480428462766400806265203388239690062754681190748650049478222390832649495984708861739904456654442307907510946494450810676498661312370736168047518355335136747442542272143267294383367124796527366984203697679472617826283674021866828793036035291054579443066306679764151244956055163634255813773171529222918247275520205083134765035848492402561127647803962642014468864638959023543725952167171356804874473034241689008087541869223591656578025082054857154444931223116584021990605138582897600159493951499249048015436829437819436694544784335936886188536668686424734137883742696331287208887701413779603318259647524035840153900708376557651523105216075350111479796075967849106272461236377021697859469760690979131025174260286934853437148548833013366399015927305471605646920847622045835514880901653733715977979404435684116049213181469797913331151864782771061008023194609992420231045644390991496402189358179324398313530889499826430367922209005228631900670287372424176210650443232447820713558426403092655 13 | -4312183719116137502282699941060021967850161392520528525513333702400182396432547110544224129294216033054802134410255473455617410941200624380130585773235751994192243087536388974759703863502111432186904547234668507650657197416572774303588957441899906707810227590040020603909823911795884095804762585786378065462846063797978496176943966700736811839945774063197596088404606394323044756642009865815441939257445666997984429583059592756916636333473082542295818096884834895642190349690837613042982227030747274981088487416809133350115821285118319704311757995692220559473103531293619703281251189128117393357794457054997273708636431968140346072705030596152405682259495638236295816233129089607906926238603004288058743788251652940982874223483296889801677397448245316930305261629534549399534427777942621601205231298754959106426319312651861243291747506477208831193782210026160535339548422966754157515705641930344820115867990853194319696111417985745508555296451739768174719501720760278558190943500070508763566136858980065377323761435744807629208465424558125499371096605948278908678402909613911796577224246515427459414320787044169513615659186203044233728558540011495471402899628861304653764528224882609098768906924043150988329739845332684336054467989884 14 | 13462181923439114839315602555635484109324928091857745435070733262009165845864614909562049156401737468979339251774682947422559368217043655407470791503382479421502035886739972103239107724089884670002143729871953729326117253189308962514330781668972305439480428462766400806265203388239690062754681190748650049478222390832649495984708861739904456654442307907510946494450810676498661312370736168047518355335136747442542272143267294383367124796527366984203697679472617826283674021866828793036035291054579443066306679764151244956055163634255813773171529222918247275520205083134765035848492402561127647803962642014468864638959023543725952167171356804874473034241689008087541869223591656578025082054857154444931223116584021990605138582897600159493951499249048015436829437819436694544784335936886188536668686424734137883742696331287208887701413779603318259647524035840153900708376557651523105216075350111479796075967849106272461236377021697859469760690979131025174260286934853437148548833013366399015927305471605646920847622045835514880901653733715977979404435684116049213181469797913331151864782771061008023194609992420231045644390991496402189358179324398313530889499826430367922209005228631900670287372424176210650443232447820713558426403092656 15 | 12744721294482939289399494190571078761715232268237616295514461729009920983568445027148085027958454869034346687133599174835307364348147850572933774719226378472903153725513338124321571362516930479973566876701748374134650683654919701463482725806893656920132858519925980998718759379703563252187961653480700354301271883792350632939840091187169312551668018413523819652669056478230651527801463938452713462500489457467564505677125234801837723435463388054967834756871913229052681682476849611147123016955273493746896848093461824738713030398454074867183025453975487168236731839903420679512186096266283519252114272257086337521403345253170048666754100844805306196331393086487849848123298102450446988786065905341730718544085940833074805067773533238078062545551583332882088179770000555251646271725225179761563269955846647692239775411902034338280699189103055252929892771685459286101354015432220540432112584320413546053970000771921038694393087469226622532605643778846488033326009235911301650464281089587154160279064706973847432839353798023540526273254815371198930052261194557764106466179300619961855296588948450877057366739640607471418817511111778142848528186989371001500937777104294146792110953660849207455427895534319757043772964532276484526735729166 16 | 13462181923439114839315602555635484109324928091857745435070733262009165845864614909562049156401737468979339251774682947422559368217043655407470791503382479421502035886739972103239107724089884670002143729871953729326117253189308962514330781668972305439480428462766400806265203388239690062754681190748650049478222390832649495984708861739904456654442307907510946494450810676498661312370736168047518355335136747442542272143267294383367124796527366984203697679472617826283674021866828793036035291054579443066306679764151244956055163634255813773171529222918247275520205083134765035848492402561127647803962642014468864638959023543725952167171356804874473034241689008087541869223591656578025082054857154444931223116584021990605138582897600159493951499249048015436829437819436694544784335936886188536668686424734137883742696331287208887701413779603318259647524035840153900708376557651523105216075350111479796075967849106272461236377021697859469760690979131025174260286934853437148548833013366399015927305471605646920847622045835514880901653733715977979404435684116049213181469797913331151864782771061008023194609992420231045644390991496402189358179324398313530889499826430367922209005228631900670287372424176210650443232447820713558426403092656 17 | -5688767768416319724906702810027421609821891321884942557087013648814895242292095464175329830608197199853176021973285548848121155271399737523354623841085560072532734874560049924966064331138980713768271263260785998007089353510926485507751363650697871482907133541489257091322171084223930327452366002220669540201682850740074489767567098290566564180269939851889729085143632217468851307944234374379009258905383324561961109039588823933782603657667605433607825675408748983539083316111909158681176568881760221368848856327091205996958793155468313668423227603948569300004800990685924984586165663259274398801808708056434089164313061005419433948731947199241073971935435608243690430064055708624780274899228647571281958309404955083962248697336417821624000951259118817942839549758199802595396189567145238477828452269702189023138260513459519173025059798921187472118473051545609902878488973702386111216157260593071611023041868137964626060179064853810968892884105399776046381466514681872421135623915164802212128455992581094697043851684430697286839385753243817887391411194991486097153530385174515125569530600350988338040566759003603909950240291517237241055158609536889992926080178433517190146120282080094071540018134419213234843148206306403767034894663770 18 | 13462181923439114839315602555635484109324928091857745435070733262009165845864614909562049156401737468979339251774682947422559368217043655407470791503382479421502035886739972103239107724089884670002143729871953729326117253189308962514330781668972305439480428462766400806265203388239690062754681190748650049478222390832649495984708861739904456654442307907510946494450810676498661312370736168047518355335136747442542272143267294383367124796527366984203697679472617826283674021866828793036035291054579443066306679764151244956055163634255813773171529222918247275520205083134765035848492402561127647803962642014468864638959023543725952167171356804874473034241689008087541869223591656578025082054857154444931223116584021990605138582897600159493951499249048015436829437819436694544784335936886188536668686424734137883742696331287208887701413779603318259647524035840153900708376557651523105216075350111479796075967849106272461236377021697859469760690979131025174260286934853437148548833013366399015927305471605646920847622045835514880901653733715977979404435684116049213181469797913331151864782771061008023194609992420231045644390991496402189358179324398313530889499826430367922209005228631900670287372424176210650443232447820713558426403092656 19 | 17753707995031941950296042001716388616701158084309198297946338411961365506702250828925483209254206164743271250362377294836153510838309348203164537628392188011436182603864836040921972964378603628914872036704424180199503510698535590052963319817696185845452155502109601536753038807089767262288322095287583471214953282996986642107552582636700442629659566070027133779893072602905141180086540104426013276335059083223526160088093013173982319712078199181750135160342217432945400865800814156010211720090735640055900761259224345756511402995088355230139684586052493919237623443565991094129592323054217396680043306066002575255731764924216849927765005999479846360417605175919803620978079271830065242913148381007561556489115025210557048948893999752395319609858532018567764261263696379007710884675856979706685871815701498560600124405019240697538599320533465853998366157825587393913743845695865784204310064934086255894535462291729635978662525774357482173053777459025023541364449646929009980978696719930691056979252648014180507996695815392257378640042877289849490041951859222979437862555555454588433205342202491177649531359237346177270618422082962441894028858867589818783153004204066883158844403432193203520403968852757038128714987787349471143240176129 20 | -------------------------------------------------------------------------------- /key512.sk: -------------------------------------------------------------------------------- 1 | mlee secret key (p,B) 2 | 17753707995031941950296042001716388616701158084309198297946338411961365506702250828925483209254206164743271250362377294836153510838309348203164537628392188011436182603864836040921972964378603628914872036704424180199503510698535590052963319817696185845452155502109601536753038807089767262288322095287583471214953282996986642107552582636700442629659566070027133779893072602905141180086540104426013276335059083223526160088093013173982319712078199181750135160342217432945400865800814156010211720090735640055900761259224345756511402995088355230139684586052493919237623443565991094129592323054217396680043306066002575255731764924216849927765005999479846360417605175919803620978079271830065242913148381007561556489115025210557048948893999752395319609858532018567764261263696379007710884675856979706685871815701498560600124405019240697538599320533465853998366157825587393913743845695865784204310064934086255894535462291729635978662525774357482173053777459025023541364449646929009980978696719930691056979252648014180507996695815392257378640042877289849490041951859222979437862555555454588433205342202491177649531359237346177270618422082962441894028858867589818783153004204066883158844403432193203520403968852757038128714987787349471143240176129 3 | 35507415990063883900592084003432777233402316168618396595892676823922731013404501657850966418508412329486542500724754589672307021676618696406329075256784375971146263640072563536001395386567354011629893849322025348617640069912176130179679891807517906859192576199195024650365551857470146590297618105224321780222454574627653098313394243842619599790798041648398411327845036995340811733233518840792728365155893825747423993631306685566930130248231409559556177328051692465950996612029113209213048623319562340736822861848640488849445288134240857393007334449693477109826077685451371939728130298867991832400385665002220823187546427222982457005519160331316672777663313064038756180940253023626354136556253779685957635231262783835943129612824262390745115005852072878103838845418538278983372261029279048808242622428803017690781444620178420403462606858699435113276233277371605541421808128277158558621839494139559445005802423620357160655880357965106950681814389365009738473207055277933736338329295958649070454744571698539764073617098961518807755597273726511524450207060804611296772382570303871050327396841474656435695654338620800199912081416298233617663857757269977923028265938990500859813675269729783484317085561019340263597928410297804755552182852877 4 | -------------------------------------------------------------------------------- /key768.pk: -------------------------------------------------------------------------------- 1 | mlee public key (p,alpha,{c[i],B[i]} 2 | 177799769440351503193954156229853867864550432928748355669408756484666836990787374386619103207512631482395433074172089176519429233338571635508500868496737396378022403186276425039709644725751277769370284015492474396953566691176219446669764888632322990411978415847330667986964186726304485373802438956806143231044888658646645737686947221201892950109376127027434430620903012043841001781958696223598123257721116291128393740994106549457339199674899762849840660008468759903053380248901258509819448271054736706887741490116199707180330891417757047494679461308725071391077318010951229888582316757290070986966379409249447566832717107586571559688850789955094017500471962853160077066120780911726163616150388335347139355371606128664982668471685784924389836458201621114573026260398266459109146478773440438297270541109609822478912769119827027412720307437024592845201845515204862406309587961173783043371443715966579506091427863367173603883511913346353875811535038898811498259379711172752455904677267393235973560812097280452728375021115438963283417273087971504532140481009484484236372866789205585329664752859454967827380339850092140640944022298021708203379944541141624141153355279691659600575283379537207085759316860067905280903412806936270758562477750037001915735294930409637240366949870418021270706384643002032100440919796441205177382242736865062395987732156001764740997188340278392770997198105693724463850952430269202070594583332174579326329486971821543599034884652138057924745358132481474457786258264960410571622675130738968354105478893125860332637471202879488902094241546082081948069989000522015624913219045963467886072994188806554493644036763119223220439197926002752484502099674602215546266008518540613928482499809516087423423695734899494122883407846907233245057946705209127290745001224580757558211471966153899494982893632454737744250235206773311223562854918078001 3 | 114513664053918023686501253862113700619438995076811747521934577684842302484983532019804722855788870601442981415552421528113328916247739140412499909123971444431390471811222499698877243230940311901333619277480873712373741237644013062709671486572782405151880755361290220744646913258386982005068195192465134526634253502294341059707178993376028564180443030710849681330812596373558554178507645161845587924978745183488474412631604531526081951765142014487585986023594982149098206931914808143969792486741698505884891533298674108069708428852878316648672476093321682183080661839319980757168006234476888898138111579190833823845366933438744502847896042837664639835600663615642176722221612113645557535168593580370564501613935814863779952120723125146178721265010483373576393535713947803123888777874233015922592688322984230417793193059260249946179484598563720748562560437699072184805664853965185751513627763996501875466100712555422468314321237242467305712090445326281442093282246151613994587923940265852648266061349253944133544067118859578957904769269121834693735518877914790621567987292337822524421804844366624225363957257965744544106961342353711349867988794437236108146698477652168409020822913318308464081163087095205578482458137167070252371454332265094419836627114712500515737378019650525409506388283177532123643545373315158515262807342473996263010370492619439958445690723546050092161732463344974862803072629990365818646531405347670677768057628586625305193886197206065974374890662895176989042948337566339517708326876231633491297584879992120027254758391185268742755700413664506203236360513226778698805636733313170442933144167836622446581898154355318212125776720643241700648010478455271574879753856626377719016857007968964101729030411188272939750990533475909471761050032820307632244724742458888920562287793523532631434830995372277449947935948376609614428059584892457 4 | 52612011766767385711160734856193757177546340295841846714724138826816303835226790789059867256167439033516822035934642631281977090593188993434806174273124696905626706787268553946932338941792537227736696008358499126223219806043029098795473016834291608124067202469212669848531220466255961870774897440921388432061199332353135723791038126442679538365435384255789434028432717507228111792500745133720589924981864423375888484694624423639719339369042161403587569191707551054624006349973250728011159391097507743293928820257412796509348002261763445081108500011114582794094997024921307989990719130961056038239873085642480656701529096989492778812245079453188271857053098422893722320418004183869482590683798042866306880372412266469550595624472357448445589138794788849468242421228168834010486203985399490050530931633215701978057321257221560982712201875497757513062579630924461153418010160204480880919295499149694740651677067918253514073153294078507422264967496136288281179657234506176875728247693869181081132772790683436494133807801003402560616304644632301821516976301241387764527945083813611446518692572082870832924548962761153249362320917071978977132947162748339411970193395472750985476256678943104076788041044621191821477787247616297739818323603802977239426135195136398242654461175247545974190924534181614581826165289861241675141805159501163373067238033628679374328431820886778737207395049696226532342148502642384967832679653649947695309002725577520167259305456918872283092159187154840724812421552097962809834616042585599263913975099197655542663749164595603509157044457213010657046246221613783645498259670559736709413742810888148446954470312264060546268153856301767920676034346859858577673350152380701089432038145846136405628521878537359590032100026479446001572331599051705719956622933051319259783749983173147839782628226661113292796424157985882144100416681215044 5 | 159636175075674737135313240276427343293026608062639572752348267959519515538098626647075170246577287969124712214883197214523053095909919446935157227861652251655099661676062229681038939587181105415067089726371524468859696317032535628677555408357861900120178899756631402542158677684127125197264251290822236264987245975989384111165184028077701998395671561209492274645102694060495945475944981645224960079560303154669985710620108634799582562490422945927380036952539635147661693025275406203391863736335414179142579129205082805123033401335242441313138758637009751724953998666566620039528843994710287768181571923116575950109347558589701441483697569830740615374867597829425985231555588653019687617629238075745344257365088422704759894112582268041508241089850297863583751600274733114427759111629471654398517858517089002537983675567539480199900047627746177305062287337576872105392283672155134252094794384242246028931850546104802231184833726293133445869414130486124617893598935709928190861429067731461858242254591194033428194104763743058952804843943631152364426807439200013788148434283236609189599866692435298532176730273121448300555368016757489763680629746892372461665928419808650070839577103678168489603651033878145826314638682606018337112862951263767609767761633051760422024053453477195881938981507139776404801399786271628953852169454906725851087555974505041120452719929323682960563660112919121948541932865757876165967342357111105194581165736779601537482215325527661236003818699050326504341414538965144005589944278707994501332817453588390038299098058832194574228626964126315862515269961654390019412880859205475355395047857471418488328707718829247095772659521377259455801985186995825839939283710228252497874117048370743402794050709963040802154881347902599932986075300884169174928137686836184010265441177920139129652301937513022033063104071057563193071206314903414 6 | 52612011766767385711160734856193757177546340295841846714724138826816303835226790789059867256167439033516822035934642631281977090593188993434806174273124696905626706787268553946932338941792537227736696008358499126223219806043029098795473016834291608124067202469212669848531220466255961870774897440921388432061199332353135723791038126442679538365435384255789434028432717507228111792500745133720589924981864423375888484694624423639719339369042161403587569191707551054624006349973250728011159391097507743293928820257412796509348002261763445081108500011114582794094997024921307989990719130961056038239873085642480656701529096989492778812245079453188271857053098422893722320418004183869482590683798042866306880372412266469550595624472357448445589138794788849468242421228168834010486203985399490050530931633215701978057321257221560982712201875497757513062579630924461153418010160204480880919295499149694740651677067918253514073153294078507422264967496136288281179657234506176875728247693869181081132772790683436494133807801003402560616304644632301821516976301241387764527945083813611446518692572082870832924548962761153249362320917071978977132947162748339411970193395472750985476256678943104076788041044621191821477787247616297739818323603802977239426135195136398242654461175247545974190924534181614581826165289861241675141805159501163373067238033628679374328431820886778737207395049696226532342148502642384967832679653649947695309002725577520167259305456918872283092159187154840724812421552097962809834616042585599263913975099197655542663749164595603509157044457213010657046246221613783645498259670559736709413742810888148446954470312264060546268153856301767920676034346859858577673350152380701089432038145846136405628521878537359590032100026479446001572331599051705719956622933051319259783749983173147839782628226661113292796424157985882144100416681215045 7 | 58085882382907014029076642146295635160590781115987773296223402208311051790056109559267984786344631318385773958868794766780241792888533308624062618064299300540536876288138897203770894745249206117047574870909554783931949298913898694888954801483859450900582454495512006494417037884251391716835659404101427691808688998032319021218501870347874599857784610311820847239400270443831565627899003463481846502424830126696559292013373858609230341613092354216804519726370528328096981669920653093469978654333876144298561444114495483106999496810922125729818624232095916405599974437323884643468629113106027325663705428689372745092214499305973393313345639702358280138386502320989947237499467297141163857469880501412518657959103637927339908686512598589077374218362839960407083845384529314791203763280435013490214700606296511225805697572390806328998861408894961496162153825786451514825129585562970455864744156981557854890158326322155996499308369378537695685215062857615429214312649991066044771383139171226948144933041737348178607782224970582789248924112548814565069640877930862709655890872942464568351043243557993843806610702312717318030871497070698157574740341249205669786797188181651360918185310661461267430199411865242648038990387814911314159076129357199119562560680641654788611609833036430103187404793562106656219769140398234692001472225225711965116693263440011208574634135124560262449073001160929622459907347389175783237974292042303756596801106403681799045518761515831092476540768480342113688384444007267623233661685822858849651746075642268562771715883554847896182816580910548140684537021059903569398441173157589501130484186727683875944539216945581589884514974060676978794763964626556116192296495851634843144108958117856771285256882815808420439094715124823612956090526800424720606158852777381550544885847943009618497738828847758076521502110478509490131511791739944 8 | 52612011766767385711160734856193757177546340295841846714724138826816303835226790789059867256167439033516822035934642631281977090593188993434806174273124696905626706787268553946932338941792537227736696008358499126223219806043029098795473016834291608124067202469212669848531220466255961870774897440921388432061199332353135723791038126442679538365435384255789434028432717507228111792500745133720589924981864423375888484694624423639719339369042161403587569191707551054624006349973250728011159391097507743293928820257412796509348002261763445081108500011114582794094997024921307989990719130961056038239873085642480656701529096989492778812245079453188271857053098422893722320418004183869482590683798042866306880372412266469550595624472357448445589138794788849468242421228168834010486203985399490050530931633215701978057321257221560982712201875497757513062579630924461153418010160204480880919295499149694740651677067918253514073153294078507422264967496136288281179657234506176875728247693869181081132772790683436494133807801003402560616304644632301821516976301241387764527945083813611446518692572082870832924548962761153249362320917071978977132947162748339411970193395472750985476256678943104076788041044621191821477787247616297739818323603802977239426135195136398242654461175247545974190924534181614581826165289861241675141805159501163373067238033628679374328431820886778737207395049696226532342148502642384967832679653649947695309002725577520167259305456918872283092159187154840724812421552097962809834616042585599263913975099197655542663749164595603509157044457213010657046246221613783645498259670559736709413742810888148446954470312264060546268153856301767920676034346859858577673350152380701089432038145846136405628521878537359590032100026479446001572331599051705719956622933051319259783749983173147839782628226661113292796424157985882144100416681215044 9 | 145092207008867426410535860918168584696869332267501677515619391756693903042710163021739964377894364545019569702199795780204072898740406620908775637496179810318735144902914890611438713746346824147746244333508985233073806824959215744923356076471870160593707551477376990042564574403252782323896661586260290139811579250181042363328380841580958859297142048438099174818471362905459195540331465737179530494636027415650995838075553388473944294692107153143134443075845875494705869618056304600470880439287340185073608464429308938175412239355418000434786292988160302111527083207429571385698207707376464233097212992325809557875585660630025767303568652858687328153731198537703597390471269756979262168481446177575156303858100985700523209997641249181123598360925253792054197180552311314830825263326470660293466978069008063051114966326262013363481427027896294953152387214581276608167281924054152681691174579669043814610688373206949799414056425608311269602874033262238435224352802239753388498404341882866417464922667187468601996094425685442926466732479703383076822377526909882622227582591165667834915273331067329561004432178847148368989902714710378547708356827383912182600686021487616838965465557476992206966158592515175183776272755857661798599057242503328150338731296062524812718922897212795870680360452471703277530653163284329322469547485133789635830466224049269558947336439074748291783688553300583114941907730179603293430127021999402894149416399286593585684754064333437255389335427206557128802856143219863884471142484132735784257832501579560093145307923793705065138353741036933894605645085813606272053987972567538838370915677526288851038514308543136683625581974079747457789467539035324288963958668883724591482033684934974456859558627813549087943369089401747410695248104362031421622766735473420177171211077529877685053889375620517213088803885278909572817259670472929 10 | 52612011766767385711160734856193757177546340295841846714724138826816303835226790789059867256167439033516822035934642631281977090593188993434806174273124696905626706787268553946932338941792537227736696008358499126223219806043029098795473016834291608124067202469212669848531220466255961870774897440921388432061199332353135723791038126442679538365435384255789434028432717507228111792500745133720589924981864423375888484694624423639719339369042161403587569191707551054624006349973250728011159391097507743293928820257412796509348002261763445081108500011114582794094997024921307989990719130961056038239873085642480656701529096989492778812245079453188271857053098422893722320418004183869482590683798042866306880372412266469550595624472357448445589138794788849468242421228168834010486203985399490050530931633215701978057321257221560982712201875497757513062579630924461153418010160204480880919295499149694740651677067918253514073153294078507422264967496136288281179657234506176875728247693869181081132772790683436494133807801003402560616304644632301821516976301241387764527945083813611446518692572082870832924548962761153249362320917071978977132947162748339411970193395472750985476256678943104076788041044621191821477787247616297739818323603802977239426135195136398242654461175247545974190924534181614581826165289861241675141805159501163373067238033628679374328431820886778737207395049696226532342148502642384967832679653649947695309002725577520167259305456918872283092159187154840724812421552097962809834616042585599263913975099197655542663749164595603509157044457213010657046246221613783645498259670559736709413742810888148446954470312264060546268153856301767920676034346859858577673350152380701089432038145846136405628521878537359590032100026479446001572331599051705719956622933051319259783749983173147839782628226661113292796424157985882144100416681215045 11 | 142237251388155969140615474678065642147166362976079192282683992553615878705325746813379513481526179115317363919452484962567015777349023995063262021390278978836699054822315227414892424681856195651013006651900872271165695292648361719165314771032322398256427446339023567324120435275627360952200940580027311414267294726153251552523713464304579615448229411904422136801819492217729887135817907167580731898779258629633486670053908676103327378801589833713585852096723817818069212449761735424587755851443309819197178264012459264981623692478989207058036322606873373963963111999499142959189141949604791787362965600742366284257181024287769915233234499982056320092352640450495749080821575359464266048823267319479343660029574332387946005905257245925779930449521906025438352503642458408078530790477958665303796255478612637709015389088049501243955533963689317232588284431537443975487442398286527582524820717177400306461138028394869967018056458347337053745154491909962141663836051006661088008523525685271134339511294572712964795884415207433557864334985677996966457041643261282577175862002576214765548147652229158089463763603646562522225206981903241001762895468869538202866864292367244805196591507671772035724139748301507927981919838379673103145205535970242358716195051574956590050921168903402578324348905792362783904758171081881980479925242591340083066338817447143979867436224792598869167898442936820103014706918946949142120181012202699859760037942763428866006123298667583601402967373980540242559271060388633615683414909096508261561882602759038306644113172648175035701193764520369692739084382421207678183713091538875779093082881001539681100414932858175371173054139179012631397565866130520196040961183035563091056194826717507849533725884427248544504454903206151155284150675022504330043716676841074032695397343197016474069444264857950966227302107789137794985012485491809 12 | 52612011766767385711160734856193757177546340295841846714724138826816303835226790789059867256167439033516822035934642631281977090593188993434806174273124696905626706787268553946932338941792537227736696008358499126223219806043029098795473016834291608124067202469212669848531220466255961870774897440921388432061199332353135723791038126442679538365435384255789434028432717507228111792500745133720589924981864423375888484694624423639719339369042161403587569191707551054624006349973250728011159391097507743293928820257412796509348002261763445081108500011114582794094997024921307989990719130961056038239873085642480656701529096989492778812245079453188271857053098422893722320418004183869482590683798042866306880372412266469550595624472357448445589138794788849468242421228168834010486203985399490050530931633215701978057321257221560982712201875497757513062579630924461153418010160204480880919295499149694740651677067918253514073153294078507422264967496136288281179657234506176875728247693869181081132772790683436494133807801003402560616304644632301821516976301241387764527945083813611446518692572082870832924548962761153249362320917071978977132947162748339411970193395472750985476256678943104076788041044621191821477787247616297739818323603802977239426135195136398242654461175247545974190924534181614581826165289861241675141805159501163373067238033628679374328431820886778737207395049696226532342148502642384967832679653649947695309002725577520167259305456918872283092159187154840724812421552097962809834616042585599263913975099197655542663749164595603509157044457213010657046246221613783645498259670559736709413742810888148446954470312264060546268153856301767920676034346859858577673350152380701089432038145846136405628521878537359590032100026479446001572331599051705719956622933051319259783749983173147839782628226661113292796424157985882144100416681215044 13 | 16906059991720688768737860770974804726255681474954595377920650860891605969719618891342268334184803561114969213257308054713090444004213867867304732204092365204133590412532297767260212611790655032932839542446524867798422574559936688324806650562878113831593945362059831040079695626742758157740218054321871430136788571852344209313287934496897712360744296493253463316045732291517142514883161501674885912767441389623082589990447829157098369121744826714557997975230494859550876355888709284971580494334629015384041732726617269258459269726883736854219374523454272523996129905911292400791181900644019889006846826782022446369136756576562084733936809905471840083440846343560084709791158273382595503450839290281501593475270842237002040110609950751598660243444883079797282758248048648390504468685920778156306100961508364805040146283984496090784724456576087130263446427695730876844535835122879141463167819350872700806282066949162777370506655963467751130265606246595769458833753222657233414518130242213647546903477758347651459903609443088836034736772248552231444208320888098178013920028922699512900584467740878382665415990323203833592858923505833641976172360773305407570996604755813275112858587341826799124720659567042982611207863941156080159591150338829982725287047219209727890678971081626789548201718595500118354488033133737486027286895787222887001271355534156879730759280918332843536020262251119476098412893049553486438954782745433833315725225801886411362718480794256549256738172977637181147240484386544204748104011018044106155012398483035707586594678212128419138183106840713057525699536355961207129624216341569338147626284920311315159081374348460044967489412667463130358475535306514040167802684886864180773252707646812475991828658781554412752880528556913607462586379848696254987201820120590667090264780026106825771139030599420769785483030617633293079358659559450 14 | 52612011766767385711160734856193757177546340295841846714724138826816303835226790789059867256167439033516822035934642631281977090593188993434806174273124696905626706787268553946932338941792537227736696008358499126223219806043029098795473016834291608124067202469212669848531220466255961870774897440921388432061199332353135723791038126442679538365435384255789434028432717507228111792500745133720589924981864423375888484694624423639719339369042161403587569191707551054624006349973250728011159391097507743293928820257412796509348002261763445081108500011114582794094997024921307989990719130961056038239873085642480656701529096989492778812245079453188271857053098422893722320418004183869482590683798042866306880372412266469550595624472357448445589138794788849468242421228168834010486203985399490050530931633215701978057321257221560982712201875497757513062579630924461153418010160204480880919295499149694740651677067918253514073153294078507422264967496136288281179657234506176875728247693869181081132772790683436494133807801003402560616304644632301821516976301241387764527945083813611446518692572082870832924548962761153249362320917071978977132947162748339411970193395472750985476256678943104076788041044621191821477787247616297739818323603802977239426135195136398242654461175247545974190924534181614581826165289861241675141805159501163373067238033628679374328431820886778737207395049696226532342148502642384967832679653649947695309002725577520167259305456918872283092159187154840724812421552097962809834616042585599263913975099197655542663749164595603509157044457213010657046246221613783645498259670559736709413742810888148446954470312264060546268153856301767920676034346859858577673350152380701089432038145846136405628521878537359590032100026479446001572331599051705719956622933051319259783749983173147839782628226661113292796424157985882144100416681215045 15 | -93643272106852081253319623086448956589026884334817952177262140871126828300909431740676036343363231544265878033818026223435600030234414322382224118356535841550422489198688269594837532591654635106438411113514942416925504576856528746077160520932095317775198860310724435524560414909988632142082407157612462540383243015796107936883871856872331606223971823907407768899179677727144065467402628436030115376373166895813609000747820990445594268843672165924180665419065917762952826043359271468806867382119386019081962089389574674012532846724048484284761892335115984552925358457407778811893712959560943652035343089895160545275541610703983806829795228014198444244890206842093253201513557758380126632909669449870359373568548309051941797229558728819276006518767494674364481902071293847500980387329872623104889315207223851852179073060692209601936252530557249217618244752077480235209832601056870648910685702247200524836522314634950484391606880500067103092290239339822641002802545450533994300118971196741734896164608717524121072495196678027763758883308717513738021803388786172448347384123009401469041751960872535073902261269517069852001819325074516134616975101814639477569475036561298727705085586036584574750110338857697800989050429723748644735830658222122672512738549559377664642257590208693701931971542954135247317158585296614113526497394176782912609371218620692140952229206952768094589112795537579368920257014238214107557466210145572453927057497480396332642159776672473461007773785436539238681035857070594496111763260570027651888913835822552631732925423226668539588890764934842259562591778014767065147364636158339883181440670375755762960887059586438695401329962038405194263324559233060622183810016900834110167292096677683695433860868967460852301163826358768410457138697640739917356935198761460651215710785356989254923808267547279448188733832020395311324590346334974 16 | 52612011766767385711160734856193757177546340295841846714724138826816303835226790789059867256167439033516822035934642631281977090593188993434806174273124696905626706787268553946932338941792537227736696008358499126223219806043029098795473016834291608124067202469212669848531220466255961870774897440921388432061199332353135723791038126442679538365435384255789434028432717507228111792500745133720589924981864423375888484694624423639719339369042161403587569191707551054624006349973250728011159391097507743293928820257412796509348002261763445081108500011114582794094997024921307989990719130961056038239873085642480656701529096989492778812245079453188271857053098422893722320418004183869482590683798042866306880372412266469550595624472357448445589138794788849468242421228168834010486203985399490050530931633215701978057321257221560982712201875497757513062579630924461153418010160204480880919295499149694740651677067918253514073153294078507422264967496136288281179657234506176875728247693869181081132772790683436494133807801003402560616304644632301821516976301241387764527945083813611446518692572082870832924548962761153249362320917071978977132947162748339411970193395472750985476256678943104076788041044621191821477787247616297739818323603802977239426135195136398242654461175247545974190924534181614581826165289861241675141805159501163373067238033628679374328431820886778737207395049696226532342148502642384967832679653649947695309002725577520167259305456918872283092159187154840724812421552097962809834616042585599263913975099197655542663749164595603509157044457213010657046246221613783645498259670559736709413742810888148446954470312264060546268153856301767920676034346859858577673350152380701089432038145846136405628521878537359590032100026479446001572331599051705719956622933051319259783749983173147839782628226661113292796424157985882144100416681215045 17 | 177799769440351503193954156229853867864550432928748355669408756484666836990787374386619103207512631482395433074172089176519429233338571635508500868496737396378022403186276425039709644725751277769370284015492474396953566691176219446669764888632322990411978415847330667986964186726304485373802438956806143231044888658646645737686947221201892950109376127027434430620903012043841001781958696223598123257721116291128393740994106549457339199674899762849840660008468759903053380248901258509819448271054736706887741490116199707180330891417757047494679461308725071391077318010951229888582316757290070986966379409249447566832717107586571559688850789955094017500471962853160077066120780911726163616150388335347139355371606128664982668471685784924389836458201621114573026260398266459109146478773440438297270541109609822478912769119827027412720307437024592845201845515204862406309587961173783043371443715966579506091427863367173603883511913346353875811535038898811498259379711172752455904677267393235973560812097280452728375021115438963283417273087971504532140481009484484236372866789205585329664752859454967827380339850092140640944022298021708203379944541141624141153355279691659600575283379537207085759316860067905280903412806936270758562477750037001915735294930409637240366949870418021270706384643002032100440919796441205177382242736865062395987732156001764740997188340278392770997198105693724463850952430269202070594583332174579326329486971821543599034884652138057924745358132481474457786258264960410571622675130738968354105478893125860332637471202879488902094241546082081948069989000522015624913219045963467886072994188806554493644036763119223220439197926002752484502099674602215546266008518540613928482499809516087423423695734899494122883407846907233245057946705209127290745001224580757558211471966153899494982893632454737744250235206773311223562854918078001 18 | 52612011766767385711160734856193757177546340295841846714724138826816303835226790789059867256167439033516822035934642631281977090593188993434806174273124696905626706787268553946932338941792537227736696008358499126223219806043029098795473016834291608124067202469212669848531220466255961870774897440921388432061199332353135723791038126442679538365435384255789434028432717507228111792500745133720589924981864423375888484694624423639719339369042161403587569191707551054624006349973250728011159391097507743293928820257412796509348002261763445081108500011114582794094997024921307989990719130961056038239873085642480656701529096989492778812245079453188271857053098422893722320418004183869482590683798042866306880372412266469550595624472357448445589138794788849468242421228168834010486203985399490050530931633215701978057321257221560982712201875497757513062579630924461153418010160204480880919295499149694740651677067918253514073153294078507422264967496136288281179657234506176875728247693869181081132772790683436494133807801003402560616304644632301821516976301241387764527945083813611446518692572082870832924548962761153249362320917071978977132947162748339411970193395472750985476256678943104076788041044621191821477787247616297739818323603802977239426135195136398242654461175247545974190924534181614581826165289861241675141805159501163373067238033628679374328431820886778737207395049696226532342148502642384967832679653649947695309002725577520167259305456918872283092159187154840724812421552097962809834616042585599263913975099197655542663749164595603509157044457213010657046246221613783645498259670559736709413742810888148446954470312264060546268153856301767920676034346859858577673350152380701089432038145846136405628521878537359590032100026479446001572331599051705719956622933051319259783749983173147839782628226661113292796424157985882144100416681215045 19 | 71119907776140601277581662491941547145820173171499342267763502593866734796314949754647641283005052592958173229668835670607771693335428654203400347398694958551208961274510570015883857890300511107748113606196989758781426676470487778661718485054102380448447364092785451570235311244048651475189157945830604949184407341759027093636322674745503889797854581334067411440735774244564597269568244604657646570638009537911207675578392023431075662811477446214012591603124297071566687081306093889767578848678134162825379777213394945314105308495904973999443128953144594301928761497591619669836593715109986611989426837196506512726642755119082765351408925406327543371580224695638130045732066452487866722383466676592160574947933947482081696458474225154992783651829718106513495176838490083619475161300490373496598045496823779890388695679893781345934612569762905589083509755112819415353081835991602608212580721969584285651550475862312270752317465143040380537403588581641607033681466679986398596116240263248080287272956218247437676548139734737966692912219370200581411340035472614268714308885428715798630547948592396171687113221633587657299570362980282807025151312361432134059385430919814259746243652958463953540886420344239513983818150851776632782732189285580180375328028266717738596805820537290062571541699850591573312072130656176934084285702626332882890348254567056947121757373310695952006264188563473705101327420591778222098818106568502622189817130877064482861091733912249789404273122376454393838219478071429328606997116272076953357548433926153642580093708963960823597340281644539380482754656497089951837002168625398320778780146540005571932025963334135371523859269301009225107776236531557809078864045131744438128877874418442087202204408293772558881448409719859900710262302347829106009485388859438122559011092984234083156567114653291834702576398255140799338697212243695 20 | -------------------------------------------------------------------------------- /key768.sk: -------------------------------------------------------------------------------- 1 | mlee secret key (p,B) 2 | 177799769440351503193954156229853867864550432928748355669408756484666836990787374386619103207512631482395433074172089176519429233338571635508500868496737396378022403186276425039709644725751277769370284015492474396953566691176219446669764888632322990411978415847330667986964186726304485373802438956806143231044888658646645737686947221201892950109376127027434430620903012043841001781958696223598123257721116291128393740994106549457339199674899762849840660008468759903053380248901258509819448271054736706887741490116199707180330891417757047494679461308725071391077318010951229888582316757290070986966379409249447566832717107586571559688850789955094017500471962853160077066120780911726163616150388335347139355371606128664982668471685784924389836458201621114573026260398266459109146478773440438297270541109609822478912769119827027412720307437024592845201845515204862406309587961173783043371443715966579506091427863367173603883511913346353875811535038898811498259379711172752455904677267393235973560812097280452728375021115438963283417273087971504532140481009484484236372866789205585329664752859454967827380339850092140640944022298021708203379944541141624141153355279691659600575283379537207085759316860067905280903412806936270758562477750037001915735294930409637240366949870418021270706384643002032100440919796441205177382242736865062395987732156001764740997188340278392770997198105693724463850952430269202070594583332174579326329486971821543599034884652138057924745358132481474457786258264960410571622675130738968354105478893125860332637471202879488902094241546082081948069989000522015624913219045963467886072994188806554493644036763119223220439197926002752484502099674602215546266008518540613928482499809516087423423695734899494122883407846907233245057946705209127290745001224580757558211471966153899494982893632454737744250235206773311223562854918078001 3 | 355599538880703006387908312459707735729100865857496711338817512969333673981574748773238206415025262964790866148344178353038858466677143271017001736993474792756044806372552850079419289451502555538740568030984948793907133382352438893308592425270511902242236820463927257851176556220243257375945789729153024745922036708795135468181613373727519448989272906670337057203678871222822986347841223023288232853190047689556038377891960117155378314057387231070062958015621485357833435406530469448837894243390670814126898886066974726570526542479524869997215644765722971509643807487958098349182968575549933059947134185982532563633213775595413826757044627031637716857901123478190650228660332262439333611917333382960802874739669737410408482292371125774963918259148590532567475884192450418097375806502451867482990227484118899451943478399468906729673062848814527945417548775564097076765409179958013041062903609847921428257752379311561353761587325715201902687017942908208035168407333399931992980581201316240401436364781091237188382740698673689833464561096851002907056700177363071343571544427143578993152739742961980858435566108167938286497851814901414035125756561807160670296927154599071298731218264792319767704432101721197569919090754258883163913660946427900901876640141333588692984029102686450312857708499252957866560360653280884670421428513131664414451741272835284735608786866553479760031320942817368525506637102958891110494090532842513110949085654385322414305458669561248947021365611882271969191097390357146643034985581360384766787742169630768212900468544819804117986701408222696902413773282485449759185010843126991603893900732700027859660129816670676857619296346505046125538881182657789045394320225658722190644389372092210436011022041468862794407242048599299503551311511739145530047426944297190612795055464921170415782835573266459173512881991275703996693486061218475 4 | -------------------------------------------------------------------------------- /kit.c: -------------------------------------------------------------------------------- 1 | #include "kit.h" 2 | #include "crypto.h" 3 | 4 | int main_(int argc,char **argv) 5 | { 6 | int i; 7 | extern int optind; 8 | fhe_pk_t pk; 9 | fhe_sk_t sk; 10 | 11 | puts("MLEE homomorphic encryption toolkit"); 12 | 13 | //i=getopt(argc,argv,"gb"); 14 | 15 | if(i==-1||i==63) //keine option, falsche oder '?' 16 | ;//usage(); 17 | 18 | if(i=='g') 19 | { 20 | char *pkname,*skname; 21 | 22 | if(optind>=argc) 23 | ;//usage(); 24 | 25 | printf(" generating smart-keypair as {%s.sk,%s.pk}\n",argv[optind],argv[optind]); 26 | 27 | pkname=(char*)malloc(strlen(argv[optind]+4)); 28 | skname=(char*)malloc(strlen(argv[optind]+4)); 29 | sprintf(pkname,"%s.pk",argv[optind]); 30 | sprintf(skname,"%s.sk",argv[optind]); 31 | 32 | puts("init"); 33 | fhe_sk_init(sk); 34 | fhe_pk_init(pk); 35 | 36 | puts("generate"); 37 | fhe_keygen(pk, sk); 38 | 39 | puts("store"); 40 | fhe_pk_store(pk,pkname); 41 | fhe_sk_store(sk,skname); 42 | 43 | fhe_pk_clear(pk); 44 | fhe_sk_clear(sk); 45 | } 46 | if(i=='b') 47 | { 48 | //benchmark(); 49 | } 50 | return 0; 51 | } 52 | 53 | void fhe_lib_init(fhe_sk_t *sk2) 54 | { 55 | } 56 | /** I/O ***/ 57 | void fhe_pk_store(fhe_pk_t pk,char *s) 58 | { 59 | FILE *f; 60 | f=fopen(s,"w"); 61 | fprintf(f,"mlee public key (p,alpha,{c[i],B[i]}\n"); 62 | 63 | gmp_fprintf(f,"%Zd\n",pk->p); 64 | gmp_fprintf(f,"%Zd\n",pk->alpha); 65 | 66 | for (int i = 0; i < FHE_S1; i++) 67 | { 68 | gmp_fprintf(f,"%Zd\n%Zd\n", pk->c[i], pk->B[i]); 69 | } 70 | fclose(f); 71 | } 72 | int fhe_pk_load(fhe_pk_t pk,char *filename) 73 | { 74 | FILE *f; 75 | //static fhe_pk_t pk; 76 | char line[16384]; 77 | int i; 78 | 79 | //fhe_pk_init(pk); 80 | f=fopen(filename,"r"); 81 | if(f==NULL) 82 | return 0; 83 | 84 | fgets(line,16384,f); //header line 85 | 86 | fgets(line,16384,f); //p 87 | mpz_set_str(pk->p,line,10); 88 | fgets(line,16384,f); //alpha 89 | mpz_set_str(pk->alpha,line,10); 90 | 91 | for(i=0;ic[i],line,10); 95 | fgets(line,16384,f); 96 | mpz_set_str(pk->B[i],line,10); 97 | } 98 | fclose(f); 99 | 100 | return 1; 101 | } 102 | void fhe_sk_store(fhe_sk_t sk,char *filename) 103 | { 104 | FILE *f; 105 | 106 | f=fopen(filename,"w"); 107 | fprintf(f,"mlee secret key (p,B)\n"); 108 | gmp_fprintf(f,"%Zd\n", sk->p); 109 | gmp_fprintf(f,"%Zd\n", sk->B); 110 | fclose(f); 111 | } 112 | int fhe_sk_load(fhe_sk_t sk,char *filename) 113 | { 114 | FILE *f; 115 | //static fhe_sk_t sk; 116 | char line[16384]; 117 | 118 | //fhe_sk_init(sk); 119 | f=fopen(filename,"r"); 120 | if(f==NULL) 121 | return 0; 122 | fgets(line,16384,f); //header line 123 | 124 | fgets(line,16384,f); //p 125 | mpz_set_str(sk->p,line,10); 126 | fgets(line,16384,f); //B 127 | mpz_set_str(sk->B,line,10); 128 | fclose(f); 129 | 130 | return 1; 131 | } 132 | 133 | void fhe_int_init(fhe_int_t i) 134 | { 135 | mpz_init(i->mpz); 136 | i->noise=1; 137 | } 138 | 139 | void fhe_int_clear(fhe_int_t i) 140 | { 141 | mpz_clear(i->mpz); 142 | } 143 | 144 | void fhe_int_set(fhe_int_t to,fhe_int_t from) 145 | { 146 | mpz_set(to->mpz,from->mpz); 147 | to->noise=from->noise; 148 | } 149 | 150 | void 151 | fhe_int_add(fhe_int_t res, fhe_int_t a, fhe_int_t b, fhe_pk_t pk) 152 | { 153 | /*if(((a->noise+1)>NOISE_THRESHOLD) || ((b->noise+1) > NOISE_THRESHOLD)) 154 | { 155 | if(a->noise > b->noise) 156 | { 157 | fhe_recrypt(a->mpz,pk); 158 | a->noise=NOISE_RESET; 159 | res->noise=NOISE_RESET+1; 160 | } 161 | else 162 | { 163 | fhe_recrypt(b->mpz,pk); 164 | b->noise=NOISE_RESET; 165 | res->noise=NOISE_RESET+1; 166 | } 167 | }*/ 168 | crypto_add(res->mpz,a->mpz,b->mpz,pk); 169 | res->noise=a->noise>b->noise?a->noise:b->noise; 170 | } 171 | 172 | void 173 | fhe_int_mul(fhe_int_t res, fhe_int_t a, fhe_int_t b, fhe_pk_t pk) 174 | { 175 | //printf("M(%d,%d=",a->noise,b->noise); 176 | if((a->noise + b->noise) > NOISE_THRESHOLD) 177 | { 178 | if(a->noise > b->noise) 179 | { 180 | fhe_recrypt(a->mpz,pk); 181 | a->noise=NOISE_RESET; 182 | 183 | if(b->noise>3) 184 | { 185 | fhe_recrypt(b->mpz,pk); 186 | b->noise=NOISE_RESET; 187 | } 188 | } 189 | else 190 | { 191 | fhe_recrypt(b->mpz,pk); 192 | b->noise=NOISE_RESET; 193 | 194 | if(a->noise>3) 195 | { 196 | fhe_recrypt(a->mpz,pk); 197 | a->noise=NOISE_RESET; 198 | } 199 | 200 | } 201 | } 202 | crypto_mul(res->mpz,a->mpz,b->mpz,pk); 203 | res->noise=a->noise+b->noise; 204 | //printf("%d) ",res->noise); 205 | } 206 | 207 | void fhe_int_xor(fhe_int_t res,fhe_int_t a,fhe_int_t b,fhe_pk_t pk) 208 | { 209 | fhe_int_add(res,a,b,pk); 210 | } 211 | 212 | void fhe_int_or(fhe_int_t res,fhe_int_t a,fhe_int_t b,fhe_pk_t pk) 213 | { 214 | if((a->noise + b->noise) > NOISE_THRESHOLD) 215 | { 216 | if(a->noise > b->noise) 217 | { 218 | fhe_recrypt(a->mpz,pk); 219 | a->noise=NOISE_RESET; 220 | } 221 | else 222 | { 223 | fhe_recrypt(b->mpz,pk); 224 | b->noise=NOISE_RESET; 225 | } 226 | } 227 | crypto_or(res->mpz,a->mpz,b->mpz,pk); 228 | res->noise=a->noise+b->noise; 229 | } 230 | 231 | void fhe_int_and(fhe_int_t res,fhe_int_t a,fhe_int_t b,fhe_pk_t pk) 232 | { 233 | fhe_int_mul(res,a,b,pk); 234 | } 235 | 236 | void fhe_int_not(fhe_int_t res,fhe_int_t a,fhe_pk_t pk) 237 | { 238 | crypto_not(res->mpz,a->mpz,pk); 239 | } 240 | 241 | void fhe_int_encrypt(fhe_int_t res,fhe_pk_t pk,int m) 242 | { 243 | fhe_encrypt(res->mpz,pk,m); 244 | res->noise=1; 245 | } 246 | -------------------------------------------------------------------------------- /kit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * kit.h 3 | * 4 | * Created on: 24.02.2012 5 | * Author: michaelbrenner 6 | */ 7 | 8 | #ifndef KIT_H_ 9 | #define KIT_H_ 10 | 11 | #define NOISE_THRESHOLD 7 //37 12 | #define NOISE_RESET 1 13 | 14 | #include 15 | #include "integer-fhe.h" 16 | 17 | typedef struct { 18 | mpz_t mpz; 19 | int noise; 20 | } _fhe_int; 21 | 22 | typedef _fhe_int fhe_int_t[1]; 23 | 24 | void fhe_lib_init(fhe_sk_t *sk2); 25 | 26 | void fhe_int_init(fhe_int_t i); 27 | 28 | void fhe_int_clear(fhe_int_t i); 29 | 30 | void fhe_int_set(fhe_int_t to,fhe_int_t from); 31 | 32 | /** I/O **/ 33 | void fhe_pk_store(fhe_pk_t pk,char *filename); 34 | 35 | void fhe_sk_store(fhe_sk_t sk,char *filename); 36 | 37 | int fhe_pk_load(fhe_pk_t pk,char *filename); 38 | 39 | int fhe_sk_load(fhe_sk_t sk,char *filename); 40 | 41 | void fhe_int_add(fhe_int_t res, fhe_int_t a, fhe_int_t b, fhe_pk_t pk); 42 | 43 | void fhe_int_mul(fhe_int_t res, fhe_int_t a, fhe_int_t b, fhe_pk_t pk); 44 | 45 | void fhe_autorecrypt(fhe_int_t a,fhe_pk_t pk); 46 | 47 | void fhe_int_xor(fhe_int_t res,fhe_int_t a,fhe_int_t b,fhe_pk_t pk); 48 | 49 | void fhe_int_or(fhe_int_t res,fhe_int_t a,fhe_int_t b,fhe_pk_t pk); 50 | 51 | void fhe_int_and(fhe_int_t res,fhe_int_t a,fhe_int_t b,fhe_pk_t pk); 52 | 53 | void fhe_int_not(fhe_int_t res,fhe_int_t a,fhe_pk_t pk); 54 | 55 | void fhe_int_encrypt(fhe_int_t res,fhe_pk_t pk,int m); 56 | 57 | #endif /* KIT_H_ */ 58 | -------------------------------------------------------------------------------- /test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * test.c 3 | * 4 | * Created on: 13.03.2012 5 | * Author: michaelbrenner 6 | */ 7 | #include "access.h" 8 | #include "alu.h" 9 | #include "trans.h" 10 | #include "crypto.h" 11 | #include "cu.h" 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | struct access_parm 19 | { 20 | fhe_pk_t pk; 21 | fhe_sk_t sk; 22 | _fhe_int *adr; 23 | _fhe_int *data; 24 | int fromrow; 25 | int torow; 26 | }; 27 | 28 | int test_access(fhe_pk_t pk,fhe_sk_t sk); 29 | int test_access_par(fhe_pk_t pk,fhe_sk_t sk); 30 | int test_access_thr(); 31 | int test_alu3(fhe_pk_t pk,fhe_sk_t sk); 32 | int test_cu(fhe_pk_t pk,fhe_sk_t sk); 33 | int test_rec(fhe_pk_t pk,fhe_sk_t sk); 34 | int test_search(fhe_pk_t pk,fhe_sk_t sk); 35 | 36 | void *thread0(void *parm); 37 | void *thread1(void *parm); 38 | void *thread2(void *parm); 39 | void *thread3(void *parm); 40 | 41 | pthread_t t0,t1,t2,t3; 42 | clock_t _mem; 43 | 44 | fhe_pk_t globalpk; 45 | fhe_sk_t globalsk; 46 | 47 | int main(int argc,char **argv) 48 | { 49 | fhe_sk_t sk; 50 | fhe_pk_t pk; 51 | 52 | fhe_pk_init(globalpk); 53 | fhe_sk_init(globalsk); 54 | 55 | //puts("keygen...");fflush(stdout); 56 | //fhe_keygen(pk,sk); 57 | 58 | fhe_sk_load(globalsk,"key512.sk"); 59 | fhe_pk_load(globalpk,"key512.pk"); 60 | 61 | //test_search(pk,sk); 62 | //test_rec(pk,sk); 63 | //test_cu(pk,sk); 64 | //test_access_par(globalpk,globalsk); 65 | test_access(globalpk,globalsk); 66 | //test_alu3(pk,sk); 67 | /* 68 | fhe_sk_clear(sk); 69 | fhe_pk_clear(pk); 70 | 71 | fhe_pk_init(pk); 72 | fhe_sk_init(sk); 73 | 74 | fhe_sk_load(sk,"key512.sk"); 75 | fhe_pk_load(pk,"key512.pk"); 76 | 77 | test_cu(pk,sk); 78 | 79 | fhe_sk_clear(sk); 80 | fhe_pk_clear(pk); 81 | 82 | 83 | fhe_pk_init(pk); 84 | fhe_sk_init(sk); 85 | 86 | fhe_sk_load(sk,"key768.sk"); 87 | fhe_pk_load(pk,"key768.pk"); 88 | 89 | test_cu(pk,sk); 90 | 91 | fhe_sk_clear(sk); 92 | fhe_pk_clear(pk); 93 | 94 | 95 | fhe_pk_init(pk); 96 | fhe_sk_init(sk); 97 | 98 | fhe_sk_load(sk,"key1024.sk"); 99 | fhe_pk_load(pk,"key1024.pk"); 100 | 101 | test_cu(pk,sk); 102 | 103 | fhe_sk_clear(sk); 104 | fhe_pk_clear(pk); 105 | */ 106 | } 107 | 108 | int test_rec(fhe_pk_t pk,fhe_sk_t sk) 109 | { 110 | clock_t _clock=0; 111 | 112 | fhe_int_t f; 113 | fhe_int_init(f); 114 | fhe_int_encrypt(f,pk,1); 115 | 116 | puts("recrypt");fflush(stdout); 117 | 118 | _clock=clock(); 119 | for(int i=0;i<1000;i++) 120 | { 121 | fhe_recrypt(f->mpz,pk); 122 | } 123 | _clock=clock()-_clock; 124 | 125 | fhe_int_clear(f); 126 | 127 | printf("1k recrypt=%ld\n",(_clock/CLOCKS_PER_SEC)); 128 | 129 | return 0; 130 | } 131 | 132 | int test_alu3(fhe_pk_t pk,fhe_sk_t sk) 133 | { 134 | _fhe_int *op1; 135 | _fhe_int *op2; 136 | _fhe_int *opcode; 137 | _fhe_int *res; 138 | fhe_int_t carry; 139 | long t=0; 140 | 141 | fhe_int_init(carry); 142 | fhe_int_encrypt(carry,pk,1); 143 | 144 | op1=vec_init(DATA_BITS); 145 | op2=vec_init(DATA_BITS); 146 | res=vec_init(DATA_BITS); 147 | opcode=vec_init(2); 148 | 149 | trans_int2data(1,op1,pk); 150 | trans_int2data(7,op2,pk); 151 | trans_int2vec(OPCODE_XOR,opcode,2,pk); 152 | 153 | for(int i=0;i<100;i++) 154 | { 155 | t+=alu3(res,opcode,carry,op1,op2,pk,sk); 156 | } 157 | printf("avg=%f\n",(float)t/CLOCKS_PER_SEC/100); 158 | 159 | trans_print(res,DATA_BITS,sk); 160 | 161 | return 0; 162 | } 163 | 164 | //void *thread0(void *parm) 165 | //{ 166 | // fhe_pk_t mypk; 167 | // 168 | // struct access_parm *p=(struct access_parm*)parm; 169 | // 170 | // 171 | // printf("thread0 start %d %d\n",p->fromrow,p->torow); 172 | // accessr_thr0(p->adr,p->data,globalpk,globalsk,p->fromrow,p->torow); 173 | // printf("thread0 end\n"); 174 | // 175 | // return NULL; 176 | //} 177 | // 178 | //void *thread1(void *parm) 179 | //{ 180 | // struct access_parm *p=(struct access_parm*)parm; 181 | // 182 | // printf("thread1 start %d %d\n",p->fromrow,p->torow); 183 | // accessr_thr1(p->adr,p->data,globalpk,globalsk,p->fromrow,p->torow); 184 | // printf("thread1 end\n"); 185 | // 186 | // return NULL; 187 | //} 188 | // 189 | //void *thread2(void *parm) 190 | //{ 191 | // struct access_parm *p=(struct access_parm*)parm; 192 | // 193 | // printf("thread2 start %d %d\n",p->fromrow,p->torow); 194 | // accessr_thr2(p->adr,p->data,globalpk,globalsk,p->fromrow,p->torow); 195 | // printf("thread2 end\n"); 196 | // 197 | // return NULL; 198 | //} 199 | // 200 | //void *thread3(void *parm) 201 | //{ 202 | // struct access_parm *p=(struct access_parm*)parm; 203 | // 204 | // printf("thread3 start %d %d\n",p->fromrow,p->torow); 205 | // accessr_thr3(p->adr,p->data,globalpk,globalsk,p->fromrow,p->torow); 206 | // printf("thread3 end\n"); 207 | // 208 | // return NULL; 209 | //} 210 | 211 | //int test_access_thr() 212 | //{ 213 | // _fhe_int *data0,*data1,*data2,*data3; 214 | // _fhe_int* adr; 215 | // //fhe_int_t rw; 216 | // clock_t timer=0; 217 | // fhe_int_t row0,row1,row2,row3; 218 | // struct access_parm parm0,parm1,parm2,parm3; 219 | // 220 | // access_init(ROWS,WORD_SIZE,globalpk); 221 | // 222 | // data0=vec_init(WORD_SIZE); 223 | // trans_int2data(128+31,data0,globalpk); 224 | // 225 | // data1=vec_init(WORD_SIZE); 226 | // trans_int2data(128+31,data1,globalpk); 227 | // 228 | // data2=vec_init(WORD_SIZE); 229 | // trans_int2data(128+31,data2,globalpk); 230 | // 231 | // data3=vec_init(WORD_SIZE); 232 | // trans_int2data(128+31,data3,globalpk); 233 | // 234 | // adr =vec_init(ADR_BITS); 235 | // trans_int2adr(23,adr,globalpk); 236 | // 237 | // parm0.adr=parm1.adr=parm2.adr=parm3.adr=adr; 238 | // parm0.data=data0;parm1.data=data1;parm2.data=data2;parm3.data=data3; 239 | // 240 | // parm0.fromrow=0;parm0.torow=8; 241 | // parm1.fromrow=8;parm1.torow=16; 242 | // parm2.fromrow=16;parm2.torow=24; 243 | // parm3.fromrow=24;parm3.torow=32; 244 | // 245 | // printf("master thread\n"); 246 | // 247 | // printf("master pk=%08x sk=%08x\n",globalpk,globalsk); 248 | // 249 | // if(pthread_create(&t0, NULL, thread0, &parm0)) { 250 | // fprintf(stderr, "Error creating thread 0\n"); 251 | // return 1; 252 | // } 253 | // 254 | // if(pthread_create(&t1, NULL, thread1, &parm1)) { 255 | // fprintf(stderr, "Error creating thread 1\n"); 256 | // return 1; 257 | // } 258 | // 259 | // if(pthread_create(&t2, NULL, thread2, &parm2)) { 260 | // fprintf(stderr, "Error creating thread 2\n"); 261 | // return 1; 262 | // } 263 | // 264 | // if(pthread_create(&t3, NULL, thread3, &parm3)) { 265 | // fprintf(stderr, "Error creating thread 3\n"); 266 | // return 1; 267 | // } 268 | // 269 | // printf("threads created\n"); 270 | // 271 | // if(pthread_join(t0, NULL)) { 272 | // fprintf(stderr, "Error joining thread 0\n"); 273 | // return 2; 274 | // } 275 | // 276 | // if(pthread_join(t1, NULL)) { 277 | // fprintf(stderr, "Error joining thread 1\n"); 278 | // return 2; 279 | // } 280 | // 281 | // if(pthread_join(t2, NULL)) { 282 | // fprintf(stderr, "Error joining thread 2\n"); 283 | // return 2; 284 | // } 285 | // 286 | // if(pthread_join(t3, NULL)) { 287 | // fprintf(stderr, "Error joining thread 3\n"); 288 | // return 2; 289 | // } 290 | // 291 | // return 0; 292 | //} 293 | 294 | int test_access_par(fhe_pk_t pk,fhe_sk_t sk) 295 | { 296 | _fhe_int* data; 297 | _fhe_int* adr; 298 | //fhe_int_t rw; 299 | clock_t timer=0; 300 | fhe_int_t row0,row1; 301 | int status; 302 | char *shmaddr; 303 | 304 | access_init(ROWS,WORD_SIZE,pk); 305 | 306 | data=vec_init(WORD_SIZE); 307 | trans_int2data(128+31,data,pk); 308 | 309 | adr =vec_init(ADR_BITS); 310 | trans_int2adr(16,adr,pk); 311 | 312 | //accessr(adr,data,pk,sk);printf("\n"); 313 | 314 | fhe_int_init(row0); 315 | fhe_int_init(row1); 316 | 317 | int shmid=shmget(0x07081974, 65536, IPC_CREAT|0600 ); 318 | 319 | int pid=fork(); 320 | 321 | if(pid==0) //child 322 | { 323 | timer+=accessr0(adr,data,&row0,pk,sk); 324 | printf("row0=%d\n",fhe_decrypt(row0->mpz,sk)); 325 | shmaddr=shmat(shmid,NULL,0); 326 | 327 | mpz_init(*((mpz_t*)shmaddr)); 328 | mpz_set(*((mpz_t*)shmaddr),row0->mpz); 329 | 330 | shmdt(shmaddr); 331 | 332 | exit(0); 333 | } 334 | else 335 | { 336 | timer+=accessr1(adr,data,&row1,pk,sk); 337 | printf("row1=%d\n",fhe_decrypt(row1->mpz,sk)); 338 | 339 | wait(&status); 340 | } 341 | 342 | shmaddr=shmat(shmid,NULL,0); 343 | //mpz_out_str(stdout,10,*((mpz_t*)shmaddr)); 344 | 345 | 346 | printf("avg clock=%ld\n",timer/CLOCKS_PER_SEC/2); 347 | printf("bank0=%d bank1=%d\n",fhe_decrypt(row0->mpz,sk),fhe_decrypt(row1->mpz,sk)); 348 | shmdt(shmaddr); 349 | 350 | //access_dump(ROWS,WORD_SIZE,sk); 351 | 352 | printf("AC:");trans_print(data,WORD_SIZE,sk);printf("\n"); 353 | 354 | //fhe_int_clear(rw); 355 | vec_clear(data,WORD_SIZE); 356 | vec_clear(adr,ADR_BITS); 357 | access_clear(ROWS,WORD_SIZE); 358 | return 0; 359 | } 360 | 361 | int test_access(fhe_pk_t pk,fhe_sk_t sk) 362 | { 363 | _fhe_int* data; 364 | _fhe_int* adr; 365 | //fhe_int_t rw; 366 | clock_t timer=0; 367 | 368 | puts("test_access"); 369 | //fhe_int_init(rw); 370 | 371 | access_init(ROWS,WORD_SIZE,pk); 372 | //access_dump(ROWS,WORD_SIZE,sk); 373 | 374 | //access_set(access_array[3*DATA_BITS+0],1,pk); 375 | //access_set(access_array[3*DATA_BITS+2],1,pk); 376 | 377 | //access_dump(ROWS,DATA_BITS,sk); 378 | 379 | data=vec_init(WORD_SIZE); 380 | trans_int2data(128+31,data,pk); 381 | 382 | adr =vec_init(ADR_BITS); 383 | trans_int2adr(3,adr,pk); 384 | 385 | //fhe_int_encrypt(rw,pk,WRITE); 386 | 387 | //printf("adr="); 388 | //trans_print(adr,ADR_BITS,sk); 389 | 390 | //puts(""); 391 | 392 | //printf("AC:");trans_print(data,WORD_SIZE,sk);printf("\n"); 393 | 394 | //printf("bit size=%ld\n",mpz_sizeinbase((&data[0])->mpz,2)); 395 | //printf("memory size=%ld\n",mpz_sizeinbase((&data[0])->mpz,2)*ROWS*WORD_SIZE/8192); 396 | 397 | accessw(adr,data,pk,sk); 398 | for(int i=0;i<10;i++) 399 | { 400 | printf("RUN%d ",i); 401 | 402 | //timer+=accessw(adr,data,pk,sk); 403 | timer+=accessr(adr,data,pk,sk); 404 | printf("AC:");trans_print(data,WORD_SIZE,sk);printf("\n"); 405 | //printf("\n"); 406 | 407 | } 408 | printf("avg clock=%ld\n",timer/CLOCKS_PER_SEC/RUNS); 409 | 410 | 411 | access_dump(ROWS,WORD_SIZE,sk); 412 | 413 | printf("AC:");trans_print(data,WORD_SIZE,sk);printf("\n"); 414 | 415 | //fhe_int_clear(rw); 416 | vec_clear(data,WORD_SIZE); 417 | vec_clear(adr,ADR_BITS); 418 | access_clear(ROWS,WORD_SIZE); 419 | return 0; 420 | } 421 | 422 | int test_cu(fhe_pk_t pk,fhe_sk_t sk) 423 | { 424 | clock_t clock=0; 425 | 426 | puts("TEST CU");fflush(stdout); 427 | 428 | _mem=0; 429 | 430 | for(int i=0;i<1;i++) 431 | { 432 | clock+=cu(pk,sk); 433 | printf(".");fflush(stdout); 434 | } 435 | printf("avg cu=%ld avg mem=%ld\n",clock/CLOCKS_PER_SEC,_mem/CLOCKS_PER_SEC/3); 436 | 437 | return 0; 438 | } 439 | 440 | int test_search(fhe_pk_t pk,fhe_sk_t sk) 441 | { 442 | clock_t clockt,_clock; 443 | _fhe_int *a,*b,*res; 444 | fhe_int_t one; 445 | int sizes[4]={5,16,32,64}; 446 | 447 | puts("TEST SEARCH");fflush(stdout); 448 | 449 | fhe_int_init(one); 450 | fhe_int_encrypt(one,pk,1); 451 | 452 | for(int x=0;x<4;x++) 453 | { 454 | int i=sizes[x]; 455 | 456 | printf("%d: ",i);fflush(stdout); 457 | a=vec_init(i); 458 | b=vec_init(i); 459 | res=vec_init(i); 460 | clockt=0; 461 | 462 | for(int j=0;jnoise=1; 19 | } 20 | } 21 | 22 | void trans_adr2int(int i,_fhe_int *adr,fhe_pk_t pk) 23 | { 24 | 25 | } 26 | 27 | void trans_int2data(int i,_fhe_int *data,fhe_pk_t pk) 28 | { 29 | for(int a=0,mask=1;anoise=1; 37 | } 38 | } 39 | 40 | void trans_int2vec(int i,_fhe_int *data,int size,fhe_pk_t pk) 41 | { 42 | for(int a=0,mask=1;anoise=1; 50 | } 51 | } 52 | 53 | void trans_data2int(int i,_fhe_int *data,fhe_pk_t pk) 54 | { 55 | 56 | } 57 | 58 | void trans_int2mem(int i,int memaddr,fhe_pk_t pk) 59 | { 60 | trans_int2vec(i,&access_array[WORD_SIZE*memaddr],WORD_SIZE,pk); 61 | } 62 | 63 | void trans_print(_fhe_int *data,int len,fhe_sk_t sk) 64 | { 65 | for(int i=0;impz,sk)); 67 | } 68 | -------------------------------------------------------------------------------- /trans.h: -------------------------------------------------------------------------------- 1 | /* 2 | * trans.h 3 | * 4 | * Created on: 13.03.2012 5 | * Author: michaelbrenner 6 | */ 7 | 8 | #ifndef TRANS_H_ 9 | #define TRANS_H_ 10 | 11 | #include "access.h" 12 | #include "kit.h" 13 | #include "integer-fhe.h" 14 | 15 | void trans_int2adr(int i,_fhe_int *adr,fhe_pk_t pk); 16 | 17 | void trans_adr2int(int i,_fhe_int *adr,fhe_pk_t pk); 18 | 19 | void trans_int2data(int i,_fhe_int *data,fhe_pk_t pk); 20 | 21 | void trans_data2int(int i,_fhe_int *data,fhe_pk_t pk); 22 | 23 | void trans_int2vec(int i,_fhe_int *data,int size,fhe_pk_t pk); 24 | 25 | void trans_print(_fhe_int *data,int len,fhe_sk_t sk); 26 | 27 | void trans_int2mem(int i,int memaddr,fhe_pk_t pk); 28 | 29 | #endif /* TRANS_H_ */ 30 | --------------------------------------------------------------------------------