private function filterWithEncryptedCriteria($values, array $encryptedCriteria)
    {
        $result = array_filter($values, function($value) use ($encryptedCriteria) {
            foreach ($encryptedCriteria as $fieldName => $fieldValue) {
                if (!$this->fieldValueMatches($value, $fieldName, $fieldValue)) {
                    return false;
                }
            }
            return true;
        });

        return $result;
    }