RNS Modular Computations for Cryptographic Applications
Karim Bigou
CNRS – IRISA – CAIRN
RAIM 2015: April 7 – 9
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 1 / 23
RNS Modular Computations for Cryptographic Applications Karim Bigou - - PowerPoint PPT Presentation
RNS Modular Computations for Cryptographic Applications Karim Bigou CNRS IRISA CAIRN RAIM 2015: April 7 9 Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 9 1 / 23 Context One objective of our research group:
CNRS – IRISA – CAIRN
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 1 / 23
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 2 / 23
channel 1 ±× mod m1 w z1 w y1 w x1 channel 2 ±× mod m2 w z2 w y2 w x2
channel n ±× mod mn w zn w yn w xn X Y Z
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 3 / 23
each channel is independant
computations over all channels can be performed in parallel an RNS multiplication requires n EMMs
randomization of internal computations (SCA countermeasures)
the number of hardware channels and theoretical channels can be different various area/ time trade-offs and multi-size support
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 4 / 23
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 5 / 23
BE
i=1 mi
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 6 / 23
±× over one channel
(i.e. n channels) base extension modulo P in RNS 1 n time n
±× ±× ±× ±×
±× ±× ±×
±× ±× ±×
±× ±× ±×
±× ±× ±× ±×
±× ±× ±×
±× ±× ±×
±× ±× ±×
RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 7 / 23
ref. conf./journ. yy usage implem. [BDK98] IEEE TC 98 RSA N [KKSS00] EuroCrypt 00 RSA N [NMSK01] CHES 01 RSA A 250 nm [CNPQ03] MWSCAS 03 RSA F Virtex 2 [BI04] IEEE TC 04 RSA N [MPS07] IMA CC 07 RSA G 7800GTX [LP07] ASSC 07 RSA P Xtensa [SG08] CHES 08 RSA, ECC G 8800GTS [SFM+09] IEEE TCAS I 09 ECC F Virtex E [LPL09] TENCON 09 ECC P Xtensa [Gui10] CHES 10 ECC F Stratix I & II [CDF+11] CHES 11 Pair. F Virtex 6, Stratix 3, Cyclone 2 [GLP+12] IEEE TC 12 RSA A 45 nm [ABS12]
12 ECC G 285GTX [BEG13] ARITH 13 RSA A 250 nm [PITM13] DSD 13 RSA F Spartan 3 [ESJ+13] IEEE TVLSI 13 ECC F VirtexE, Virtex 2 Pro, Stratix II [SS14] IEEE TCAS I 14 RSA F Virtex 6 Virtex 2 [BM14] CARDIS 14 ECC F Kintex 7 [SGXYC14] ISIC 14 RSA F Virtex 5
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 8 / 23
channel 1 rower 1 w w channel 2 rower 2 w w
channel n rower n w w cox
1
t w w Output Input n × w w w w w w w CTRL
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 9 / 23
rearranging computations in an ECC context [Gui10] rearranging computations in RSA exponentiation context [GLP+12] using optimizations for several usual computation patterns [BT14]
computing pattern of the form AB + CD mod P in ECC formulas [BDE13] computing the modular inversion with our PM-MI algorithm in an ECC context [BT13]
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 10 / 23
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 11 / 23
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 12 / 23
2n moduli required vs 2n (3 half-bases Ba, Bb, Bc of n/2)
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 13 / 23
a
a
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 14 / 23
a |P
a M−1 b
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 15 / 23
base extension (BE) computations in 1 base SPLIT PR MR
base Ba
Xa Ya Ua Kx Ky Ry = Ya Rx = Xa Qa Sa
base Bb
Xb Yb Rx Kx Ry Ky Ub Qb Sb
base Bc
Xc Yc Rx Kx Ry Ky Uc Qc Sc
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 16 / 23
0.7 0.8 0.9 1.0 1.1 1.2 10 20 30 40 50 60 70 Our / Ref
n
EMM Expo. Montg.
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 17 / 23
s M2 a + 2KsRsMa + R2 s
s |M2 aG|P + KsRs|2MaG|P + R2 s |G|P mod P
aG|P + Rs|2MaG|P
s |G|P mod P
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 18 / 23
aG|P, |2MaG|P and |G|P can be precomputed
aG|P + Rs|2MaG|P
s |G|P then log2 U2 ≈ 2ℓ i.e.
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 19 / 23
0.7 0.8 0.9 1.0 1.1 1.2 10 20 30 40 50 60 70 n Our / RNS−ME [EMM] Our (Regular) / Regular RNS−ME [EMM]
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 20 / 23
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 21 / 23
for new applications? (e.g. lattice based cryptography [BEMP14])
We have to count differently: e.g. in [BDE13] one has point ADD faster than DBL!
choice of parameters (e.g. moduli, curve parameters . . . ) (CHES 2015 submission) new algorithms new architectures
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 22 / 23
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 23 / 23
[ABS12]
RNS-based elliptic curve point multiplication for massive parallel architectures. The Computer Journal, 55(5):629–647, May 2012. [BDE13] J.-C. Bajard, S. Duquesne, and M. D. Ercegovac. Combining leak-resistant arithmetic for elliptic curves defined over Fp and RNS representation. Publications Math´ ematiques UFR Sciences Techniques Besan¸ con, pages 67–87, 2013. [BDK98] J.-C. Bajard, L.-S. Didier, and P. Kornerup. An RNS Montgomery modular multiplication algorithm. IEEE Transactions on Computers, 47(7):766–776, July 1998. [BEG13] J.-C. Bajard, J. Eynard, and F. Gandino. Fault detection in RNS Montgomery modular multiplication. In Proc. 21th Symposium on Computer Arithmetic (ARITH), pages 119–126. IEEE, April 2013. [BEMP14] J.-C. Bajard, J. Eynard, N. Merkiche, and T. Plantard. Baba¨ ı round-off CVP method in RNS: Application to lattice based cryptographic protocols. In Proc. 14th International Symposium on Integrated Circuits (ISIC), pages 440–443. IEEE, December 2014.
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 24 / 23
[BI04] J.-C. Bajard and L. Imbert. A full RNS implementation of RSA. IEEE Transactions on Computers, 53(6):769–774, June 2004. [BM14] J.-C. Bajard and N. Merkiche. Double level Montgomery Cox-Rower architecture, new bounds. In Proc. 13th Smart Card Research and Advanced Application Conference (CARDIS), LNCS. Springer, November 2014. [BT13]
Improving modular inversion in RNS using the plus-minus method. In Proc. 15th Cryptographic Hardware and Embedded Systems (CHES), volume 8086 of LNCS, pages 233–249. Springer, August 2013. [BT14]
RNS modular multiplication through reduced base extensions. In Proc. 25th IEEE International Conference on Application-specific Systems, Architectures and Processors (ASAP), pages 57–62. IEEE, June 2014.
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 25 / 23
[CDF+11]
Yao. FPGA implementation of pairings using residue number system and lazy reduction. In Proc. 13th Cryptographic Hardware and Embedded Systems (CHES), volume 6917 of LNCS, pages 421–441. Springer, September 2011. [CNPQ03]
Parallel FPGA implementation of RSA with residue number systems - can side-channel threats be avoided? In Proc. 46th Midwest Symposium on Circuits and Systems (MWSCAS), volume 2, pages 806–810. IEEE, December 2003. [DH76]
New directions in cryptography. IEEE Transactions on Information Theory, 22(6):644–654, November 1976. [Elg85]
A public key cryptosystem and a signature scheme based on discrete logarithms. IEEE Transactions on Information Theory, 31(4):469–472, July 1985.
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 26 / 23
[ESJ+13]
Efficient RNS implementation of elliptic curve point multiplication over GF(p). IEEE Transactions on Very Large Scale Integration (VLSI) Systems, 21(8):1545–1549, August 2013. [Gar59]
The residue number system. IRE Transactions on Electronic Computers, EC-8(2):140–147, June 1959. [GLP+12]
An algorithmic and architectural study on Montgomery exponentiation in RNS. IEEE Transactions on Computers, 61(8):1071–1083, August 2012. [Gor98]
A survey of fast exponentiation methods. Journal of algorithms, 27(1):129–146, 1998. [Gui10]
A high speed coprocessor for elliptic curve scalar multiplications over Fp. In Proc. 12th Cryptographic Hardware and Embedded Systems (CHES), volume 6225 of LNCS, pages 48–64. Springer, August 2010.
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 27 / 23
[Gui11]
A coprocessor for secure and high speed modular arithmetic. Technical Report 354, IACR Cryptology ePrint Archive, 2011. [KKSS00]
Cox-Rower architecture for fast parallel Montgomery multiplication. In Proc. 19th International Conference on the Theory and Application of Cryptographic (EUROCRYPT), volume 1807 of LNCS, pages 523–538. Springer, May 2000. [Kob87]
Elliptic curve cryptosystems. Mathematics of computation, 48(177):203–209, 1987. [LP07]
An RNS-enhanced microprocessor implementation of public key cryptography. In Proc. 41th Asilomar Conference on Signals, Systems and Computers, pages 1430–1434. IEEE, November 2007. [LPL09]
Elliptic curve digital signature algorithm over GF(p) on a residue number system enabled microprocessor. In Proc. IEEE Region 10 Conference (TENCON), pages 1–6, January 2009.
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 28 / 23
[Mil85]
Use of elliptic curves in cryptography. In Proc. 5th International Cryptology Conference (CRYPTO), volume 218 of LNCS, pages 417–426. Springer, 1985. [MPS07]
Toward acceleration of RSA using 3D graphics hardware. In Proc. 11th IMA International Conference on Cryptography and Coding, pages 364–383. Springer, December 2007. [NMSK01]
Implementation of RSA algorithm based on RNS Montgomery multiplication. In Proc. 3rd Cryptographic Hardware and Embedded Systems (CHES), volume 2162 of LNCS, pages 364–376. Springer, May 2001. [PITM13]
Electromagnetic analysis on RSA algorithm based on RNS. In Proc. 16th Euromicro Conference on Digital System Design (DSD), pages 345–352. IEEE, September 2013. [PP95]
Modulo reduction in residue number systems. IEEE Transactions on Parallel and Distributed Systems, 6(5):449–454, May 1995.
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 29 / 23
[RSA78]
A method for obtaining digital signatures and public-key cryptosystems. Communications of the ACM, 21(2):120–126, February 1978. [SFM+09]
An RNS implementation of an Fp elliptic curve point multiplier. IEEE Transactions on Circuits and Systems I: Regular Papers, 56(6):1202–1213, June 2009. [SG08]
Exploiting the power of GPUs for asymmetric cryptography. In Proc. 10th International Workshop on Cryptographic Hardware and Embedded Systems (CHES), volume 5154 of LNCS, pages 79–99. Springer, August 2008. [SGXYC14] M. St¨
Zero collision attack and its countermeasures on residue number system multipliers. In 14th International Symposium on Integrated Circuits (ISIC), pages 30–33. IEEE, 2014.
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 30 / 23
[SS14]
Multifunction residue architectures for cryptography. IEEE Transactions on Circuits and Systems I: Regular Papers, 61(4):1156–1169, April 2014. [SV55]
Oper´ atorov´ e obvody (operator circuits in czech). Stroje na Zpracov´ an´ ı Informac´ ı (Information Processing Machines), 3:247–296, 1955. [YFCV12]
Faster pairing coprocessor architecture. In Proc. 5th Pairing-Based Cryptography (Pairing), volume 7708 of LNCS, pages 160–176. Springer, May 2012.
Karim Bigou RNS for Asymmetric Cryptography RAIM 2015: April 7 – 9 31 / 23