<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Dindayal Mahto, Danish Ali Khan, and
Dilip Kumar Yadav. Security analysis of
elliptic curve cryptography and rsa. In
Proceedings of the World Congress on
Engineering WCE, volume</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Comparison of scalar multiplication algorithms in a low resource device</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Mohamed Ramdani</string-name>
          <email>med.ramdani@yahoo.com</email>
          <email>moumouhr@yahoo.fr med.ramdani@yahoo.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mohamed Benmohammed</string-name>
          <email>ben_moh123@yahoo.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nadjia Benblidia</string-name>
          <email>benblidia@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>LIRE Laboratory</institution>
          ,
          <addr-line>Computer Science, Dept</addr-line>
          ,
          <institution>University of Constantine2</institution>
          ,
          <addr-line>Constantine</addr-line>
          ,
          <country country="DZ">Algeria</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>LRDSI Laboratory</institution>
          ,
          <addr-line>Computer Science, Dept</addr-line>
          ,
          <institution>University of Blida1</institution>
          ,
          <addr-line>Blida</addr-line>
          ,
          <country country="DZ">Algeria</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <volume>1</volume>
      <issue>2016</issue>
      <fpage>01</fpage>
      <lpage>02</lpage>
      <abstract>
        <p>Page 70</p>
      </abstract>
      <kwd-group>
        <kwd>- Elliptic curves cryptography (ECC)</kwd>
        <kwd>Scalar multiplication</kwd>
        <kwd>embedded systems</kwd>
        <kwd>acceleration computations</kwd>
        <kwd>co-Z addition</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Scalar multiplication of a point is the central
operation in the elliptic curves cryptography
(ECC). It’s a complex operation that requires
a lot of optimization especially on execution
times to reduce resource consumption in
systems with low computing power and memory
such as embedded systems. Several works on
the acceleration of computation and many
others on the reduction of the complexity of
mathematical methods used in the computations on
the elliptic curves have been realized. Many
algorithms for computing scalar multiplication
are proposed, each using their own calculation
technique and mathematical methods. In this
paper, we combine the techniques of
accelerated computations with optimized
mathematical methods and we implement them on
algorithms for scalar multiplication of a point.
This work aims to distinguish the most efficient
computation algorithm with the best
acceleration technique. The results show that the Joye
algorithm combined with the co-Z
DoublingAddition acceleration technique gives better
results and saves more than one second of
computation time compared to the other algorithms
implemented in this paper.
Copyright c by the paper’s authors. Copying permitted only for
private and academic purposes.</p>
      <p>In: Proceedings of the 3rd Edition of the International Conference on
Advanced Aspects of Software Engineering (ICAASE18),
Constantine, Algeria, 1,2-December-2018, published at http://ceur-ws.org
1</p>
    </sec>
    <sec id="sec-2">
      <title>Introduction</title>
      <p>Cryptography has emerged as a reliable and
powerful solution for maintaining data confidentiality. To
make information eligible, cryptographic mechanisms
use complex mathematical methods that often involve
intensive computations. This intensity is often a
problem for low-resource systems like embedded systems.</p>
      <p>There are two ways to encrypt a message;
symmetric method (Secret Key Cryptography SKC) based on
shared private keys, and asymmetric method
(PublicKey Cryptography PKC) based on a couple of public
and private keys. The advantage of the latter is that all
exchanges are public and its security is based on the
difficulty of finding the secret from information exchanged
publicly.</p>
      <p>One of the most recently used asymmetric
cryptosystems is Elliptic Curve Cryptography (ECC). ECC uses
short keys for equal security to other asymmetric
cryptosystems [MKY16]. It is recommended for systems
in which electronic devices have low computing power
and very limited memory such as embedded systems.</p>
      <p>However, despite recent optimizations on ECC,
essentially the reduction of computational complexity, this
cryptosystem remains complex and requires further
optimization.</p>
      <p>The important and costly operation in Elliptic Curve
Cryptography for encryption, decryption, digital
signature, key exchange, etc is scalar multiplication of a
point. This is a complex operation that requires more
optimizations for the acceleration of cryptographic
computations. The execution time of any ECC operation
depends on the execution time of the scalar multiplication.</p>
      <p>An embedded system is an autonomous system,
generally dedicated to specific tasks, having a limited size
and low resources. There are two important constraints
of an embedded system: optimized computing power
while respecting the temporal and spatial constraints,
and an essential security to ensure data confidentiality
especially for sensitive applications. The system used The standard algorithm called Dbl-and-add [Knu97]
in this work is an Arduino card very limited in memory for calculating scalar multiplication of a point is given
resources and computing power. It is an open source by algorithm 1.
system, open hardware and open source bootloader.</p>
      <p>In this paper, we present an implementation of scalar
