Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99152864
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
Tue, Jan 21, 18:48
Size
872 B
Mime Type
text/x-java
Expires
Thu, Jan 23, 18:48 (2 d)
Engine
blob
Format
Raw Data
Handle
23720689
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