]>
Commit | Line | Data |
---|---|---|
0c1f3509 MG |
1 | #include <stddef.h> |
2 | #include <stdint.h> | |
3 | ||
4 | #include "insecure_memzero.h" | |
5 | ||
6 | /* Function which does the zeroing. */ | |
7 | static void | |
8 | insecure_memzero_func(volatile void * buf, size_t len) | |
9 | { | |
10 | volatile uint8_t * _buf = buf; | |
11 | size_t i; | |
12 | ||
13 | for (i = 0; i < len; i++) | |
14 | _buf[i] = 0; | |
15 | } | |
16 | ||
17 | /* Pointer to memory-zeroing function. */ | |
18 | void (* volatile insecure_memzero_ptr)(volatile void *, size_t) = | |
19 | insecure_memzero_func; |