וְרז״ל (סנהדרין צז.) לָמְדוּ מִזֶּה דֶּרֶךְ דְּרָשׁ, אֵין מָשִׁיחַ בָּא עַד שֶׁתִּתְהַפֵּךְ כָּל הַמַּלְכוּת לְמִינוּת, שֶׁנֶּאֱמַר: ״כֻּלּוֹ הָפַךְ לָבָן טָהוֹר הוּא״, רֶמֶז לַדָּבָר ״הָפַךְ לָבָן״ כְּשֶׁהַמִּלָּה הֲפוּכָה יִהְיֶה ״נָבָל״, וּרְצוֹנָם לוֹמַר כְּשֶׁכֻּלָּם יְנַבְּלוּ צוּר יְשׁוּעָתָם אָז יְטַהֵר ה׳ בְּהֶכְרֵחַ כָּל הָאָרֶץ מִגִּלּוּלֶיהָ. וּרְאָיָתָם מִנֶּגַע זֶה הַבָּא עַל צַד הָעֹנֶשׁ, וּכְשֶׁכֻּלּוֹ הָפַךְ לָבָן וַדַּאי הַחוֹטֵא יִתֵּן אֶל לִבּוֹ לָשׁוּב, כָּךְ יִשְׂרָאֵל כְּשֶׁיִּרְאוּ שֶׁכָּל הַמַּלְכוּת יֵהָפֵךְ לְמִינוּת וְיִרְאוּ כִּי אֶפֶס עָצוּר וְעָזוּב, וַדַּאי יִתְּנוּ אָז אֶל לִבָּם לָשׁוּב בִּתְשׁוּבָה שְׁלֵמָה אֶל ה׳, וְאָז טָהוֹר הוּא.
And our Sages of blessed memory (Sanhedrin 97a) derived from this homiletically, that the Messiah will not come until the entire kingdom turns to heresy, as it says it has all turned white, he is pure. An allusion to the matter, turned white [hafakh lavan] — when the word [lavan] is reversed [hafukhah], it becomes “foolish” [naval]. That is to say, when everyone will degrade the Rock of their salvation, then God will necessarily purify the entire earth from its idols. And their proof comes from this affliction which comes as a punishment, and when it has all turned white, surely the sinner will take it to heart to repent. So too with Israel, when they see that the entire kingdom has turned to heresy and they see that there is no one restrained or abandoned, they will certainly then take it to heart to return in complete repentance to God, and then he is pure.