|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.deas.hyperenc.HyperStorage
public abstract class HyperStorage
Stores unreconciled pages and corresponding hash values, reconciled pages, system blocks, and encryption blocks for a single contact.
TODO describe the contained (abstract) data structures more carefully
Thread safety: Implementations of this class must be unconditionally thread-safe; concurrent access by multiple threads should be safe without the need for external synchronization.
Constructor Summary | |
---|---|
HyperStorage()
|
Method Summary | |
---|---|
abstract int |
addEncBlock(byte[] block)
Adds an encryption block. |
abstract void |
addRPage(byte[] page)
Store a page that has been reconciled. |
abstract int |
addSysBlock(byte[][] block)
Adds a system block. |
abstract void |
addUPage(int id,
byte[] page,
byte[] hash)
Adds a page of randomness that has yet to be reconciled, along with its hash. |
abstract Contact |
getContact()
Get the communication partner for this HyperStorage |
abstract MessageDigest |
getDigest()
Gets the stored MessageDigest object for this HyperStorage. |
abstract Direction |
getDirection()
The direction of communication for this HyperStorage. |
abstract byte[] |
getEncBlock(int id)
Retrieve the encryption block with the given ID. |
abstract List<Integer> |
getEncBlockList()
Gets a List of IDs of available encryption blocks. |
abstract PageShuffler |
getShuffler()
|
abstract RandomSource |
getSource()
Gets the stored RandomSource object for this HyperStorage. |
abstract byte[][] |
getSysBlock(int id)
Retrieve the system block with the given ID. |
abstract List<Integer> |
getSysBlockList()
Gets a List of IDs of available system blocks. |
abstract byte[] |
getUHash(int id)
Retrieve hash of the unreconciled page with the given ID. |
abstract byte[] |
getUPage(int id)
Retrieve the unreconciled page with the given ID. |
abstract List<Integer> |
getUPageList()
Gets a List of IDs of available unreconciled pages. |
abstract int |
numEncBlocks()
|
abstract int |
numRPages()
|
abstract int |
numSysBlocks()
|
abstract int |
numUPages()
|
abstract byte[] |
remEncBlock(int id)
Removes and returns encryption block with the given ID. |
abstract List<byte[]> |
remEncBlockList(List<Integer> idlist)
Removes and returns all the encryption blocks with the given IDs. |
abstract byte[] |
remRPage()
Removes and returns the first reconciled page from the FIFO queue. |
abstract byte[][] |
remSysBlock(int id)
Removes and returns system block with the given ID. |
abstract byte[] |
remUPage(int id)
Removes and returns unreconciled page with the given ID, and remove the corresponding hash. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HyperStorage()
Method Detail |
---|
public abstract int addSysBlock(byte[][] block)
HyperCollector.NUM_SYSBLOCKS
subblocks.
block
- Data for block.
public abstract int addEncBlock(byte[] block)
block
- Data for block.
public abstract void addUPage(int id, byte[] page, byte[] hash)
id
- ID number for the Page. This is the same as the ID for the block
from which it was generated.page
- The unreconciled page.hash
- The hash of page
.public abstract void addRPage(byte[] page)
page
- The reconciled page.public abstract List<Integer> getSysBlockList()
public abstract List<Integer> getEncBlockList()
public abstract List<Integer> getUPageList()
public abstract byte[][] getSysBlock(int id)
id
- ID number of desired system block.
public abstract byte[] getEncBlock(int id)
id
- ID number of desired encryption block.
public abstract byte[] getUPage(int id)
id
- ID of desired page.
public abstract byte[] getUHash(int id)
id
- ID of desired page.
public abstract byte[][] remSysBlock(int id)
id
- ID of block.
public abstract byte[] remEncBlock(int id)
id
- ID of block.
public abstract List<byte[]> remEncBlockList(List<Integer> idlist) throws BlockMissingException
idlist
- a list of integer encryption block IDs
BlockMissingException
- if any of the specified IDs are missing. The IDs of the missing
blocks can be accessed from the getMissingIDList
method of BlockMissingException.public abstract byte[] remUPage(int id)
id
- ID of page.
public abstract byte[] remRPage()
null
if there are none)public abstract int numSysBlocks()
public abstract int numEncBlocks()
public abstract int numUPages()
public abstract int numRPages()
public abstract Contact getContact()
public abstract Direction getDirection()
getContact()
). If SLAVE,
this storage is used for incoming communication: receiving messages from
the partner.
public abstract RandomSource getSource()
public abstract MessageDigest getDigest()
public abstract PageShuffler getShuffler()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |