crypto_mem.h File Reference

Secure memory operations. More...

#include "core/crypto.h"

Go to the source code of this file.

Functions

void cryptoZeroizeMem (void *p, size_t n)
 Securely erase a memory block. More...
 
uint_t cryptoCompMem (const void *p1, const void *p2, size_t n)
 Constant-time comparison of two memory blocks. More...
 

Detailed Description

Secure memory operations.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2026 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneCRYPTO Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.6.8

Definition in file crypto_mem.h.

Function Documentation

◆ cryptoCompMem()

uint_t cryptoCompMem ( const void *  p1,
const void *  p2,
size_t  n 
)

Constant-time comparison of two memory blocks.

Parameters
[in]p1Pointer to the first memory block
[in]p2Pointer to the second memory block
[in]nLength of the memory blocks, in bytes
Returns
0 if the two blocks are identical, a non-zero value otherwise

Definition at line 60 of file crypto_mem.c.

◆ cryptoZeroizeMem()

void cryptoZeroizeMem ( void *  p,
size_t  n 
)

Securely erase a memory block.

Parameters
[out]pPointer to the memory block to be erased
[in]nNumber of bytes to erase

Definition at line 45 of file crypto_mem.c.