rv = DecryptSigBlock(&hashid, &cx->u.rsadigest[0], sizeof cx->u.rsadigest, cx->key, sig, (char*)wincx);
rv = DecryptSigBlock(&hashid, cx->u.buffer, HASH_LENGTH_MAX, cx->key, sig, (char*)wincx);
VFY_CreateContext(SECKEYPublicKey *key, SECItem *sig, SECOidTag algid,		  void *wincx){    VFYContext *cx;    SECStatus rv;    unsigned char *tmp;    unsigned int sigLen;    cx = (VFYContext*) PORT_ZAlloc(sizeof(VFYContext));    if (cx) {        cx->wincx = wincx;	cx->hasSignature = (sig != NULL);	cx->sigAlg = algid;	rv = SECSuccess;	switch (key->keyType) {	case rsaKey:	    cx->type = VFY_RSA;	    cx->key = SECKEY_CopyPublicKey(key); /* extra safety precautions */	    if (sig) {		SECOidTag hashid = SEC_OID_UNKNOWN;	    	rv = DecryptSigBlock(&hashid, &cx->u.rsadigest[0],			sizeof cx->u.rsadigest, cx->key, sig, (char*)wincx);		cx->alg = hashid;	    } else {		rv = decodeSigAlg(algid,&cx->alg);	    }	    break;	case fortezzaKey:	case dsaKey:	case ecKey:	    if (key->keyType == ecKey) {	        cx->type = VFY_ECDSA;		/* Unlike DSA, EDSA does not have a fixed signature length		 * (it depends on the key size)		 */		sigLen = SECKEY_PublicKeyStrength(key) * 2;		tmp = cx->u.ecdsasig;	    } else {	        cx->type = VFY_DSA;		sigLen = DSA_SIGNATURE_LEN;		tmp = cx->u.dsasig;	    }  	    cx->alg = SEC_OID_SHA1;  	    cx->key = SECKEY_CopyPublicKey(key);  	    if (sig) {	        rv = decodeECorDSASignature(algid,sig,tmp,sigLen);  	    }  	    break;	default:	    rv = SECFailure;	    break;	}	if (rv) goto loser;	switch (cx->alg) {	case SEC_OID_MD2:	case SEC_OID_MD5:	case SEC_OID_SHA1:	case SEC_OID_SHA256:	case SEC_OID_SHA384:	case SEC_OID_SHA512:	    break;	default:	    PORT_SetError(SEC_ERROR_INVALID_ALGORITHM);	    goto loser;	}    }    return cx;  loser:    VFY_DestroyContext(cx, PR_TRUE);    return 0;}