CN101097511A - 使用折叠的模归约 - Google Patents

使用折叠的模归约 Download PDF

Info

Publication number
CN101097511A
CN101097511A CNA2006101728399A CN200610172839A CN101097511A CN 101097511 A CN101097511 A CN 101097511A CN A2006101728399 A CNA2006101728399 A CN A2006101728399A CN 200610172839 A CN200610172839 A CN 200610172839A CN 101097511 A CN101097511 A CN 101097511A
Authority
CN
China
Prior art keywords
mod
instruction
live part
multiplication
computer program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CNA2006101728399A
Other languages
English (en)
Other versions
CN101097511B (zh
Inventor
W·哈森普劳
G·高巴茨
V·戈帕尔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Intel Corp
Original Assignee
Intel Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Intel Corp filed Critical Intel Corp
Publication of CN101097511A publication Critical patent/CN101097511A/zh
Application granted granted Critical
Publication of CN101097511B publication Critical patent/CN101097511B/zh
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04KSECRET COMMUNICATION; JAMMING OF COMMUNICATION
    • H04K1/00Secret communication

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Executing Machine-Instructions (AREA)
  • Devices For Executing Special Programs (AREA)
  • Storage Device Security (AREA)
  • Complex Calculations (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Dc Digital Transmission (AREA)

Abstract

描述了确定N mod M的技术,其中N是n位宽的数,而M是m位宽的数。该技术通常涉及确定N′=NH2fmod M+NL,并在随后确定N′mod M。

Description

使用折叠的模归约
背景
密码术保护数据免受不需要的访问。密码术通常涉及使原始数据(明文)难以理解(密文)的对数据的数学运算(加密)。逆数学运算(解密)从密文中恢复原始数据。密码术覆盖了比加密和解密数据更为广泛的应用领域。例如,密码术可经常用于认证(即,可靠地确定通信代理的身份)、数字签名的生成等。
当前的密码技术非常依赖密集的数学运算。例如,许多方案使用一类称为模取幂(modular exponentiation)的模算术,该算术涉及将一大数升到某次幂再用模数来归约(即,被给定模数除时的余数)。在数学上,模取幂可被表示为ge mod M(ge对M取模),其中e是指数而M是模数。
概念上,乘法和模归约是直截了当的运算。然而在这些系统中使用的数的大小都很大并且远远超过处理器的固有字长。例如,密码术协议可以要求对长度为1024至4096位甚至更长的数的模运算,而许多处理器固有的字长只有32或64位。对这样的大数执行运算在时间和计算资源方面是非常昂贵的。
附图简述
图1和图2示出了Karatsuba乘法。
图3是示出Karatsuba乘法的一个示例实现的流程图。
图4和图5示出了将数N折叠成数N′,其中N≡N′。
图6示出了N mod M的确定。
图7示出了数N的迭代折叠。
图8描绘了执行Karatsuba乘法和/或模归约的体系结构。
详细描述
如上所述,各种各样的密码术运算涉及极大数的乘法和/或模归约。在此描述的是能够减轻这些计算密集型运算的负担并且能够加速密码系统的操作的各种技术。这些技术也可以在更为通用的非密码计算设置中应用。一种这样的技术涉及改进称为Karatsuba乘法的大数相乘技术的效率。另一种技术涉及改进模归约的效率。
Karatsuba乘法
已经开发了各种各样的方法来执行二个数的乘法。一种已知作为教科书乘法的通用方法涉及分割操作数并对各个更小的片段执行乘法运算。作为一个示例,两个n位宽的数A和B可以如下表示为一组更小的子片段:
A=a12s+a0
                   [1]
B=b12s+b0
                   [2]
其中a0和b0项代表A和B的最低有效位,而a1和b1则代表剩下的更高有效位。在这种记法中,ax和bx中的下标x代表一片段在数内的序数(例如,a0代表A的最低有效位,a1为更高一位的有效位等等)。
使用传统的教科书乘法,可以使用四次更小的乘法来计算A和B:
A x B=a1b122s+(a0b1+b0a1)2s+a0b0
                                                [3]
一种称为Karatsuba乘法的乘法技术能够减少片段乘法的次数。例如,对于上述A和B,所得结果:
(a0b1+b0a1)
             [4]
[3]中项可被计算为:
[(a0+a1)(b0+b1)]-a1b1-a0b0
                                    [5]
因为a1b1和a0b0形成了方程[3]中的其他项,所以在方程[5]中使用的值并不代表额外的计算成本。用方程[5]取代方程[3]中的方程[4],A x B的Karatsuba乘法可以计算为:
A x B=a1b122s+([(a0+a1)(b0+b1)]-a1b1-a0b0)2s+a0b0
                                                    [6]
这一取代用两个加法和一个简单乘法换取了两个乘法。在大多数情况下,这代表了计算效率的大幅增加。
在上述示例中,Karatsuba乘数被分为两段(即,“二项Karatsuba乘法”)。然而Karatsuba也可应用于其他数目的片段。例如,可以为数A和B定义三项Karatsuba乘法:
A=a222s+a12s+a0
                                 [7]
B=b222s+b12s+a0
                                 [8]
A x B=a2b224s+a1b122s+a0b0+[(a2+a1)(b2+b1)-a2b2-a1b1]23s+
[(a2+a0)(b2+b0)-a2b2-a0b0]22s+[(a0+a1)(b0+b1)-a0b0-a1b1]2s
                                                             [9]
其中A和B分别被分成三个S位的片段。
类似于二项Karatsuba乘法[6],三项Karatsuba乘法[9]用相同序数片段(例如,axbx)的乘法运算和相一数的片段的加法(例如,ax+ay)来取代不同序数片段之间的乘法(例如,axby)。还可以为五项Karatsuba乘法定义方程。这些Karatsuba方程共用它们需要最多(t2+t)/2次乘法的性质,其中t是项数。
Karatsuba乘法可用递归来实现。例如,在二项Karatsuba乘法中:
A x B=a1b122n+((a0+a1)(b0+b1)-a1b1-a0b0)2n+a0b0
                                                      [6]
进而可以使用Karatsuba来执行每个较小片段的乘法。例如,执行A x B的Karatsuba乘法可以涉及a1b1、a0b0和(a0+a1)(b0+b1)的Karatsuba乘法。这些乘法可以涉及更小的子片段的Karatsuba乘法。例如,确定a1b1可以涉及将a1和b1分成多项子片段。
然而,这种方法的潜在问题是所生成的不同大小的操作数。即,(a0+a1)项和(b0+b1)项都可能在加法运算中产生进位。随后对(a0+a1)和(b0+b1)结果的乘法则可能溢出到额外的固有字中。这会大幅降低Karatsuba实现的效率。
为解决“进位”问题,图1至图3示出了对两个操作数的最低有效位执行Karatsuba乘法并在随后基于最高有效位校正所得结果的示例实现。更详细地,图1示出了两个相乘的操作数A100和B102。在此示例中,每个操作数都是n+1位宽,其中n是某一处理器固有字长s的两倍。在此示例中,每个操作数都被分为两项和一个额外的高位。例如,A的最低s个有效位形成a0,接下来的s个有效位形成a1,而A的最高有效位则形成ah
如图所示,使用如下方程对s大小的项执行Karatsuba乘法:
22Sa1b1+2s[(a1+a0)(b1+b0)-a1b1-a0b0]+a0b0
                                                [10]
所得结果可以基于最高有效位ah和bh的值进行调整。例如,如图所示,结果可以增加
2nahB[b1:b0]
                        106[11]
2nbh A[a1:a0]
                        108[12]
换言之,如果ah是“1”,则所得结果就增加移了n位的b1:b0的n位。类似地,如果bh是“1”,则所得结果就增加移了n位的a1:a0的n位。这些调整可以实现为额外的运算,例如:
结果=结果+2nahB[b1:b0]
结果=结果+2nbhA[a1:a0]
或作为后跟加法的分支:
if(ah)then结果=结果+2nB[b1:b0]
if(bh)then结果=结果+2nA[a1:a0]
最后,如果ah和bh都是“1”,那么所得结果就增加2n(即,ahbh)。这能够使用分支来实现,例如:
if(ah bh)then结果=结果+22n
加法与一个或多个分支语句的这一组合能够防止将进位向下传播到更低级别的递归。
图2示出了上述值为469的A 100乘上值为369的B 102的过程的运算。如图所示,排除了最高有效位的ah和bh位,A[2s-1:0]和B[2s-1:0]的Karatsuba乘法产生值24,069。该值首先对ah调整至78,597,随后再对bh调整至107,525。最后,因为ah和bh都为“1”,所以就加上对于22n=16的最高有效位以产生最终的答案173,061。同样地,可以通过Karatsuba技术的递归应用确定axbx的值。通过切去ah和bh位,递归就能对相同的适宜大小的操作数进行运算。
图3示出了该Karatsuba技术在一递归方案中的实现。如上所述,运算数A和B的Karatsuba乘法可由其后跟随了对A和B最高有效位ah和bh的校正116的A[n:0]和B[n:0]的乘法114来执行。所得的结果就返回118至递归栈。
Karatsuba乘法在操作数的长度远长于处理器固有字长时尤其理想。例如,处理器与更长的操作数相比只有固有字长s。当n接近s时,Karatsuba的效率降低,而教科书乘法则变得更有吸引力。于是,如图3所示,取决于递归的当前深度112,该过程可以使用教科书乘法120、122或者Karatsuba104、106和108。在实践中,使用教科书乘法执行最后两级递归(例如,L=2)可以提供最佳的整体性能。
虽然图1至图3描述了示例实现,但是也存在许多变化。例如,在图1至图3中,每个Karatsuba项都被描绘为s位宽。然而,各项既无需具有相同的位宽又无需占满单个固有字。类似地,虽然将ah和bh描述为单个位,但是在其他实现中,ah和bh可以包括多个位。
如上所述,可以为不同数目的项(例如,2、3和5)定义不同的Karatsuba方程。标准Karatsuba分解是如下六个长度之一的数:
n=2k
n=3·2k
n=32·2k
n=33·2k
n=34·2k
n=5·2k
其中n是数的长度,而k是整数。
为了优化Karatsuba分解,可以为一个数填充零以符合更大的标准型。为分辨使用了哪个标准Karatsuba分解,可以计算每一分解的工作量w并选择最小的一个:
Figure A20061017283900101
Figure A20061017283900103
Figure A20061017283900104
Figure A20061017283900106
可以为不同的n值计算w的值。所得的结果例如可用于形成指示基于给定n的最低w值来填充给定数的量的查找表。
使用折叠的模归约
除了乘法之外,许多密码方案涉及模归约(例如,N mod M的计算)。为了减小模归约运算的花费,某些系统使用称为Barrett模归约的技术。本质上,Barrett计算商的估计,
q=floor(floor(N/2m)μ/M)
                                [13]
其中m是模数M的宽度,而μ是由下式确定的常数:
μ=floor(22n/M).
                                [14]
其中n是数N的宽度。N mod M的值随后可通过计算N-qM确定,其后如有必要可最终减去M以确保最终值小于M。对Barrett的效率作出贡献的是存取μ的预计算的值的能力。即,可以只基于N的大小确定μ的值而无需存取N的特定值。
诸如Barrett模归约等技术可以降低模归约的花费。图4至图6示出了能够进一步减小模归约计算成本的技术。更具体地,图4示出了将数N 202“折叠成”宽度更小的数N′206。尽管宽度更小,但折叠运算确定N′,就使得N′mod M与N modM相同。诸如经典Barrett模归约等传统运算随后就能对更小的N′进行运算。通过“收缩”操作数N,后续的运算涉及能够简化用于确定模余数的乘法的大小更小的数。此外,数N越大,效率也就变得越明显。例如,示例测试估计对512位大小N的增速达27%,而对4096位的N的增速则可跃至177%。
更详细地,图4描绘了宽度为n的数N 202以及宽度为m的数M 200。为了确定N mod M,“折叠”运算212从N中生成N′。如图所示,折叠212在将N描绘成较高有效部分NH和较低有效部分NL的折叠点f处发生。例如,可以选择折叠点f落在模数的长度和N的长度的中点处。例如,假设N的宽度为2m(模数宽度的两倍),则折叠点可以位于由21.5m标识的数位位置上。这一折叠点能够让所得的N′的宽度最小。即,在任意方向上移动折叠点以扩张或收缩NH或NL能够实际增加N′的大小。
基于折叠点,N′可被确定为:
N′=NH2fmod M+NL
                        212[15]
随后例如可以用经典Barrett技术,使用该较小的N′来执行模归约。
如图所示,N′的确定212涉及2fmod M 208(称其为M′)的项。可以预计算2fmod M的值而无需参考具体的N值。为M和f的各种值预计算这一值能够通过将费时的乘法移至对时间要求不那么高的周期来加速N′的实时计算。可以将用于M和f值的预计算的值存储在存储器内的表中以便快速存取。NH(2fmod M)的乘法例如可以使用上述Karatsuba乘法来执行。
为了阐述清楚,图5示出了一个折叠示例,其中N是值为252的8位宽的数(1111,1100b),而M是值为13的4位宽的数(1101b)。如图所示,折叠点被选为f=21.5m=26。N′的计算产生了值96。如图所示,N与其相应的折叠数N′对模数13都产生了相同的模余数5。可以使用诸如Barrett等各种模归约方法中的任何方法来执行N′的模归约。
图6描绘了使用上述技术来完整确定N mod M的一个示例。在此示例中,N 202的宽度n=4s,而M 204的宽度m=2s。如图所示,折叠点f是23s。如图所示,为M′=23smod M 222预计算的值可用于确定(M′)(NH)224。虽然图6将NH表达为floor(N/23s)的值,但是通过设置NH=N[4s-1:3s]能够更快地获取NH的值。(M′)(NH)224的值可以加至NL 226以完成N′的计算。同样地,虽然该图将NL表达为N mod 23s,但是通过设置NH=N[3s-1:0]能够更快地获取NL的值。
在确定N′之后,就可以使用经典Barrett归约来计算N′mod M。在此情况下,可如下计算Barrett归约230,234:
R=N′-floor(floor(N′/22s)(μ/2s))M
                                            [16]
其中μ被确定为floor(23s/M)。与M′的值类似,能够为s和M的多个值预计算μ的值。这一预计算再次可将费时的操作时移至不要求实时运算的周期。
所得的R 236可以大于模数M 200。在这一相当罕有的情况下,可以使用减法R=R-M以确保R<M。
单个折叠运算能够显著改进模归约的效率和实时性能。如图7所示,重复的折叠能够提供与消耗的乘法和ALU运算(例如,加、减和移位)总数相关的进一步效率。如图所示,N 202再次被折叠成N′204。所得的N′的宽度通常为f。在N′的宽度为f+1时,虽然不是必须的,但仍可以使用减法运算N′=N′-(M 2m)来“修整”N′。如图所示,额外的折叠操作再将N′变换成N″206,其中N″mod M=N′modM。这第二次折叠又能增加计算效率。
在不同折叠迭代中使用的折叠点从用于第一次迭代的21.5m移至用于第二次迭代的21.25m。更一般地,用于给定迭代的折叠点可以被确定为2(1+2^-i)m,其中i是迭代数。
虽然图7描绘了两次折叠,但额外的折叠也是可行的。然而,额外的折叠会导致收益递减和/或实际上增加乘法运算的次数。
模取幂的示例实现
上述技术可用于执行各种密码运算。例如,可以组合上述Karatsuba乘法和折叠技术以执行模取幂。
再一次,模取幂涉及gemod M。执行模取幂是多各密码算法的中心。例如在RSA中,公钥是通过公有指数e-public和模数M来形成的。而私钥是通过私有指数e-private和模数M来形成的。为了加密消息(例如,分组或分组净荷),执行如下运算:
密文=明文e-publicmod M
                            [17]
为解密消息,执行如下运算:
明文=密文e-privatemod M
                            [18]
用于执行模取幂的一个过程按从左到右的顺序处理指数e的各个位。从初值A=1开始,该过程对遇到的每个“0”位将值平方(即,A=A*A)。对于每个“1”位,该过程既将该值平方又将其与g相乘(即,A=A*A*g)。最终的结果可用于模归约运算。例如,为确定31010bmod 5,该过程如下进行运算,其中g=3、e=″1010″而M=5:
               A
               1
指数位1-1    1*1  *3=3
指数位2-0    3*3    =9
指数位3-1    9*9*3  =243
指数位4-0    243*243=59049
A mod M        4
可以在乘法运算中,诸如在处理每个指数位或每几个指数位之后交插模归约,以代替在已经累加成非常大的数时在最后执行模归约。例如,为计算31010b mod 5,该过程可以如下行进:
             A
             1
指数位1-1    1*1*3  =3
A mod M        3
指数位2-0    3*3    =9
A mod M        4
指数位3-1    4*4*3  =48
A mod M        3
指数位4-0    3^2    =9
A mod M        4
不管具体的实现如何,对平方和“g”乘法都使用上述Karatsuba乘法计算就能显著加速模取幂。此外,使用折叠,归约运算消耗的处理资源显著减少。
通过存储重复使用的值能获得额外的计算效率。例如,在该示例中有两个不同的乘法都涉及g。在2048位指数的现实示例中,使用g的数乘法会大的多。为了改进涉及g的Karatsuba乘法效率,可将不同值gi=(gH(i)+gL(i))存储在表格内以供重复使用,其中i代表Karatsuba递归的深度。这一高速缓存可以节省冗余地执行相同的加法的大量周期。高速缓诸如在折叠中使用的M′和μ等其他频繁使用的值也能在模归约使用相同模数多次发生的情况下提高性能。
在执行大小不等的数的乘法,诸如1k大小的数和2k大小的数的乘法时可使用额外的优化。这些乘法可以在确定Barrett的qM值以及在确定NH 2fmod M时发生。为利用Karatsuba,1k*2k乘法可以分解为两个1k*1k运算,诸如q*mh和q*m1。因为在两个运算中都使用了q,所以无需两次确定(qh+q1)的值,而只需对其进行存储以备进一步的使用。
同样地,以上仅是一个示例,并且Karatsuba和折叠技术还可用于执行各种各样的其他密码运算以及其他通用的数学应用。
可以用各种方法并在各种系统内实现这些技术。例如,这些技术可以用(例如,由以上用诸如Verilog(tm)等硬件描述语言描述的编程技术所确定的)专用数字或模拟硬件、固件来实现,和/或被实现为ASIC(专用集成电路)或可编程门阵列(PGA)。这些技术还可被实现为放置在计算机可读介质上用于处理器执行的计算机程序。例如,处理器可以是通用处理器。
如图8所示,这些技术可以通过由能卸载密码运算的处理器模块300所执行的计算机程序来实现。如图所示,模块300包括多个可编程处理单元306至312以及专用硬件乘法器316。处理单元306至312如核心302所指示的对从共享存储器逻辑304中下载的数据运行程序。其他的处理器和/或处理器核心可以向模块300发出指定要执行的数据和运算的命令。例如,处理器核心可以向模块300发出对存储在RAM 314中的g、e和M执行模取幂的命令。核心302可通过向共享存储器逻辑304发出指令以将模取幂程序下载至处理单元306至312并将正被运算的数据从RAM 314下载至共享存储器304在最后下载到处理单元306至312来响应。处理单元306至312进而执行这些程序指令。更具体地,处理单元306至312可使用乘法器316来执行诸如Karatsuba乘法等用于执行平方或“g”乘法的乘法。一旦完成,处理单元306至312能够把结果返回给共享存储器逻辑304以传递给请求核心。处理模块300可以与可编程核心集成在同一管芯上或不同的管芯上。
同样,图8仅示出了用于实现上述Karatsuba和折叠技术的示例体系结构。然而这些技术能够在各种各样的其他体系结构中使用,诸如用于已编程的传统通用处理器。
其他实施例落入所附权利要求书的范围内。

Claims (25)

1.一种置于计算机可读存储介质上的计算机程序,包括使电路确定N mod M的指令,其中N是n位宽的数,而M是m位宽的数,所述程序用于:
确定N′=NH2fmod M+NL
其中
NH包含N的较高有效部分,并且
NL包含N的较低有效部分,
f包含将N分段成NH和NL的位置;以及
确定N′mod M。
2.如权利要求1所述的计算机程序,其特征在于,f包含N内对应于21.5m的一位。
3.如权利要求1所述的计算机程序,其特征在于,所述确定N′mod M的指令包含存取2fmod M的预计算的值的指令。
4.如权利要求1所述的计算机程序,其特征在于,所述确定N′mod M的指令包含执行N′mod M的Barrett模归约的指令。
5.如权利要求4所述的计算机程序,其特征在于,所述确定N′mod M的Barrett模归约的指令包含存取floor(2f/M)的预计算的值的指令。
6.如权利要求1所述的计算机程序,其特征在于,所述确定N′mod M的指令指令用于:
确定N″=N′H 2f′mod M+N′L
其中
N′H包含N′的较高有效部分,并且
N′L包含N′的较低有效部分,
f′包含将N′分段成N′H和N′L的位置;以及
确定N″mod M。
7.如权利要求6所述的计算机程序,其特征在于,f′包含N′内对应于21.25m的一位。
8.如权利要求6所述的计算机程序,其特征在于,所述确定N″ mod M的指令包含存取2f′mod M的预计算的值的指令。
9.如权利要求6所述的计算机程序,其特征在于,所述确定N″ mod M的指令包含执行N″mod M的Barrett模归约的指令。
10.如权利要求9所述的计算机程序,其特征在于,所述确定N″ mod M的Barrett模归约的指令包含存取floor(2f′/M)的预计算的值的指令。
11.如权利要求1所述的计算机程序,其特征在于,M包含公钥的模数。
12.一种系统,包括:
用于确定N mod M的电路,其中N是n位宽的数,并且M是m位宽的数,所述电路用于:
确定N′=NH 2fmod M+NL
其中
NH包含N的较高有效部分,并且
NL包含N的较低有效部分,
f包含将N分段成NH和NL的位置;以及
确定N′mod M。
13.如权利要求12所述的系统,其特征在于,f包含N内对应于21.5m的一位。
14.如权利要求12所述的系统,其特征在于,所述用于确定N′mod M的电路包含用于进行以下步骤的电路:
确定N″=N′H 2f′mod M+N′L
其中
N′H包含N′的较高有效部分,并且
N′L包含N′的较低有效部分,
f′包含将N′分段成N′H和N′L的位置;以及
确定N″mod M。
15.如权利要求12所述的系统,其特征在于,M包含公钥的模数。
16.如权利要求12所述的系统,其特征在于,所述电路包含执行确定N′和N′mod M的指令的可编程电路。
17.如权利要求12所述的系统,其特征在于,还包括与所述电路集成在同一管芯上并与所述电路通信耦合的可编程核心。
18.一种用于确定N mod M的计算机实现的方法,其中N是n位宽的数,而M是m位宽的数,所述方法包括:
确定N′=NH 2fmod M+NL
其中
NH包含N的较高有效部分,并且
NL包含N的较低有效部分,
f包含将N分段成NH和NL的位置;以及
确定N′mod M。
19.如权利要求18所述的计算机实现的方法,其特征在于,f包含N内对应于21.5m的一位。
20.如权利要求18所述的计算机实现的方法,其特征在于,所述确定N′ modM包含存取2fmod M的预计算的值。
21.如权利要求18所述的计算机实现的方法,其特征在于,所述确定N′modM包含执行N′mod M的Barrett模归约。
22.如权利要求18所述的计算机实现的方法,其特征在于,所述确定N′modM包含:
确定N″=N′H 2f′mod M+N′L
其中
N′H包含N′的较高有效部分,并且
N′L包含N′的较低有效部分,
f′包含将N′分段成N′H和N′L的位置;以及
确定N″mod M。
23.如权利要求22所述的计算机实现的方法,其特征在于,f′包含N′内对应于21.25m的一位。
24.如权利要求22所述的计算机实现的方法,其特征在于,所述确定N″ modM包含执行N″mod M的Barrett模归约。
25.如权利要求22所述的计算机实现的方法,其特征在于,M包含公钥的模数。
CN2006101728399A 2006-06-27 2006-12-30 使用折叠的模归约 Expired - Fee Related CN101097511B (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US11/476,432 US8229109B2 (en) 2006-06-27 2006-06-27 Modular reduction using folding
US11/476,432 2006-06-27

Publications (2)

Publication Number Publication Date
CN101097511A true CN101097511A (zh) 2008-01-02
CN101097511B CN101097511B (zh) 2011-07-27

Family

ID=38846425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2006101728399A Expired - Fee Related CN101097511B (zh) 2006-06-27 2006-12-30 使用折叠的模归约

Country Status (7)

Country Link
US (1) US8229109B2 (zh)
EP (1) EP2033357A2 (zh)
JP (2) JP5116770B2 (zh)
KR (1) KR101062558B1 (zh)
CN (1) CN101097511B (zh)
TW (1) TWI350094B (zh)
WO (1) WO2008002828A2 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938355A (zh) * 2009-06-26 2011-01-05 英特尔公司 用于执行有效率的抗侧信道攻击的简化的方法和设备
CN113761822A (zh) * 2020-06-04 2021-12-07 熵码科技股份有限公司 采用迭代计算的模数运算电路

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8229109B2 (en) 2006-06-27 2012-07-24 Intel Corporation Modular reduction using folding
US7827471B2 (en) * 2006-10-12 2010-11-02 Intel Corporation Determining message residue using a set of polynomials
US8689078B2 (en) 2007-07-13 2014-04-01 Intel Corporation Determining a message residue
US8042025B2 (en) * 2007-12-18 2011-10-18 Intel Corporation Determining a message residue
US7886214B2 (en) * 2007-12-18 2011-02-08 Intel Corporation Determining a message residue
US9052985B2 (en) * 2007-12-21 2015-06-09 Intel Corporation Method and apparatus for efficient programmable cyclic redundancy check (CRC)
US8144864B2 (en) * 2007-12-28 2012-03-27 Intel Corporation Method for speeding up the computations for characteristic 2 elliptic curve cryptographic systems
US8312363B2 (en) * 2008-12-16 2012-11-13 Intel Corporation Residue generation
CN102761414B (zh) * 2011-04-26 2015-06-10 航天信息股份有限公司 一种sm3密码杂凑算法及确定其中的变量字的方法
US9778910B2 (en) 2015-03-20 2017-10-03 Intel Corporation Multiplier pipelining optimization with a bit folding correction
US9753692B2 (en) 2015-03-25 2017-09-05 Intel Corporation Multiplier pipelining optimization with a postponed estimation correction
GB2533007B (en) * 2015-05-27 2016-10-19 Imagination Tech Ltd Efficient modulo calculation
US9942039B1 (en) * 2016-09-16 2018-04-10 ISARA Corporation Applying modular reductions in cryptographic protocols
FR3070814B1 (fr) 2017-09-05 2019-09-13 Commissariat A L'energie Atomique Et Aux Energies Alternatives Dispositif de reduction modulaire
CN109710308B (zh) 2017-10-25 2023-03-31 阿里巴巴集团控股有限公司 任务的处理方法、装置和系统
US11662978B2 (en) 2020-06-04 2023-05-30 PUFsecurity Corporation Modular operation circuit adopting iterative calculations

Family Cites Families (56)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3980874A (en) * 1975-05-09 1976-09-14 Burroughs Corporation Binary to modulo M translation
JP2577914B2 (ja) * 1987-06-11 1997-02-05 クラリオン株式会社 m系列符号発生器
FR2622713A1 (fr) * 1987-10-30 1989-05-05 Thomson Csf Circuit de calcul utilisant une arithmetique residuelle
FR2658932A1 (fr) 1990-02-23 1991-08-30 Koninkl Philips Electronics Nv Procede de codage selon la methode dite rsa, par un microcontroleur et dispositif utilisant ce procede.
US5384786A (en) * 1991-04-02 1995-01-24 Cirrus Logic, Inc. Fast and efficient circuit for identifying errors introduced in Reed-Solomon codewords
US5274707A (en) * 1991-12-06 1993-12-28 Roger Schlafly Modular exponentiation and reduction device and method
US5642367A (en) * 1994-02-07 1997-06-24 Mitsubishi Semiconductor America, Inc. Finite field polynomial processing module for error control coding
US5671377A (en) * 1994-07-19 1997-09-23 David Sarnoff Research Center, Inc. System for supplying streams of data to multiple users by distributing a data stream to multiple processors and enabling each user to manipulate supplied data stream
US7190681B1 (en) * 1996-07-10 2007-03-13 Wu William W Error coding in asynchronous transfer mode, internet and satellites
US6128766A (en) * 1996-11-12 2000-10-03 Pmc-Sierra Ltd. High speed cyclic redundancy check algorithm
US5942005A (en) * 1997-04-08 1999-08-24 International Business Machines Corporation Method and means for computationally efficient error and erasure correction in linear cyclic codes
EP1008026B1 (en) * 1997-05-04 2007-09-05 M-Systems Flash Disk Pioneers Ltd. Improved apparatus & method for modular multiplication & exponentiation based on montgomery multiplication
US6484192B1 (en) * 1998-01-29 2002-11-19 Toyo Communication Equipment Co., Ltd. Root finding method and root finding circuit of quadratic polynomial over finite field
US6223320B1 (en) * 1998-02-10 2001-04-24 International Business Machines Corporation Efficient CRC generation utilizing parallel table lookup operations
CA2267721C (en) * 1998-03-26 2002-07-30 Nippon Telegraph And Telephone Corporation Scheme for fast realization of encryption, decryption and authentication
US6530057B1 (en) * 1999-05-27 2003-03-04 3Com Corporation High speed generation and checking of cyclic redundancy check values
GB2360177B (en) * 2000-03-07 2003-08-06 3Com Corp Fast frame error checker for multiple byte digital data frames
JP3926532B2 (ja) * 2000-03-16 2007-06-06 株式会社日立製作所 情報処理装置、情報処理方法、及びカード部材
GB0013355D0 (en) * 2000-06-01 2000-07-26 Tao Group Ltd Parallel modulo arithmetic using bitwise logical operations
US6721771B1 (en) * 2000-08-28 2004-04-13 Sun Microsystems, Inc. Method for efficient modular polynomial division in finite fields f(2{circumflex over ( )}m)
US6609410B2 (en) * 2000-09-29 2003-08-26 Spalding Sports Worldwide, Inc. High strain rate tester for materials used in sports balls
US6732317B1 (en) * 2000-10-23 2004-05-04 Sun Microsystems, Inc. Apparatus and method for applying multiple CRC generators to CRC calculation
JP3785044B2 (ja) * 2001-01-22 2006-06-14 株式会社東芝 べき乗剰余計算装置、べき乗剰余計算方法及び記録媒体
US20020144208A1 (en) * 2001-03-30 2002-10-03 International Business Machines Corporation Systems and methods for enabling computation of CRC' s N-bit at a time
US7027597B1 (en) * 2001-09-18 2006-04-11 Cisco Technologies, Inc. Pre-computation and dual-pass modular arithmetic operation approach to implement encryption protocols efficiently in electronic integrated circuits
US7027598B1 (en) * 2001-09-19 2006-04-11 Cisco Technology, Inc. Residue number system based pre-computation and dual-pass arithmetic modular operation approach to implement encryption protocols efficiently in electronic integrated circuits
US7458006B2 (en) * 2002-02-22 2008-11-25 Avago Technologies General Ip (Singapore) Pte. Ltd. Methods for computing the CRC of a message from the incremental CRCs of composite sub-messages
US6904558B2 (en) * 2002-02-22 2005-06-07 Agilent Technologies, Inc. Methods for computing the CRC of a message from the incremental CRCs of composite sub-messages
JP3930479B2 (ja) * 2002-04-22 2007-06-13 富士通株式会社 誤り検出符号化及び復号装置並びに除算装置
US7512230B2 (en) * 2002-04-30 2009-03-31 She Alfred C Method and apparatus of fast modular reduction
US7508936B2 (en) * 2002-05-01 2009-03-24 Sun Microsystems, Inc. Hardware accelerator for elliptic curve cryptography
US7187770B1 (en) * 2002-07-16 2007-03-06 Cisco Technology, Inc. Method and apparatus for accelerating preliminary operations for cryptographic processing
US7343541B2 (en) * 2003-01-14 2008-03-11 Broadcom Corporation Data integrity in protocol offloading
US7243289B1 (en) * 2003-01-25 2007-07-10 Novell, Inc. Method and system for efficiently computing cyclic redundancy checks
US7058787B2 (en) * 2003-05-05 2006-06-06 Stmicroelectronics S.R.L. Method and circuit for generating memory addresses for a memory buffer
US7373514B2 (en) * 2003-07-23 2008-05-13 Intel Corporation High-performance hashing system
DE602004018187D1 (de) * 2003-11-19 2009-01-15 Honeywell Int Inc Nachrichtfehlerverifikation durch verwendung von prüfung mit verborgenen daten
US7543142B2 (en) * 2003-12-19 2009-06-02 Intel Corporation Method and apparatus for performing an authentication after cipher operation in a network processor
US20050149744A1 (en) * 2003-12-29 2005-07-07 Intel Corporation Network processor having cryptographic processing including an authentication buffer
US7171604B2 (en) * 2003-12-30 2007-01-30 Intel Corporation Method and apparatus for calculating cyclic redundancy check (CRC) on data using a programmable CRC engine
US7529924B2 (en) * 2003-12-30 2009-05-05 Intel Corporation Method and apparatus for aligning ciphered data
US7543214B2 (en) * 2004-02-13 2009-06-02 Marvell International Ltd. Method and system for performing CRC
US20060059219A1 (en) * 2004-09-16 2006-03-16 Koshy Kamal J Method and apparatus for performing modular exponentiations
US7590930B2 (en) * 2005-05-24 2009-09-15 Intel Corporation Instructions for performing modulo-2 multiplication and bit reflection
US7707483B2 (en) * 2005-05-25 2010-04-27 Intel Corporation Technique for performing cyclic redundancy code error detection
US20070083585A1 (en) * 2005-07-25 2007-04-12 Elliptic Semiconductor Inc. Karatsuba based multiplier and method
US7958436B2 (en) * 2005-12-23 2011-06-07 Intel Corporation Performing a cyclic redundancy checksum operation responsive to a user-level instruction
US20070157030A1 (en) * 2005-12-30 2007-07-05 Feghali Wajdi K Cryptographic system component
US8229109B2 (en) 2006-06-27 2012-07-24 Intel Corporation Modular reduction using folding
US7827471B2 (en) * 2006-10-12 2010-11-02 Intel Corporation Determining message residue using a set of polynomials
US7925011B2 (en) * 2006-12-14 2011-04-12 Intel Corporation Method for simultaneous modular exponentiations
US8689078B2 (en) 2007-07-13 2014-04-01 Intel Corporation Determining a message residue
US8042025B2 (en) * 2007-12-18 2011-10-18 Intel Corporation Determining a message residue
US7886214B2 (en) * 2007-12-18 2011-02-08 Intel Corporation Determining a message residue
US9052985B2 (en) * 2007-12-21 2015-06-09 Intel Corporation Method and apparatus for efficient programmable cyclic redundancy check (CRC)
US8189792B2 (en) * 2007-12-28 2012-05-29 Intel Corporation Method and apparatus for performing cryptographic operations

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938355A (zh) * 2009-06-26 2011-01-05 英特尔公司 用于执行有效率的抗侧信道攻击的简化的方法和设备
CN101938355B (zh) * 2009-06-26 2014-10-08 英特尔公司 用于执行有效率的抗侧信道攻击的简化的方法和设备
CN113761822A (zh) * 2020-06-04 2021-12-07 熵码科技股份有限公司 采用迭代计算的模数运算电路

Also Published As

Publication number Publication date
EP2033357A2 (en) 2009-03-11
TWI350094B (en) 2011-10-01
US8229109B2 (en) 2012-07-24
JP5378579B2 (ja) 2013-12-25
TW200822664A (en) 2008-05-16
JP2012234199A (ja) 2012-11-29
KR101062558B1 (ko) 2011-09-06
CN101097511B (zh) 2011-07-27
KR20090017637A (ko) 2009-02-18
WO2008002828A2 (en) 2008-01-03
US20070297601A1 (en) 2007-12-27
WO2008002828A3 (en) 2008-02-21
JP2009540394A (ja) 2009-11-19
JP5116770B2 (ja) 2013-01-09

Similar Documents

Publication Publication Date Title
CN101097511B (zh) 使用折叠的模归约
Karmakar et al. Saber on ARM CCA-secure module lattice-based key encapsulation on ARM
CN101479698A (zh) 将两数相乘
Hossain et al. High‐performance elliptic curve cryptography processor over NIST prime fields
US20050198093A1 (en) Montgomery modular multiplier
WO2020146285A1 (en) Protection of cryptographic operations by intermediate randomization
CN100504758C (zh) 多字乘法-累加电路和蒙哥马利模乘法-累加电路
Seo et al. Binary and prime field multiplication for public key cryptography on embedded microprocessors
US20110231467A1 (en) Montgomery multiplier having efficient hardware structure
EP2350811A1 (en) Method and apparatus for modulus reduction
Meher et al. Low-Latency, Low-Area, and Scalable Systolic-Like Modular Multipliers for $ GF (2^{m}) $ Based on Irreducible All-One Polynomials
US20230254145A1 (en) System and method to improve efficiency in multiplicationladder-based cryptographic operations
Morales‐Sandoval et al. Scalable GF (p) Montgomery multiplier based on a digit–digit computation approach
Pessl et al. Curved tags–a low-resource ECDSA implementation tailored for RFID
US11922133B2 (en) Processor and method for processing mask data
Yalçin Compact ECDSA engine for IoT applications
US6917956B2 (en) Apparatus and method for efficient modular exponentiation
CN115801244A (zh) 用于资源受限处理器的后量子密码算法实现方法及系统
Becker et al. Polynomial multiplication on embedded vector architectures
CN101183945A (zh) 基于旁路算子的椭圆曲线抗旁路攻击方法
Zimmermann et al. High-performance integer factoring with reconfigurable devices
US7167885B2 (en) Emod a fast modulus calculation for computer systems
Emmart A study of high performance multiple precision arithmetic on graphics processing units
Addabbo et al. Efficient implementation of pseudochaotic piecewise linear maps with high digitization accuracies
Gutub High speed hardware architecture to compute galois fields GF (p) montgomery inversion with scalability features

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20110727

Termination date: 20161230

CF01 Termination of patent right due to non-payment of annual fee