T_memcmp

T_memcmp

int T_memcmp (

 

 

POINTER

firstBlock,

/* first block */

POINTER

secondBlock,

/* second block */

unsigned int

len

/* length of blocks */

);

 

 

 

 

 

Description

T_memcmp compares the first len bytes of firstBlock and secondBlock. The value of len can be zero, in which case firstBlock and secondBlock are undefined and T_memcmp returns zero. T_memcmp compares the blocks by scanning the blocks from lowest address to highest until a difference is found. The smaller-valued block is the one with the smaller-valued byte at the point of difference. If no difference is found, then the blocks are equal.

Return value

Value

Description

< 0

firstBlock is smaller.

0

The blocks are equal.

> 0

firstBlock is larger.

 

 

3 4 2

R S A B S A F E C r y p t o - C L i b r a r y R e f e r e n c e M a n u a l

Page 352
Image 352
RSA Security 5 manual Tmemcmp, Blocks are equal