Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
apdu_chunks.h
Go to the documentation of this file.
1/*****************************************************************************
2 * (c) 2026 Ledger SAS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
26
27#pragma once
28
29/* Includes ------------------------------------------------------------------*/
30#include <stddef.h>
31#include <stdint.h>
32
33/* Exported enumerations -----------------------------------------------------*/
39
45
46/* Exported defines --------------------------------------------------------*/
48#define APDU_CHUNKS_P2_FIRST 0x00
50#define APDU_CHUNKS_P2_NEXT 0x80
51
52/* Exported functions prototypes--------------------------------------------- */
53
66 const uint8_t *data,
67 size_t len,
68 uint8_t p2,
69 uint8_t **out_buf,
70 size_t *out_len);
apdu_chunks_owner_t
Definition apdu_chunks.h:41
@ APDU_CHUNKS_OWNER_TRANSACTION_CHECK
Definition apdu_chunks.h:43
@ APDU_CHUNKS_OWNER_ADDRESS_BOOK
Definition apdu_chunks.h:42
apdu_chunks_status_t
Definition apdu_chunks.h:34
@ APDU_CHUNKS_ERROR
Protocol error; the payload in progress is dropped.
Definition apdu_chunks.h:37
@ APDU_CHUNKS_PENDING
More chunks needed.
Definition apdu_chunks.h:35
@ APDU_CHUNKS_COMPLETE
Full payload assembled; out_buf/out_len are valid.
Definition apdu_chunks.h:36
apdu_chunks_status_t apdu_chunks_reassemble(apdu_chunks_owner_t owner, const uint8_t *data, size_t len, uint8_t p2, uint8_t **out_buf, size_t *out_len)
Reassemble a multi-chunk APDU payload.