Licensing Information

Open Source Used In Cisco Nexus 9000 Series 7.0(3)I5(1)
3238
op->pData = buf;
op->dataLen = len;
return 0;
}
/*
* copy out the result, be as forgiving as we can about small output buffers
*/
static int
ixp_copy_obuf(struct crparam *p, IxCryptoAccPkeEauOpResult *op, UINT32 *buf)
{
unsigned char *dst = (unsigned char *) p->crp_p;
unsigned char *src = (unsigned char *) buf;
int len, z, bits = p->crp_nbits;
dprintk("%s()\n", __FUNCTION__);
len = op->dataLen * sizeof(UINT32);
/* skip leading zeroes to be small buffer friendly */
z = 0;
while (z < len && src[z] == '\0')
z++;
src += len;
src--;
len -= z;
while (len > 0 && bits > 0) {
*dst++ = *src--;
len--;
bits -= 8;
}
while (bits > 0) {
*dst++ = '\0';
bits -= 8;
}
if (len > 0) {
dprintk("%s - obuf is %d (z=%d, ob=%d) bytes too small\n",
__FUNCTION__, len, z, p->crp_nbits / 8);
return -1;
}
return 0;