src/dpdk/drivers/common/dpaax/caamflib/desc/algo.h
static inline int
cnstr_shdsc_zuca(uint32_t *descbuf, bool ps, bool swap,
		 struct alginfo *authdata, uint8_t chk_icv,
		 uint32_t authlen)
{
	struct program prg;
	struct program *p = &prg;
	int dir = chk_icv ? DIR_DEC : DIR_ENC;

	PROGRAM_CNTXT_INIT(p, descbuf, 0);
	if (swap)
		PROGRAM_SET_BSWAP(p);

	if (ps)
		PROGRAM_SET_36BIT_ADDR(p);
	SHR_HDR(p, SHR_ALWAYS, 1, 0);

	KEY(p, KEY2, authdata->key_enc_flags, authdata->key,
	    authdata->keylen, INLINE_KEY(authdata));

	SEQLOAD(p, CONTEXT2, 0, 8, 0);

	if (chk_icv == ICV_CHECK_ENABLE)
		MATHB(p, SEQINSZ, SUB, authlen, VSEQINSZ, 4, IMMED2);
	else
		MATHB(p, SEQINSZ, SUB, ZERO, VSEQINSZ, 4, 0);

	ALG_OPERATION(p, OP_ALG_ALGSEL_ZUCA, OP_ALG_AAI_F9,
		      OP_ALG_AS_INITFINAL, chk_icv, dir);

	SEQFIFOLOAD(p, MSG2, 0, VLF | CLASS2 | LAST2);

	if (chk_icv == ICV_CHECK_ENABLE)
		SEQFIFOLOAD(p, ICV2, authlen, LAST2);
	else
		/* Save lower half of MAC out into a 32-bit sequence */
		SEQSTORE(p, CONTEXT2, 0, authlen, 0);

	return PROGRAM_FINALIZE(p);
}
/**
 * cnstr_shdsc_zuca - ZUC Auth (EIA2) as a shared descriptor
 * @descbuf: pointer to descriptor-under-construction buffer
 * @ps: if 36/40bit addressing is desired, this parameter must be true
 * @swap: must be true when core endianness doesn't match SEC endianness
 * @authdata: pointer to authentication transform definitions
 * @chk_icv: Whether to compare and verify ICV (true/false)
 * @authlen: size of digest
 *
 * The IV prepended before hmac payload must be 8 bytes consisting
 * of COUNT||BEAERER||DIR. The COUNT is of 32-bits, bearer is of 5 bits and
 * direction is of 1 bit - totalling to 38 bits.
 *
 * Return: size of descriptor written in words or negative number on error
 */


The IV prepended before hmac payload must be 8 bytes consisting
of COUNT||BEAERER||DIR. The COUNT is of 32-bits, bearer is of 5 bits and
direction is of 1 bit - totalling to 38 bits.

size of descriptor written in words or negative number on error
The IV prepended before hmac payload must be 8 bytes consisting of COUNT||BEAERER||DIR . The COUNT is of 32 - bits bearer is of 5 bits and direction is of 1 bit - totalling to 38 bits . size of descriptor written in words or negative number on error
static inline int
cnstr_shdsc_zuca(uint32_t *descbuf, bool ps, bool swap,
		 struct alginfo *authdata, uint8_t chk_icv,
		 uint32_t authlen)
{
	struct program prg;
	struct program *p = &prg;
	int dir = chk_icv ? DIR_DEC : DIR_ENC;
	PROGRAM_CNTXT_INIT(p, descbuf, 0);
	if (swap)
		PROGRAM_SET_BSWAP(p);
	if (ps)
		PROGRAM_SET_36BIT_ADDR(p);
	SHR_HDR(p, SHR_ALWAYS, 1, 0);
	KEY(p, KEY2, authdata->key_enc_flags, authdata->key,
	    authdata->keylen, INLINE_KEY(authdata));
	SEQLOAD(p, CONTEXT2, 0, 8, 0);
	if (chk_icv == ICV_CHECK_ENABLE)
		MATHB(p, SEQINSZ, SUB, authlen, VSEQINSZ, 4, IMMED2);
	else
		MATHB(p, SEQINSZ, SUB, ZERO, VSEQINSZ, 4, 0);
	ALG_OPERATION(p, OP_ALG_ALGSEL_ZUCA, OP_ALG_AAI_F9,
		      OP_ALG_AS_INITFINAL, chk_icv, dir);
	SEQFIFOLOAD(p, MSG2, 0, VLF | CLASS2 | LAST2);
	if (chk_icv == ICV_CHECK_ENABLE)
		SEQFIFOLOAD(p, ICV2, authlen, LAST2);
	else
		SEQSTORE(p, CONTEXT2, 0, authlen, 0);
	return PROGRAM_FINALIZE(p);
}
static inline int cnstr_shdsc_zuca ( uint32_t * descbuf , bool ps , bool swap , struct alginfo * authdata , uint8_t chk_icv , uint32_t authlen ) { struct program prg ; struct program * p = & prg ; int dir = chk_icv ? DIR_DEC : DIR_ENC ; PROGRAM_CNTXT_INIT ( p , descbuf , 0 ) ; if ( swap ) PROGRAM_SET_BSWAP ( p ) ; if ( ps ) PROGRAM_SET_36BIT_ADDR ( p ) ; SHR_HDR ( p , SHR_ALWAYS , 1 , 0 ) ; KEY ( p , KEY2 , authdata -> key_enc_flags , authdata -> key , authdata -> keylen , INLINE_KEY ( authdata ) ) ; SEQLOAD ( p , CONTEXT2 , 0 , 8 , 0 ) ; if ( chk_icv == ICV_CHECK_ENABLE ) MATHB ( p , SEQINSZ , SUB , authlen , VSEQINSZ , 4 , IMMED2 ) ; else MATHB ( p , SEQINSZ , SUB , ZERO , VSEQINSZ , 4 , 0 ) ; ALG_OPERATION ( p , OP_ALG_ALGSEL_ZUCA , OP_ALG_AAI_F9 , OP_ALG_AS_INITFINAL , chk_icv , dir ) ; SEQFIFOLOAD ( p , MSG2 , 0 , VLF | CLASS2 | LAST2 ) ; if ( chk_icv == ICV_CHECK_ENABLE ) SEQFIFOLOAD ( p , ICV2 , authlen , LAST2 ) ; else SEQSTORE ( p , CONTEXT2 , 0 , authlen , 0 ) ; return PROGRAM_FINALIZE ( p ) ; }
cnstr_shdsc_zuca - ZUC Auth (EIA2) as a shared descriptor
 @descbuf: pointer to descriptor-under-construction buffer
 @ps: if 36/40bit addressing is desired, this parameter must be true
 @swap: must be true when core endianness doesn't match SEC endianness
 @authdata: pointer to authentication transform definitions
 @chk_icv: Whether to compare and verify ICV (true/false)
 @authlen: size of digest
cnstr_shdsc_zuca - ZUC Auth ( EIA2 ) as a shared descriptor @descbuf : pointer to descriptor - under - construction buffer @ps : if 36 / 40bit addressing is desired this parameter must be true @swap : must be true when core endianness doesn ' t match SEC endianness @authdata : pointer to authentication transform definitions @chk_icv : Whether to compare and verify ICV ( true / false ) @authlen : size of digest
/* Save lower half of MAC out into a 32-bit sequence */