The square-and-multiply algorithm, also known as binary exponentiation or repeated squaring, is a technique for fast exponentiation commonly used in modern cryptography and computational number theory. Despite its prominence, the historical origins of the algorithm are not known with certainty. This paper critically examines the origins and formalization of the algorithm through primary source analysis. We focus on Jamshid al-Kashi's fifteenth-century Miftah al-Hisab where the algorithm is articulated explicitly as a general method and claimed by al-Kashi as his own innovation. To contextualize this, we trace earlier instances of successive squaring in the works of al-Uqlidisi and al-Biruni, who applied these techniques for specific calculations, but did not formalize them into a general procedure. The earliest known work on this method of computation is found in Pingala's prosodic studies in ancient India (c. 200 BCE). Even though it was not fully developed as a general technique, Pingala's work seems to contain the conceptual foundation of the algorithm which is to employ the binary representation of a positive integer. By mapping this intellectual progression, the paper illustrates the historical background of an algorithm that is prominent in modern computation.
翻译:平方乘算法,也称为二进制指数运算或重复平方,是一种用于快速指数运算的技术,广泛应用于现代密码学和计算数论领域。尽管该算法具有显著的重要性,但其历史起源尚不确定。本文通过原始文献分析,批判性地审视了该算法的起源与形式化过程。我们重点关注十五世纪贾姆希德·卡希的《算术之钥》,书中明确将该算法阐述为一种通用方法,并声称其为卡希本人的创新。作为背景,我们追溯了乌格利迪西和比鲁尼著作中更早出现的连续平方实例:他们将该技术用于特定计算,但未将其形式化为通用程序。关于该计算方法最早的已知工作见于古印度平伽拉的韵律学研究(约公元前200年)。尽管平伽拉未能将其发展为完整的通用技术,但其著作似乎包含了算法的概念基础,即利用正整数的二进制表示。通过梳理这一智力演进过程,本文阐明了这一在现代计算中具有重要地位的算法的历史背景。