multiplication algorithms on a low-resource system to
compare and derive the most optimized computation
method for such systems. We define the scalar
multiplication of a point and present some algorithms of its
computation, in section 2. Section 3 is dedicated to
acceleration techniques of cryptographic computations on
a scalar multiplication and to the system of coordinates
used. In Section 4, we present the software
implementation of acceleration techniques in scalar multiplication
algorithms and present the comparison results in Section
5.</p>
      <p>Algorithm 1 Standard Dbl-and-add algorithm
Require: k = (kd 1,..., k1, k0)2, P 2 E(Fp)
Ensure: Q = k P</p>
      <p>R0 = 0/
R1 = P
for i 1 to d-1 do
if ki = 1 then</p>
      <p>R0 R0 + R1
end if</p>
      <p>R1 2 R1
end for
return R0;</p>
      <p>This algorithm has a huge disadvantage for the
security of the private key used because it is very
vulnerable to attacks SPA [MS00] and DPA [KJJ99].
Indeed, by analyzing either the energy consumed or
the number of clock cycles performed per operation,
an attacker can reconstruct the private key. This
fault is corrected by several works [Mon87][Joy07]
[LS01][DSF16][FGDM+10], we choose here to work
on the algorithms of Mongomery ladder [Mon87] and
(1) the algorithm of Joye Dbl-and-add [Joy07] (see
algo</p>
      <p>rithms 2 and 3).
(2)
(3)
(4)</p>
      <p>Algorithm 2 Montgomery ladder algorithm
Require: k = (kd 1,..., k1, k0)2, P 2 E(Fp)
Ensure: Q = k P</p>
      <p>R0 = 0/
R1 = P
for i d-1 downto 0 do
b ki
R1 b</p>
      <p>Rb 2
end for
return R0;</p>
      <p>R1 b + Rb</p>
      <p>Rb
Algorithm 3 Joye Dbl-and-add algorithm
Require: k = (kd 1,..., k1, k0)2, P 2 E(Fp)
Ensure: Q = k P</p>
      <p>R0 = 0/
R1 = P
for i 0 to d-1 do
b ki</p>
      <p>R1 b + Rb</p>
      <p>R1 b
end for
return R0;
2
2</p>
    </sec>
    <sec id="sec-3">
      <title>Scalar multiplication</title>
      <p>The basic operation performed in protocols based on
Elliptic Curve Cryptography is the scalar multiplication of
a point on the curve. Each scalar multiplication requires
several thousand operations in a finite field. Let k be a
scalar of n bits, P and Q two points of an elliptic curve
defined on a finite field F by the Weierstrass equation
[Gui13][BJ02]:</p>
      <p>E : Y 2 + a1XY + a3 = X 3 + a2X 2 + a4X + a6
where a1, a2, a3, a4 2 F. In this work, we consider the
finite prime fields Fp. Equation (1) then becomes:</p>
      <p>E : Y 2 = X 3 + aX + b
where a, b 2 Fp. The multiplication of the scalar k by
the point P of the curve is another point Q s.t Q = k P
= P + P + . . . + P (k times).</p>
      <p>Two operations are necessary to perform a scalar
multiplication: the point doubling P + P = 2P = P’ and the
point addition P + P’. The computations of doubling and
addition are given by formulas (3) and (4) below. Let P
(X1, Y1) and Q (X2, Y2) be two points of the elliptic curve
s.t P, Q 2 E (Fp) and P 6= Q : P + P = 2P = (X3, Y3) is
computed as follows:</p>
      <p>Y3 =</p>
      <p>X3 =
3X12 + a
2Y1
3X12 + a
2Y1
2
(X1
2</p>
      <p>2X1</p>
      <p>X3) Y1
Y4 =</p>
      <p>X4 =</p>
      <p>Y2
X2</p>
      <p>Y2
X2
Y1
X1</p>
      <p>Y1
X1
2
2</p>
      <p>X1</p>
      <p>X2
(X1</p>
      <p>X4) Y1
and P + Q = (X4, Y4) is the result of an addition of the
two points P and Q is computed as follows:
Page 71
The complexity of the computations in scalar
multiplication of a point and the large number of point doubling
and point addition calculated to perform this operation
required a lot of optimization works reduce
computations. In this section, we present some algorithms that
allow computation accelerations in a scalar
multiplication, but before that, we will focus first on the choice of
coordinate systems used.</p>
      <p>In the Affine coordinate system, the addition and
