Package org.bouncycastle.pqc.crypto.ntru
Class IndexGenerator.BitString
- java.lang.Object
 - 
- org.bouncycastle.pqc.crypto.ntru.IndexGenerator.BitString
 
 
- 
- Enclosing class:
 - IndexGenerator
 
public static class IndexGenerator.BitString extends java.lang.ObjectRepresents a string of bits and supports appending, reading the head, and reading the tail. 
- 
- 
Constructor Summary
Constructors Constructor Description BitString() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendBits(byte b)Appends all bits in a byte to the end of the bit string.byte[]getBytes()intgetLeadingAsInt(int numBits)Returns up to 32 bits from the beginning of the bit string.IndexGenerator.BitStringgetTrailing(int numBits)Returns the lastnumBitsbits from the end of the bit string. 
 - 
 
- 
- 
Method Detail
- 
appendBits
public void appendBits(byte b)
Appends all bits in a byte to the end of the bit string.- Parameters:
 b- a byte
 
- 
getTrailing
public IndexGenerator.BitString getTrailing(int numBits)
Returns the lastnumBitsbits from the end of the bit string.- Parameters:
 numBits- number of bits- Returns:
 - a new 
BitStringof 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 
intwhose lowernumBitsbits are the beginning of the bit string 
 
- 
getBytes
public byte[] getBytes()
 
 - 
 
 -