1. A method for error detection, comprising: storing in an associative memory multiple data entries, each data entry comprising a data item together with one or more check symbols computed with respect to the data item, wherein each data item comprises information symbols, and wherein storing the multiple data entries comprises choosing the check symbols so that the information symbols together with the check symbols constitute codewords of a linear code; applying a predetermined sequence of search keys to the memory, thereby causing the memory to generate, in parallel, match results with respect to the data entries, wherein applying the predetermined sequence of the search keys comprises defining a parity-check matrix of the linear code, and constructing the search keys using test vectors taken from the parity-check matrix; and processing the match results in order to identify an error in at least one of the data entries.