Page MenuHomec4science

FragmentPartialEncoded.java
No OneTemporary

File Metadata

Created
Tue, Dec 31, 00:31

FragmentPartialEncoded.java

package crypto.elgamal.encoded;
import java.io.Serializable;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECPoint;
import crypto.elgamal.FragmentEncrypted;
import crypto.elgamal.FragmentPartial;
public class FragmentPartialEncoded extends FragmentEncoded implements Serializable {
private static final long serialVersionUID = 8817509685002473232L;
private byte[] encodedT;
private int partNumber;
public FragmentPartialEncoded(FragmentPartial partial) {
super(partial);
encodedT = partial.getT().getEncoded();
partNumber = partial.getPartNumber();
}
public byte[] getEncodedT() {
return encodedT;
}
public int getPartNumber() {
return partNumber;
}
public FragmentPartial decodeFragment(ECCurve curve) {
FragmentEncrypted encrypted = super.decodeFragment(curve);
ECPoint T = curve.decodePoint(encodedT);
return new FragmentPartial(partNumber, encrypted, T);
}
}

Event Timeline