CycloneBOOT 2.6.6
Secure Bootloader for ARM Cortex-M MCU
Loading...
Searching...
No Matches
main.h
Go to the documentation of this file.
1
29#ifndef __MAIN_H
30#define __MAIN_H
31
32#include "core/crypto.h"
33
34#if defined(VARIANT_OPEN) || defined(VARIANT_EVAL) || defined(VARIANT_ULTIMATE)
35#include "rng/hmac_drbg.h"
36#endif
37
38#define SEED_LENGTH 48 // length of Crypto seed
39#define CHECK_DATA_LENGTH 512 // length of check data field, as IMAGE_MAX_CHECK_DATA_SIZE in the bootloader
40#define INIT_VECTOR_LENGTH 16 // length of initialization vector for AES-CBC
41
42
47typedef struct {
48 const char *iv;
49 size_t ivSize;
50 uint8_t *cipherKey;
51 size_t cipherKeySize;
52 PrngAlgo *prngAlgo;
53
54 #if defined(VARIANT_OPEN) || defined(VARIANT_EVAL) || defined(VARIANT_ULTIMATE)
55 HmacDrbgContext *hmacDrbgContext;
56#endif
57
58 char seed[SEED_LENGTH];
63typedef struct {
64 int signature;
65 int authentication;
66 int integrity;
67 const char *auth_algo;
68 const char *integrity_algo;
69 const char *authKey;
70 size_t authKeySize;
71 const char *sign_algo;
72 const char *signKey;
73 size_t signKeySize;
74 const HashAlgo *signHashAlgo;
76
80typedef struct
81{
83 size_t inputBinarySize;
85 size_t signedBinarySize;
87 size_t paddedBinarySize;
89 size_t blockifiedBinarySize;
91 size_t cipherBinarySize;
93
94#endif // __MAIN_H
Definition main.h:63
Definition main.h:47
Buffers the image passes through while it is built.
Definition main.h:81
char * inputBinary
The firmware binary as read from disk.
Definition main.h:82
char * paddedBinary
Padding followed by the binary, as the body carries it.
Definition main.h:86
char * signedBinary
Input binary with the runtime signature or digest appended.
Definition main.h:84
char * cipherBinary
Encrypted body.
Definition main.h:90
char * blockifiedBinary
Padded binary rounded up to the cipher block size.
Definition main.h:88