37.3.4.4 Fill

Purpose

This service performs a memory fill operation, with a given 32-bit constant.

How to Use the Service

Description

This service fills a Crypto RAM space with a provided 32-bit constant: Fill (R, FillValue)

The service name for this operation is Fill.

Parameters Definition

This service can easily be accessed through the use of the PUKCL_Fill() macro.

Table 37-11. Fill Service Parameters
Parameter Type Direction. Location Data Length Before Executing the Service After Executing the Service
nu1RBase nu1 I Crypto RAM u2RLength Base of R Base of R value filled repetitively with u4FillValue
u2RLength u2 I Crypto RAM Length of R Length of R
u4FillValue u4 I Filling value Filling value

Code Example

PUKCL_PARAM PUKCLParam;
PPUKCL_PARAM pvPUKCLParam = &PUKCLParam;

// Initialize parameters
PUKCL_Fill(nu1RBase) = <Base of the R number>; 
PUKCL_Fill(u2RLength) = <Length of the R number>; 
PUKCL_Fill(u4FillValue) = <32-bits value to fill with>;

// vPUKCL_Process() is a macro command, which populates the service name
// and then calls the library... 
vPUKCL_Process(Fill,pvPUKCLParam); 
if (PUKCL(u2Status) == PUKCL_OK)
            {
            ...
            }
else // Manage the error

Constraints

The following conditions must be avoided to ensure that the service works correctly:

  • nu1RBase are not aligned on 32-bit boundaries
  • u2RLength is either: <4, >0xffc or not a 32-bit length
  • {nu1RBase, u2RLength} do not entirely lie in Crypto RAM

Status Returned Values

Table 37-12. Fill Service Return Codes
Returned Status Importance Meaning
PUKCL_OK Service functioned correctly.