Parshas Eikev · Passuk 8:3
[God] subjected you to the hardship of hunger and then gave you manna to eat, which neither you nor your ancestors had ever known, in order to teach you that a human being does not live on bread alone, but that one may live on anything that GOD decrees.
Torah Temimah points to Sanhedrin 99a.
TT lemma: ויענך.
English: It was taught: R’ Eliezer says: Here it is written “He afflicted you and starved you,” and there “Gladden us according to the days You afflicted us, the years we saw evil.” From here [we learn] that the days of the Messiah are forty years.
Category A (13:2) — Gezeirah Shavah. Rabbi Yishmael’s Thirteen Middos, rule 2.
Method — Sanhedrin derives a forty-year Messianic period by linking the wilderness affliction to the affliction in Psalms through the repeated root ענה.
Shared root and exact verses — Here, Deuteronomy 8:3: “ויענך וירעיבך”; there, Psalms 90:15: “שמחנו כימות עניתנו שנות ראינו רעה”.
Formal basis — Sanhedrin 99a explicitly compares the verses with “כתיב הכא ... וכתיב התם”; the shared root is ענה.
The affliction of the wilderness becomes the measure for the length of the Messianic preparatory period: forty years.