53 LbResult begin(uint8_t* buffer, uint16_t capacity, uint32_t totalLength);
65 bool complete()
const {
return active_ && received_ == expected_; }
67 bool active()
const {
return active_; }
71 const uint8_t*
data()
const {
return buffer_; }
73 uint16_t
length()
const {
return expected_; }
76 uint8_t* buffer_ =
nullptr;
77 uint16_t capacity_ = 0;
78 uint16_t expected_ = 0;
79 uint16_t received_ = 0;
Accumulates an offset-chunked authenticatorLargeBlobs write into a caller-owned buffer.
LbResult begin(uint8_t *buffer, uint16_t capacity, uint32_t totalLength)
Begins a write declaring the full serialized length.
bool complete() const
True once the declared length has been fully received.
LbResult append(uint32_t offset, const uint8_t *data, uint16_t len)
Appends one fragment at offset.
bool active() const
True while a write is in progress.
void reset()
Discards any partial write and returns to the idle state.
const uint8_t * data() const
Pointer to the accumulated buffer (valid after begin).
uint16_t length() const
Declared total length of the current write.
uint16_t nextOffset() const
Offset the next fragment must start at.
constexpr uint16_t kLargeBlobEmptyLen
LbResult
Outcome of a write-session step, mapped to a CTAP status by the caller.
@ StorageFull
declared total length exceeds the buffer / kLargeBlobMaxArray
@ BadSeq
fragment offset out of order, or no active session
@ BadLength
declared total too small, or a fragment overruns the total
constexpr uint16_t kLargeBlobMaxArray
Largest serialized large-blob array, advertised as maxSerializedLargeBlobArray.
const uint8_t kLargeBlobEmpty[kLargeBlobEmptyLen]
Canonical empty large-blob array bytes.