Bit string.
More...
#include <der.h>
|
uint32_t | width () const |
| Bit width.
|
|
uint32_t | pad_bits () const |
| Number of padding bits (0 bits at the end of the last byte).
|
|
void | width (uint32_t v) |
| Set width in bits. More...
|
|
void | set (const std::vector< uint8_t > &v, size_t w) |
| Set the bit string from a bit string input. More...
|
|
void | set (const std::vector< char > &v, size_t w) |
|
bool | is_bit_set (uint32_t bit) const |
| Is the bit set? First bit is bit 0.
|
|
void | set_bit (uint32_t bit, bool set=true) |
| Set a bit. More...
|
|
void | clear_bit (uint32_t bit) |
| Clear a bit.
|
|
void | get (std::vector< uint8_t > &v) const |
| Resize and get the vector. More...
|
|
void | get (std::vector< char > &v) const |
|
Bit string.
A bit string is a sequence of bits, with a bit width.
- Examples
- scclib/crypto/unittest/der.cc.
Definition at line 81 of file der.h.
◆ get()
void scc::crypto::BitString::get |
( |
std::vector< uint8_t > & |
v | ) |
const |
|
inline |
Resize and get the vector.
Ensures that all padded bits are 0.
Definition at line 154 of file der.h.
◆ set()
void scc::crypto::BitString::set |
( |
const std::vector< uint8_t > & |
v, |
|
|
size_t |
w |
|
) |
| |
|
inline |
◆ set_bit()
void scc::crypto::BitString::set_bit |
( |
uint32_t |
bit, |
|
|
bool |
set = true |
|
) |
| |
|
inline |
Set a bit.
First bit is bit 0.
Definition at line 137 of file der.h.
◆ width()
void scc::crypto::BitString::width |
( |
uint32_t |
v | ) |
|
|
inline |
Set width in bits.
Resizes the storage, and pads with 0 bits if necessary.
Definition at line 100 of file der.h.
The documentation for this class was generated from the following file: