43.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 43-11. Fill Service Parameters
ParameterTypeDirection.LocationData LengthBefore Executing the ServiceAfter Executing the Service
nu1RBasenu1ICrypto RAMu2RLengthBase of RBase of R value filled repetitively with u4FillValue
u2RLengthu2ICrypto RAMLength of RLength of R
u4FillValueu4IFilling valueFilling 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 43-12. Fill Service Return Codes
Returned StatusImportanceMeaning
PUKCL_OKService functioned correctly.