@Override public byte[] asBytes() { return Util.MPIbytes(x); }
@Override public byte[] asBytes() { byte[] pb = Util.MPIbytes(p); byte[] qb = Util.MPIbytes(q); byte[] gb = Util.MPIbytes(g); byte[] tb = new byte[pb.length + qb.length + gb.length]; System.arraycopy(pb, 0, tb, 0, pb.length); System.arraycopy(qb, 0, tb, pb.length, qb.length); System.arraycopy(gb, 0, tb, pb.length + qb.length, gb.length); return tb; }
public static void writeMPI(BigInteger num, OutputStream out) throws IOException { out.write(MPIbytes(num)); }
protected byte[] fingerprint(BigInteger[] quantities) { synchronized (shactx) { for (BigInteger quantity: quantities) { byte[] mpi = Util.MPIbytes(quantity); shactx.update(mpi, 0, mpi.length); } return shactx.digest(); } }
@Override public byte[] asBytes() { byte[] groupBytes = getGroup().asBytes(); byte[] ybytes = Util.MPIbytes(y); byte[] bytes = new byte[groupBytes.length + ybytes.length]; System.arraycopy(groupBytes, 0, bytes, 0, groupBytes.length); System.arraycopy(ybytes, 0, bytes, groupBytes.length, ybytes.length); return bytes; }