case bltestSHA256: restart = cipherInfo->params.hash.restart; SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf, SHA256_LENGTH); cipherInfo->cipher.hashCipher = (restart) ? SHA256_restart : SHA256_HashBuf; return SECSuccess; break; case bltestSHA384: restart = cipherInfo->params.hash.restart; SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf, SHA384_LENGTH); cipherInfo->cipher.hashCipher = (restart) ? SHA384_restart : SHA384_HashBuf; return SECSuccess; break; case bltestSHA512: restart = cipherInfo->params.hash.restart; SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf, SHA512_LENGTH); cipherInfo->cipher.hashCipher = (restart) ? SHA512_restart : SHA512_HashBuf; return SECSuccess; break;
cipherInit(bltestCipherInfo *cipherInfo, PRBool encrypt){    PRBool restart;    switch (cipherInfo->mode) {    case bltestDES_ECB:    case bltestDES_CBC:    case bltestDES_EDE_ECB:    case bltestDES_EDE_CBC:	SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,			  cipherInfo->input.pBuf.len);	return bltest_des_init(cipherInfo, encrypt);	break;    case bltestRC2_ECB:    case bltestRC2_CBC:	SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,			  cipherInfo->input.pBuf.len);	return bltest_rc2_init(cipherInfo, encrypt);	break;    case bltestRC4:	SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,			  cipherInfo->input.pBuf.len);	return bltest_rc4_init(cipherInfo, encrypt);	break;    case bltestRC5_ECB:    case bltestRC5_CBC:#if NSS_SOFTOKEN_DOES_RC5	SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,			  cipherInfo->input.pBuf.len);#endif	return bltest_rc5_init(cipherInfo, encrypt);	break;    case bltestAES_ECB:    case bltestAES_CBC:	SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,			  cipherInfo->input.pBuf.len);	return bltest_aes_init(cipherInfo, encrypt);	break;    case bltestRSA:	SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,			  cipherInfo->input.pBuf.len);	return bltest_rsa_init(cipherInfo, encrypt);	break;    case bltestDSA:	SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,			  DSA_SIGNATURE_LEN);	return bltest_dsa_init(cipherInfo, encrypt);	break;    case bltestMD2:	restart = cipherInfo->params.hash.restart;	SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,			  MD2_LENGTH);	cipherInfo->cipher.hashCipher = (restart) ? md2_restart : md2_HashBuf;	return SECSuccess;	break;    case bltestMD5:	restart = cipherInfo->params.hash.restart;	SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,			  MD5_LENGTH);	cipherInfo->cipher.hashCipher = (restart) ? md5_restart : MD5_HashBuf;	return SECSuccess;	break;    case bltestSHA1:	restart = cipherInfo->params.hash.restart;	SECITEM_AllocItem(cipherInfo->arena, &cipherInfo->output.buf,			  SHA1_LENGTH);	cipherInfo->cipher.hashCipher = (restart) ? sha1_restart : SHA1_HashBuf;	return SECSuccess;	break;    default:	return SECFailure;    }    return SECSuccess;}