doubling formulas involve point inversion operations in Fp
which is considered very expensive on the finite fields.
In order to avoid the inversion of points [KS17], we
chose to work on the Jacobian coordinates where a point
of the curve is represented by three coordinates (X : Y :
Z) which corresponds to the Affine point ( ZX2 ; ZY3 ).
Equation (2) then becomes:</p>
      <p>E : Y 2 = X 3 + aX Z4 + bZ6
(5)
The computation of the doubling P + P = 2P = (X3 : Y3
: Z3) and the addition P + Q = (X3 : Y3 : Z3) is given by
the table 1.</p>
      <p>An additional optimization of the addition, called
coZ addition, has been proposed by Meloni [Mel07] where
he considers that two entry points share the same Z
coordinate. Let P = (X1 : Y1 : Z) and Q = (X2 : Y2 : Z), the
addition co-Z of P and Q (with P 6= Q) is defined by P +
Q = (X3 : Y3 : Z3) so that :</p>
      <p>Y3 = (Y2</p>
      <p>X3 = D</p>
      <p>Y1)(B
(B + C)</p>
      <p>X3) E
Z3 = Z(X2</p>
      <p>X1)
(6)
where A = (X2 X1)2, B = X1A, C = X2A, D = (Y2 Y1)2
and E = Y1(C-B)</p>
      <p>In [Riv11], several algorithms are proposed to
perform a scalar multiplication of a point in Jacobian
coordinates with Standard Jacobian Formulae and co-Z
addition Jacobian Formulae. In Standard Jacobian
Formulae, a point doubling 2P is performed by the Jacobian
Doubling algorithm, a P + Q point addition by Jacobian
Addition and a Doubling-Addition operation (DA) 2P
+ Q by the Mixed Jacobian Affine algorithm. This last
algorithm uses mixed coordinates; a point in Jacobian
coordinates and another point in Affine coordinates. In
co-Z Jacobian Formulae, a point doubling is computed
by the Initial Doubling algorithm (XYcZ-IDBL), an
addition by (X;Y)-only co-Z addition (XYcZ-ADD) and
a DA by (X;Y)-only co-Z Doubling-Addition
(XYcZDA).
4</p>
    </sec>
    <sec id="sec-4">
      <title>Software implementation</title>
      <p>The various techniques of computational acceleration
for point doubling and addition are implemented on
the different scalar multiplication algorithms presented
above in order to compare the performance of each
algorithm with each technique. The algorithms obtained
and used as support for our comparisons are presented
in the following:</p>
      <p>Standard Dbl-and-add with Jacobian doubling and
Jacobian addition (see algorithm 4)
Standard Dbl-and-add with co-Z Initial doubling
and co-Z addition (see algorithm 5)
Montgomery ladder with Jacobian doubling and
Jacobian addition (see algorithm 6)
Montgomery ladder with co-Z Initial doubling and
co-Z addition (see algorithm 7)
Joye Dbl-and-add with Mixed Jacobian Affine
Doubling-Addition (DA) (see algorithm 8)
Joye Dbl-and-add with co-Z Doubling-Addition
(DA) (see algorithm 9)
Algorithm 4 Standard Dbl-and-add with Jacobian
doubling and Jacobian addition
Require: k = (kd 1,..., k1, k0)2, P 2 E(Fp)
Ensure: Q = k P</p>
      <p>R0 = 0/
R1 = P
for i 1 to d-1 do
if ki = 1 then</p>
      <p>(R0) Jacobian_addition(R0,R1)
end if
(R1) Jacobian_doubling(R1)
end for
return R0;
Page 72
Algorithm 5 Standard Dbl-and-add with co-Z Initial
doubling and co-Z addition
Require: k = (kd 1,..., k1, k0)2, P 2 E(Fp)
Ensure: Q = k P</p>
      <p>R0 = 0/
R1 = P
for i 1 to d-1 do
if ki = 1 then</p>
      <p>(R1,R0) XYcZ-ADD(R0,R1)
end if
(R0,R1) XYcZ-IDBL(R0)
end for
return R0;
Algorithm 9 Joye Dbl-and-add with Mixed Jacobian
Affine DA
Require: k = (kd 1,..., k1, k0)2, P 2 E(Fp)
Ensure: Q = k P</p>
      <p>R0 = 0/
