1. A method for searching within a data block for a data chunk having a predefined value, the method comprises: fetching, by a processor, a data block search instruction; fetching, a data unit that comprises multiple data chunks, wherein at least one data chunk within the data unit belongs to the data block; deciding whether to use a mask for data chunk level masking or for bit level masking; searching, by a hardware accelerator, for a valid data chunk within the fetched data unit that has the predefined value, wherein the searching comprising applying a mask; wherein a valid data chunk is a non-masked data chunk that belongs to the data block; and determining whether to update the value of the mask and whether to fetch a new data unit that belongs to the data block.