Skip to content

Commit

Permalink
[crypto] Post-merge review: add sensitive data buffer doc (project-ch…
Browse files Browse the repository at this point in the history
…ip#24585)

Add documentation to SensitiveData[Fixed]Buffer clases.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
  • Loading branch information
Damian-Nordic authored and David Lechner committed Mar 22, 2023
1 parent 845c45b commit 0329ccd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/crypto/CHIPCryptoPAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ class ECPKey
const Sig & signature) const = 0;
};

/**
* @brief Helper class for holding sensitive data that should be erased from memory after use.
*
* The sensitive data buffer is a variable-length, fixed-capacity buffer class that securely erases
* the contents of a buffer when the buffer is destroyed.
*/
template <size_t kCapacity>
class SensitiveDataBuffer
{
Expand Down Expand Up @@ -291,6 +297,12 @@ class SensitiveDataBuffer
size_t mLength = 0;
};

/**
* @brief Helper class for holding fixed-sized sensitive data that should be erased from memory after use.
*
* The sensitive data buffer is a fixed-length, fixed-capacity buffer class that securely erases
* the contents of a buffer when the buffer is destroyed.
*/
template <size_t kCapacity>
class SensitiveDataFixedBuffer
{
Expand Down

0 comments on commit 0329ccd

Please sign in to comment.