nRF5 SDK v13.0.0
Macros | Functions
ssi_pal_mem

This file contains functions for memory operations. The functions implementations are generally just wrappers to different operating system calls. None of the described functions will check the input parameters so the behavior of the APIs in illegal parameters case is dependent on the operating system behavior. More...

Macros

#define SaSi_PalMemCmp   _SaSi_PalMemCmp
 
#define SaSi_PalMemCopy   _SaSi_PalMemCopy
 
#define SaSi_PalMemMove   _SaSi_PalMemMove
 
#define SaSi_PalMemSet(aTarget, aChar, aSize)   _SaSi_PalMemSet(aTarget, aChar, aSize)
 
#define SaSi_PalMemSetZero(aTarget, aSize)   _SaSi_PalMemSetZero(aTarget, aSize)
 
#define SaSi_PalMemMalloc   _SaSi_PalMemMalloc
 
#define SaSi_PalMemRealloc   _SaSi_PalMemRealloc
 
#define SaSi_PalMemFree   _SaSi_PalMemFree
 

Functions

int32_t SaSi_PalMemCmp (const void *aTarget, const void *aSource, uint32_t aSize)
 This function purpose is to compare between two given buffers according to given size. More...
 
SaSiStatus SaSi_PalSecMemCmp (const uint8_t *aTarget, const uint8_t *aSource, uint32_t aSize)
 This function purpose is to perform secured memory comparison between two given buffers according to given size. The function will compare each byte till aSize number of bytes was compared even if the bytes are different. The function should be used to avoid security timing attacks. More...
 
void SaSi_PalMemCopy (const void *aDestination, const void *aSource, uint32_t aSize)
 This function purpose is to copy aSize bytes from source buffer to destination buffer. More...
 
void SaSi_PalMemMove (const void *aDestination, const void *aSource, uint32_t aSize)
 This function purpose is to copy aSize bytes from source buffer to destination buffer. This function Supports overlapped buffers. More...
 
void SaSi_PalMemSet (const void *aTarget, const uint8_t aChar, uint32_t aSize)
 This function purpose is to set aSize bytes in the given buffer with aChar. More...
 
void SaSi_PalMemSetZero (const void *aTarget, uint32_t aSize)
 This function purpose is to set aSize bytes in the given buffer with zeroes. More...
 
void * SaSi_PalMemMalloc (uint32_t aSize)
 This function purpose is to allocate a memory buffer according to aSize. More...
 
void * SaSi_PalMemRealloc (void *aBuffer, uint32_t aNewSize)
 This function purpose is to reallocate a memory buffer according to aNewSize. The content of the old buffer is moved to the new location. More...
 
void SaSi_PalMemFree (void *aBuffer)
 This function purpose is to free allocated buffer. More...
 

Detailed Description

This file contains functions for memory operations. The functions implementations are generally just wrappers to different operating system calls. None of the described functions will check the input parameters so the behavior of the APIs in illegal parameters case is dependent on the operating system behavior.

Function Documentation

int32_t SaSi_PalMemCmp ( const void *  aTarget,
const void *  aSource,
uint32_t  aSize 
)

This function purpose is to compare between two given buffers according to given size.

Returns
The return values is according to operating system return values.
Parameters
[in]aTargetThe target buffer to compare.
[in]aSourceThe Source buffer to compare to.
[in]aSizeNumber of bytes to compare.
void SaSi_PalMemCopy ( const void *  aDestination,
const void *  aSource,
uint32_t  aSize 
)

This function purpose is to copy aSize bytes from source buffer to destination buffer.

Returns
void.
Parameters
[out]aDestinationThe destination buffer to copy bytes to.
[in]aSourceThe Source buffer to copy from.
[in]aSizeNumber of bytes to copy.
void SaSi_PalMemFree ( void *  aBuffer)

This function purpose is to free allocated buffer.

Returns
void.
Parameters
[in]aBufferPointer to allocated buffer.
void* SaSi_PalMemMalloc ( uint32_t  aSize)

This function purpose is to allocate a memory buffer according to aSize.

Returns
The function will return a pointer to allocated buffer or NULL if allocation failed.
Parameters
[in]aSizeNumber of bytes to allocate.
void SaSi_PalMemMove ( const void *  aDestination,
const void *  aSource,
uint32_t  aSize 
)

This function purpose is to copy aSize bytes from source buffer to destination buffer. This function Supports overlapped buffers.

Returns
void.
Parameters
[out]aDestinationThe destination buffer to copy bytes to.
[in]aSourceThe Source buffer to copy from.
[in]aSizeNumber of bytes to copy.
void* SaSi_PalMemRealloc ( void *  aBuffer,
uint32_t  aNewSize 
)

This function purpose is to reallocate a memory buffer according to aNewSize. The content of the old buffer is moved to the new location.

Returns
The function will return a pointer to the newly allocated buffer or NULL if allocation failed.
Parameters
[in]aBufferPointer to allocated buffer.
[in]aNewSizeNumber of bytes to reallocate.
void SaSi_PalMemSet ( const void *  aTarget,
const uint8_t  aChar,
uint32_t  aSize 
)

This function purpose is to set aSize bytes in the given buffer with aChar.

Returns
void.
Parameters
[out]aTargetThe target buffer to set.
[in]aCharThe char to set into aTarget.
[in]aSizeNumber of bytes to set.
void SaSi_PalMemSetZero ( const void *  aTarget,
uint32_t  aSize 
)

This function purpose is to set aSize bytes in the given buffer with zeroes.

Returns
void.
Parameters
[out]aTargetThe target buffer to set.
[in]aSizeNumber of bytes to set.
SaSiStatus SaSi_PalSecMemCmp ( const uint8_t *  aTarget,
const uint8_t *  aSource,
uint32_t  aSize 
)

This function purpose is to perform secured memory comparison between two given buffers according to given size. The function will compare each byte till aSize number of bytes was compared even if the bytes are different. The function should be used to avoid security timing attacks.

Returns
SASI_SUCCESS in case of success,
value on failure as defined in ssi_pal_error.h.
Parameters
[in]aTargetThe target buffer to compare.
[in]aSourceThe Source buffer to compare to.
[in]aSizeNumber of bytes to compare.

Documentation feedback | Developer Zone | Subscribe | Updated