R1 = P
for i 0 to d-1 do
b ki
(R1 b,Rb) XYcZ-DA(R1 b,Rb)
end for
return R0;
5</p>
    </sec>
    <sec id="sec-5">
      <title>Results and comparison</title>
      <p>Page 73
notice that the algorithm 9 gives very interesting results
with a reduced execution time of 428 ms compared to
the algorithm 7 for a 192-bit key and 1102 ms for a
256bit key.</p>
      <p>the graph below (see figure 1) gives a global
comparison of all implemented algorithms.
In this work, we compared the different computational
acceleration techniques for scalar multiplication by a
point on an embedded system in order to compare them
and to distinguish the best method of computing a scalar
multiplication in a low-resource system. The hardware
used is an Arduino embedded system with a
microcontroller limited in resources including memory and
computing power. We used Jacobian coordinate system with
Standard Jacobian Formulae and co-Z Jacobian
Formulae, an improved version of the addition called co-Z
addition, since this type of coordinates provides less
complex and more efficient computation operations. We
Page 74
have implemented acceleration techniques on three al- [KS17]
gorithms widely used in practice: the standard
Dbl-andadd algorithm, the Montgomery ladder algorithm and
the Joye Dbl-and-add algorithm. We found that the Joye
Dbl-and-add algorithm widh co-Z Doubling-Addition
gives better results if we take into account the level of
security offered, unlike the standard algorithm
Dbl-andadd which offers a better time but it is very vulnerable [LS01]
to SPA and DPA attacks. The time saved for a 256-bit
key is more than one second (1102 ms) for scalar
multiplication using the Joye Dbl-and-add algorithm coupled
with the technique co-Z Doubling-Addition compared
to other algorithms implemented in this work.
[Mel07]
[Gui13]</p>
      <p>Aurore Guillevic. Arithmetic of pairings
on algebraic curves for cryptography.</p>
      <p>PhD thesis, Ecole Normale Supérieure de
Paris-ENS Paris, 2013.</p>
      <p>Marc Joye. Highly regular right-to-left
algorithms for scalar multiplication. In
International Workshop on Cryptographic
Hardware and Embedded Systems, pages
135–147. Springer, 2007.
[BJ02]
[DSF16]</p>
      <p>Eric Brier and Marc Joye. Weierstraß
elliptic curves and side-channel attacks.</p>
      <p>In International Workshop on Public Key
Cryptography, pages 335–345. Springer,
2002.
[MKY16]
Giovanni Di Sirio and Giovanni Fontana.</p>
      <p>Method for protecting a cryptographic
device against spa, dpa and time attacks, [Mon87]
August 30 2016. US Patent 9,430,188.</p>
      <p>K Keerthi and B Surendiran. Elliptic
curve cryptography for secured text
encryption. In Circuit, Power and
Computing Technologies (ICCPCT), 2017
International Conference on, pages 1–5. IEEE,
2017.</p>
      <p>Peter L Montgomery. Speeding the
pollard and elliptic curve methods of
factorization. Mathematics of computation,
48(177):243–264, 1987.</p>
      <p>Rita Mayer-Sommer. Smartly analyzing
the simplicity and the power of simple
power analysis on smartcards. In
International Workshop on Cryptographic
Hardware and Embedded Systems, pages 78–
92. Springer, 2000.</p>
      <p>Matthieu Rivain. Fast and regular
algorithms for scalar multiplication over
elliptic curves. IACR Cryptology ePrint
Archive, 2011:338, 2011.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [FGDM+10]
          <string-name>
            <surname>Junfeng</surname>
            <given-names>Fan</given-names>
          </string-name>
          , Xu Guo, Elke De Mulder, Patrick Schaumont, Bart Preneel, and
          <string-name>
            <given-names>Ingrid</given-names>
            <surname>Verbauwhede</surname>
          </string-name>
          .
          <article-title>State-of-the-art of se- [MS00] cure ecc implementations: a survey on known side-channel attacks and countermeasures</article-title>
          .
          <source>In Hardware-Oriented Security and Trust (HOST)</source>
          ,
          <source>2010 IEEE International Symposium on</source>
          , pages
          <fpage>76</fpage>
          -
          <lpage>87</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>P-Y Liardet and Nigel P Smart.</surname>
          </string-name>
          <article-title>Preventing spa/dpa in ecc systems using the jacobi form</article-title>
          .
          <source>In International Workshop on Cryptographic Hardware and Embedded Systems</source>
          , pages
          <fpage>391</fpage>
          -
          <lpage>401</lpage>
          . Springer,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>