Class IndexGenerator.BitString
java.lang.Object
org.bouncycastle.pqc.legacy.crypto.ntru.IndexGenerator.BitString
- Enclosing class:
IndexGenerator
Represents a string of bits and supports appending, reading the head, and reading the tail.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendBits
(byte b) Appends all bits in a byte to the end of the bit string.byte[]
getBytes()
int
getLeadingAsInt
(int numBits) Returns up to 32 bits from the beginning of the bit string.getTrailing
(int numBits) Returns the lastnumBits
bits from the end of the bit string.
-
Constructor Details
-
BitString
public BitString()
-
-
Method Details
-
appendBits
public void appendBits(byte b) Appends all bits in a byte to the end of the bit string.- Parameters:
b
- a byte
-
getTrailing
Returns the lastnumBits
bits from the end of the bit string.- Parameters:
numBits
- number of bits- Returns:
- a new
BitString
of lengthnumBits
-
getLeadingAsInt
public int getLeadingAsInt(int numBits) Returns up to 32 bits from the beginning of the bit string.- Parameters:
numBits
- number of bits- Returns:
- an
int
whose lowernumBits
bits are the beginning of the bit string
-
getBytes
public byte[] getBytes()
-