Methods and apparatus are disclosed for verifying the integrity of an
index or result produced by a content-addressable or associated memory or
other device. A pre-computed data protection field is stored, either as
part of a returned index of a content-addressable memory or in a separate
storage. In one implementation, a data protection operation is performed
on all or part of the returned index and a comparison is made with a
pre-computed data protection field. In one implementation, a copy of the
masks employed by a ternary content-addressable memory and a set of
pre-computed data protection fields are stored. A particular mask and
pre-computed data protection field are selected based on the generated
index. The original input value is then masked by the selected mask and
provided to a data protection function. The result of this function is
then compared to the selected pre-computed data protection field.