3 This file is part of the ARM-Crypto-Lib.
4 Copyright (C) 2009 Daniel Otte (daniel.otte@rub.de)
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 * \email daniel.otte@rub.de
23 * \license GPLv3 or later
32 #define UBI_TYPE_KEY 0
33 #define UBI_TYPE_CFG 4
34 #define UBI_TYPE_PRS 8
35 #define UBI_TYPE_PK 12
36 #define UBI_TYPE_KDF 16
37 #define UBI_TYPE_NON 20
38 #define UBI_TYPE_MSG 48
39 #define UBI_TYPE_OUT 63
41 #define UBI256_BLOCKSIZE 256
42 #define UBI256_BLOCKSIZE_B ((UBI256_BLOCKSIZE+7)/8)
44 #define UBI512_BLOCKSIZE 512
45 #define UBI512_BLOCKSIZE_B ((UBI512_BLOCKSIZE+7)/8)
47 #define UBI1024_BLOCKSIZE 1024
48 #define UBI1024_BLOCKSIZE_B ((UBI1024_BLOCKSIZE+7)/8)
81 void ubi256_init(ubi256_ctx_t* ctx, const void* g, uint8_t type);
82 void ubi256_nextBlock(ubi256_ctx_t* ctx, const void* block);
83 void ubi256_lastBlock(ubi256_ctx_t* ctx, const void* block, uint16_t length_b);
84 void ubi256_ctx2hash(void* dest, const ubi256_ctx_t* ctx);
86 void ubi512_init(ubi512_ctx_t* ctx, const void* g, uint8_t type);
87 void ubi512_nextBlock(ubi512_ctx_t* ctx, const void* block);
88 void ubi512_lastBlock(ubi512_ctx_t* ctx, const void* block, uint16_t length_b);
89 void ubi512_ctx2hash(void* dest, const ubi512_ctx_t* ctx);
91 void ubi1024_init(ubi1024_ctx_t* ctx, const void* g, uint8_t type);
92 void ubi1024_nextBlock(ubi1024_ctx_t* ctx, const void* block);
93 void ubi1024_lastBlock(ubi1024_ctx_t* ctx, const void* block, uint16_t length_b);
94 void ubi1024_ctx2hash(void* dest, const ubi1024_ctx_t* ctx);
101 uint8_t tree_leaf_size;
102 uint8_t tree_fan_out;
103 uint8_t tree_max_height;
104 uint8_t reserved2[13];