aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/zero_mem.cpp
blob: e812ced0c357a8f17db80abadd1dd49a2abec9e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
* Zero Memory
* (C) 2012 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/

#include <botan/mem_ops.h>

namespace Botan {

void zero_mem(void* ptr, size_t n)
   {
   volatile byte* p = reinterpret_cast<volatile byte*>(ptr);

   for(size_t i = 0; i != n; ++i)
      p[i] = 0;
   }

}