Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97869014
FragmentEncoded.java
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 6, 23:44
Size
872 B
Mime Type
text/x-java
Expires
Wed, Jan 8, 23:44 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23423994
Attached To
R3229 Genome Privacy - SHCS App
FragmentEncoded.java
View Options
package
crypto.elgamal
;
import
org.bouncycastle.math.ec.ECCurve
;
import
org.bouncycastle.math.ec.ECPoint
;
public
class
FragmentEncoded
{
private
byte
[]
first
;
private
byte
[]
second
;
public
FragmentEncoded
(
ECPoint
first
,
ECPoint
second
)
{
this
.
first
=
first
.
getEncoded
();
this
.
second
=
second
.
getEncoded
();
}
public
FragmentEncoded
(
FragmentEncrypted
frag
)
{
this
(
frag
.
getR
(),
frag
.
getS
());
}
public
byte
[]
getFirst
()
{
return
first
;
}
public
byte
[]
getSecond
()
{
return
second
;
}
public
FragmentEncrypted
decodeFragment
(
ECCurve
curve
)
{
ECPoint
pFirst
=
curve
.
decodePoint
(
first
);
ECPoint
pSecond
=
curve
.
decodePoint
(
second
);
return
new
FragmentEncrypted
(
pFirst
,
pSecond
);
}
/**
* Size in byte of the data contained
* @return
*/
public
int
sizeByte
()
{
return
first
.
length
+
second
.
length
;
}
// TODO: add
// TODO: scale
}
Event Timeline
Log In to Comment