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 
54 #ifndef PUF_SRAM_H
55 #define PUF_SRAM_H
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 #include <stdbool.h>
62 #include <stddef.h>
63 #include <stdint.h>
64 
68 #ifndef SEED_RAM_LEN
69 #define SEED_RAM_LEN (2048 / sizeof(uint32_t))
70 #endif
71 
77 #define PUF_SRAM_MARKER (0xad3021ff)
78 
82 extern uint32_t puf_sram_seed;
83 
91 extern uint32_t puf_sram_state;
92 
98 extern uint32_t puf_sram_softreset_cnt;
99 
108 void puf_sram_init(const uint8_t *ram, size_t len);
109 
117 void puf_sram_generate(const uint8_t *ram, size_t len);
118 
127 
128 #ifdef __cplusplus
129 }
130 #endif
132 #endif /* PUF_SRAM_H */
uint32_t puf_sram_state
Global seed state, allocated in puf_sram.c 0 means seed was generated from SRAM pattern,...
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
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...
bool puf_sram_softreset(void)
checks for a memory marker to determine whether memory contains old data.
uint32_t puf_sram_softreset_cnt
Counter variable allocated in puf_sram.c.
uint32_t puf_sram_seed
Global seed variable, allocated in puf_sram.c.