Loading...
Searching...
No Matches
puf_sram.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 HAW Hamburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58#include <stdbool.h>
59#include <stddef.h>
60#include <stdint.h>
61
65#ifndef SEED_RAM_LEN
66#define SEED_RAM_LEN (2048 / sizeof(uint32_t))
67#endif
68
74#define PUF_SRAM_MARKER (0xad3021ff)
75
79extern uint32_t puf_sram_seed;
80
88extern uint32_t puf_sram_state;
89
95extern uint32_t puf_sram_softreset_cnt;
96
105void puf_sram_init(const uint8_t *ram, size_t len);
106
114void puf_sram_generate(const uint8_t *ram, size_t len);
115
124
125#ifdef __cplusplus
126}
127#endif
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.