Skip to content

Commit

Permalink
assembler works (shaky)
Browse files Browse the repository at this point in the history
  • Loading branch information
hcrypt-project committed Jan 6, 2014
1 parent 8992234 commit ae9426c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions asm/test.hcrypt_asm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
INITAC 0
START 0
INITPC 0

start L 1
start L start
CLC
ADD 2
end J end
21 changes: 18 additions & 3 deletions assembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,32 @@ mpz_t cipher;
int i,j;
int sourceline=0;

printf("argc=%d\n",argc);
char skout[500],pkout[500];

if(argc!=4)
//printf("argc=%d\n",argc);

if(argc!=3)
{
printf("usage: %s <in> <out> <publickey>\n",argv[0]);
printf("usage: %s <in> <out>\n",argv[0]);
exit(0);
}

sprintf(skout,"%s.hcrypt_sk",argv[2]);
sprintf(pkout,"%s.hcrypt_pk",argv[2]);

fhe_pk_init(pk);
fhe_sk_init(sk);

// fhe_pk_loadkey(pk,argv[3]);
//fhe_pk_print(pk);

puts("keygen");
fhe_keygen(pk,sk);
fhe_pk_store(pk,pkout);
fhe_sk_store(sk,skout);

printf("wrote secret key: %s\n",skout);
printf("wrote public key: %s\n",pkout);

symbols=NULL;
alloc=&symbols;
Expand Down Expand Up @@ -397,6 +409,9 @@ mpz_t cipher;
//printf(".\n");
}

printf("---- reference table start ----\n");
printlist(symbols);
printf("---- reference table end ----\n");
//XXX
fclose(w);
fclose(r);
Expand Down

0 comments on commit ae9426c

Please sign in to comment.