puf_sram.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 HAW Hamburg
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
21 #ifndef PUF_SRAM_H
22 #define PUF_SRAM_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #include "hashes.h"
29 #include "thread.h"
30 
34 #ifndef SEED_RAM_LEN
35 #define SEED_RAM_LEN (2048 / sizeof(uint32_t))
36 #endif
37 
43 #define PUF_SRAM_MARKER (0xad3021ff)
44 
48 extern uint32_t puf_sram_seed;
49 
57 extern uint32_t puf_sram_state;
58 
67 void puf_sram_init(const uint8_t *ram, size_t len);
68 
76 void puf_sram_generate(const uint8_t *ram, size_t len);
77 
85 bool puf_sram_softreset(void);
86 
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* PUF_SRAM_H */
bool puf_sram_softreset(void)
checks for a memory marker to determine whether memory contains old data.
uint32_t puf_sram_state
Global seed state, allocated in puf_sram.c 0 means seed was generated from SRAM pattern, 1 means missing power cycle detected, 2 means power cycle detected.
Threading API.
uint32_t puf_sram_seed
Global seed variable, allocated in puf_sram.c.
void puf_sram_init(const uint8_t *ram, size_t len)
checks source of reboot by puf_sram_softreset and conditionally calls puf_sram_generate ...
Hash function API.
void puf_sram_generate(const uint8_t *ram, size_t len)
builds hash from SEED_RAM_LEN bytes uninitialized SRAM, writes it to the global variable puf_sram_see...