Page MenuHomec4science

FragmentPartialEncoded.java
No OneTemporary

File Metadata

Created
Tue, Jan 7, 01:19

FragmentPartialEncoded.java

package crypto.elgamal.fragment;
import java.io.Serializable;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECPoint;
import crypto.elgamal.ECElGamal;
public class FragmentPartialEncoded extends FragmentEncoded implements Serializable {
private static final long serialVersionUID = 8817509685002473232L;
private byte[] encodedT;
private int partNumber;
public FragmentPartialEncoded(byte[] encodedR, byte[] encodedS, byte[] encodedT,
int partNumber) {
super(encodedR, encodedS);
this.encodedT = encodedT;
this.partNumber = 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);
}
public FragmentPartial decodeFragment(ECElGamal ecceg) {
return decodeFragment(ecceg.getCurve());
}
}

Event Timeline