mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-06-11 21:08:16 +02:00
Increase buffer size for non-pico.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -21,6 +21,11 @@
|
|||||||
#include "mbedtls/cmac.h"
|
#include "mbedtls/cmac.h"
|
||||||
#include "asn1.h"
|
#include "asn1.h"
|
||||||
#include "apdu.h"
|
#include "apdu.h"
|
||||||
|
#ifdef ENABLE_EMULATION
|
||||||
|
#include "usb/emulation/emulation.h"
|
||||||
|
#else
|
||||||
|
#include "usb/usb.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static uint8_t sm_nonce[8];
|
static uint8_t sm_nonce[8];
|
||||||
static uint8_t sm_kmac[16];
|
static uint8_t sm_kmac[16];
|
||||||
@@ -144,7 +149,7 @@ int sm_wrap() {
|
|||||||
if (sm_indicator == 0) {
|
if (sm_indicator == 0) {
|
||||||
return PICOKEY_OK;
|
return PICOKEY_OK;
|
||||||
}
|
}
|
||||||
uint8_t input[2048];
|
uint8_t input[USB_BUFFER_SIZE];
|
||||||
size_t input_len = 0;
|
size_t input_len = 0;
|
||||||
memset(input, 0, sizeof(input));
|
memset(input, 0, sizeof(input));
|
||||||
mbedtls_mpi ssc;
|
mbedtls_mpi ssc;
|
||||||
@@ -232,7 +237,7 @@ void sm_update_iv() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int sm_verify() {
|
int sm_verify() {
|
||||||
uint8_t input[2048];
|
uint8_t input[USB_BUFFER_SIZE];
|
||||||
memset(input, 0, sizeof(input));
|
memset(input, 0, sizeof(input));
|
||||||
uint16_t input_len = 0;
|
uint16_t input_len = 0;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
|
|||||||
@@ -22,7 +22,11 @@
|
|||||||
|
|
||||||
#if !defined(PICO_PLATFORM)
|
#if !defined(PICO_PLATFORM)
|
||||||
#define XIP_BASE 0
|
#define XIP_BASE 0
|
||||||
#define FLASH_SECTOR_SIZE 4096
|
#ifdef ENABLE_EMULATION
|
||||||
|
#define FLASH_SECTOR_SIZE 0x4000
|
||||||
|
#else
|
||||||
|
#define FLASH_SECTOR_SIZE 0x1000
|
||||||
|
#endif
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
uint32_t FLASH_SIZE_BYTES = (1 * 1024 * 1024);
|
uint32_t FLASH_SIZE_BYTES = (1 * 1024 * 1024);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -58,7 +58,11 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#endif
|
#endif
|
||||||
#define FLASH_SECTOR_SIZE 4096
|
#ifdef ENABLE_EMULATION
|
||||||
|
#define FLASH_SECTOR_SIZE 0x4000
|
||||||
|
#else
|
||||||
|
#define FLASH_SECTOR_SIZE 0x1000
|
||||||
|
#endif
|
||||||
#define XIP_BASE 0
|
#define XIP_BASE 0
|
||||||
int fd_map = 0;
|
int fd_map = 0;
|
||||||
uint8_t *map = NULL;
|
uint8_t *map = NULL;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include "board.h"
|
#include "board.h"
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#define USB_BUFFER_SIZE 2048
|
#define USB_BUFFER_SIZE 4096
|
||||||
extern int emul_init(char *host, uint16_t port);
|
extern int emul_init(char *host, uint16_t port);
|
||||||
extern uint8_t emul_rx[USB_BUFFER_SIZE];
|
extern uint8_t emul_rx[USB_BUFFER_SIZE];
|
||||||
extern uint16_t emul_rx_size, emul_tx_size;
|
extern uint16_t emul_rx_size, emul_tx_size;
|
||||||
|
|||||||
@@ -106,7 +106,9 @@ extern void driver_exec_finished_emul(uint8_t itf, uint16_t size_next);
|
|||||||
extern void driver_exec_finished_cont_emul(uint8_t itf, uint16_t size_next, uint16_t offset);
|
extern void driver_exec_finished_cont_emul(uint8_t itf, uint16_t size_next, uint16_t offset);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef USB_BUFFER_SIZE
|
||||||
#define USB_BUFFER_SIZE 2048
|
#define USB_BUFFER_SIZE 2048
|
||||||
|
#endif
|
||||||
|
|
||||||
PACK(
|
PACK(
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user