public class IndexGenerator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
IndexGenerator.BitString
Represents a string of bits and supports appending, reading the head, and reading the tail.
|
Modifier and Type | Field and Description |
---|---|
private IndexGenerator.BitString |
buf |
private int |
c |
private int |
counter |
private Digest |
hashAlg |
private int |
hLen |
private boolean |
initialized |
private int |
minCallsR |
private int |
N |
private int |
remLen |
private byte[] |
seed |
private int |
totLen |
Constructor and Description |
---|
IndexGenerator(byte[] seed,
NTRUEncryptionParameters params)
Constructs a new index generator.
|
Modifier and Type | Method and Description |
---|---|
private void |
appendHash(IndexGenerator.BitString m,
byte[] hash) |
private static byte[] |
copyOf(byte[] src,
int len) |
(package private) int |
nextIndex()
Returns a number
i such that 0 <= i < N . |
private void |
putInt(Digest hashAlg,
int counter) |
private byte[] seed
private int N
private int c
private int minCallsR
private int totLen
private int remLen
private IndexGenerator.BitString buf
private int counter
private boolean initialized
private Digest hashAlg
private int hLen
IndexGenerator(byte[] seed, NTRUEncryptionParameters params)
seed
- a seed of arbitrary length to initialize the index generator withparams
- NtruEncrypt parametersint nextIndex()
i
such that 0 <= i < N
.private void appendHash(IndexGenerator.BitString m, byte[] hash)
private void putInt(Digest hashAlg, int counter)
private static byte[] copyOf(byte[] src, int len)