mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-16 06:42:37 -03:00
f53a70ce95
So far, the documentation of memory_cleanse() is a verbatim copy of the commit message in BoringSSL, where this code was originally written. However, our code evolved since then, and the commit message is not particularly helpful in the code but is rather of historical interested in BoringSSL only. This commit improves improves the comments around memory_cleanse() and gives a better rationale for the method that we use. This commit touches only comments.
15 lines
560 B
C
15 lines
560 B
C
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
|
// Copyright (c) 2009-2018 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_SUPPORT_CLEANSE_H
|
|
#define BITCOIN_SUPPORT_CLEANSE_H
|
|
|
|
#include <stdlib.h>
|
|
|
|
/** Secure overwrite a buffer (possibly containing secret data) with zero-bytes. The write
|
|
* operation will not be optimized out by the compiler. */
|
|
void memory_cleanse(void *ptr, size_t len);
|
|
|
|
#endif // BITCOIN_SUPPORT_CLEANSE_H
|