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

fsl_shw_return_t sah_add_in_keyout_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 output pointer

Add descriptor where first link is input, the second is a changing 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 key for output
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 1034 of file sf_util.c.

References sah_Link::flags, FSL_RETURN_OK_S, sah_Append_Desc(), sah_Create_Key_Link(), sah_Create_Link(), sah_Destroy_Link(), SAH_OUTPUT_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;
      }

link2->flags |= SAH_OUTPUT_LINK;    /* mark key for output */
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