Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

fsl_shw_return_t sah_add_in_key_desc ( uint32_t  header,
const uint8_t *  in1,
uint32_t  in1_length,
fsl_shw_sko_t key_info,
const sah_Mem_Util mu,
sah_Head_Desc **  desc_chain 
)

Add a descriptor with an input and key pointer

Add descriptor where both links are inputs, the second one being a key.

Parameters:
header The Sahara header value for the descriptor.
in1 The first input buffer (or NULL)
in1_length Size of in1
[out] in2 The second input buffer (or NULL)
in2_length Size of in2
mu Memory functions
[in,out] desc_chain Chain to start or append to
Returns:
A return code of type fsl_shw_return_t.

Definition at line 933 of file sf_util.c.

References FSL_RETURN_OK_S, sah_Append_Desc(), sah_Create_Key_Link(), sah_Create_Link(), sah_Destroy_Link(), and SAH_USES_LINK_DATA.

{
    fsl_shw_return_t status = FSL_RETURN_OK_S;
    sah_Link         *link1 = NULL;
    sah_Link         *link2 = NULL;

      if (in1 != NULL) {
        status = sah_Create_Link(mu, &link1,
                                 (sah_Oct_Str) in1, in1_length,
                                 SAH_USES_LINK_DATA);
    }

      if (status != FSL_RETURN_OK_S) {
            goto out;
      }

    status = sah_Create_Key_Link(mu, &link2, key_info);


      if (status != FSL_RETURN_OK_S) {
            goto out;
      }

      status = sah_Append_Desc(mu, desc_chain, header, link1, link2);

out:
    if (status != FSL_RETURN_OK_S) {
        if (link1 != NULL) {
            sah_Destroy_Link(mu, link1);
        }
        if (link2 != NULL) {
            sah_Destroy_Link(mu, link2);
        }
    }

    return status;
}


Generated by  Doxygen 1.6.0   Back to index