Esempio n. 1
0
 private Vote encrypt(byte[] msg, int i) {
   GroupMember key = new GroupMember(group.groupPow(g.member, intToByteArray(i)));
   GroupMember message =
       new GroupMember(group.groupMult(msg, group.groupPow(h.member, intToByteArray(i))));
   Vote vote = new Vote(key, message);
   return vote;
 }
Esempio n. 2
0
 private GroupMember compute(GroupMember xi, GroupMember x, GroupMember g, int di, int ri) {
   return new GroupMember(
       group.groupMult(
           group.groupPow(
               group.groupMult(xi.member, group.completing(x.member)), intToByteArray(di)),
           group.groupPow(g.member, intToByteArray(ri))));
 }
Esempio n. 3
0
 public mixnetUtils() {
   super();
   this.rando = new Random();
   this.group = new MyGroup();
   this.history = new History();
   this.groupSize = ByteArrayToInt(group.getOrder());
   System.out.println(groupSize + "\n");
   this.g = new GroupMember(group.getGenerator());
   this.h = new GroupMember(group.groupPow(g.member, intToByteArray(42)));
 }