h = (u_int16_t *) xrealloc(h, n * HASH_ENTRYSIZE);
detect_attack(u_char *buf, u_int32_t len, u_char *IV){	static u_int16_t *h = (u_int16_t *) NULL;	static u_int32_t n = HASH_MINSIZE / HASH_ENTRYSIZE;	u_int32_t i, j;	u_int32_t l;	u_char *c;	u_char *d;	if (len > (SSH_MAXBLOCKS * SSH_BLOCKSIZE) ||	    len % SSH_BLOCKSIZE != 0) {		fatal("detect_attack: bad length %d", len);	}	for (l = n; l < HASH_FACTOR(len / SSH_BLOCKSIZE); l = l << 2)		;	if (h == NULL) {		debug("Installing crc compensation attack detector.");		n = l;		h = (u_int16_t *) xmalloc(n * HASH_ENTRYSIZE);	} else {		if (l > n) {			n = l;			h = (u_int16_t *) xrealloc(h, n * HASH_ENTRYSIZE);		}	}	if (len <= HASH_MINBLOCKS) {		for (c = buf; c < buf + len; c += SSH_BLOCKSIZE) {			if (IV && (!CMP(c, IV))) {				if ((check_crc(c, buf, len, IV)))					return (DEATTACK_DETECTED);				else					break;			}			for (d = buf; d < c; d += SSH_BLOCKSIZE) {				if (!CMP(c, d)) {					if ((check_crc(c, buf, len, IV)))						return (DEATTACK_DETECTED);					else						break;				}			}		}		return (DEATTACK_OK);	}	memset(h, HASH_UNUSEDCHAR, n * HASH_ENTRYSIZE);	if (IV)		h[HASH(IV) & (n - 1)] = HASH_IV;	for (c = buf, j = 0; c < (buf + len); c += SSH_BLOCKSIZE, j++) {		for (i = HASH(c) & (n - 1); h[i] != HASH_UNUSED;		    i = (i + 1) & (n - 1)) {			if (h[i] == HASH_IV) {				if (!CMP(c, IV)) {					if (check_crc(c, buf, len, IV))						return (DEATTACK_DETECTED);					else						break;				}			} else if (!CMP(c, buf + h[i] * SSH_BLOCKSIZE)) {				if (check_crc(c, buf, len, IV))					return (DEATTACK_DETECTED);				else					break;			}		}		h[i] = j;	}	return (DEATTACK_OK);}