Licensing Information

Open Source Used In Cisco Nexus 9000 Series 7.0(3)I5(1)
3242
if (!ixp_pk_cur)
ixp_kperform_cb(0, NULL, 0, 0);
return (0);
err:
crypto_kdone(krp);
return (0);
}
#ifdef CONFIG_OCF_RANDOMHARVEST
/*
* We run the random number generator output through SHA so that it
* is FIPS compliant.
*/
static volatile int sha_done = 0;
static unsigned char sha_digest[20];
static void
ixp_hash_cb(UINT8 *digest, IxCryptoAccStatus status)
{
dprintk("%s(%p, %d)\n", __FUNCTION__, digest, status);
if (sha_digest != digest)
printk("digest error\n");
if (IX_CRYPTO_ACC_STATUS_SUCCESS == status)
sha_done = 1;
else
sha_done = -status;
}
static int
ixp_read_random(void *arg, u_int32_t *buf, int maxwords)
{
IxCryptoAccStatus status;
int i, n, rc;
dprintk("%s(%p, %d)\n", __FUNCTION__, buf, maxwords);
memset(buf, 0, maxwords * sizeof(*buf));
status = ixCryptoAccPkePseudoRandomNumberGet(maxwords, buf);
if (status != IX_CRYPTO_ACC_STATUS_SUCCESS) {
dprintk("%s: ixCryptoAccPkePseudoRandomNumberGet failed %d\n",
__FUNCTION__, status);
return 0;
}