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...
|
#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 |
|
|
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...
|
|
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.
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] | aTarget | The target buffer to compare. |
[in] | aSource | The Source buffer to compare to. |
[in] | aSize | Number 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] | aDestination | The destination buffer to copy bytes to. |
[in] | aSource | The Source buffer to copy from. |
[in] | aSize | Number of bytes to copy. |
void SaSi_PalMemFree |
( |
void * |
aBuffer | ) |
|
This function purpose is to free allocated buffer.
- Returns
- void.
- Parameters
-
[in] | aBuffer | Pointer 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] | aSize | Number 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] | aDestination | The destination buffer to copy bytes to. |
[in] | aSource | The Source buffer to copy from. |
[in] | aSize | Number 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] | aBuffer | Pointer to allocated buffer. |
[in] | aNewSize | Number 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] | aTarget | The target buffer to set. |
[in] | aChar | The char to set into aTarget. |
[in] | aSize | Number 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] | aTarget | The target buffer to set. |
[in] | aSize | Number 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] | aTarget | The target buffer to compare. |
[in] | aSource | The Source buffer to compare to. |
[in] | aSize | Number of bytes to compare. |