1
C nettle, low-level cryptographics library
3
C Copyright (C) 2013 Niels Möller
5
C The nettle library is free software; you can redistribute it and/or modify
6
C it under the terms of the GNU Lesser General Public License as published by
7
C the Free Software Foundation; either version 2.1 of the License, or (at your
8
C option) any later version.
10
C The nettle library is distributed in the hope that it will be useful, but
11
C WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
C or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13
C License for more details.
15
C You should have received a copy of the GNU Lesser General Public License
16
C along with the nettle library; see the file COPYING.LIB. If not, write to
17
C the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
.file "ecc-224-modp.asm"
23
define(<T0>, <%rdi>) C Overlaps unused ecc input
32
PROLOGUE(nettle_ecc_224_modp)
36
C Set (F2,F1,F0) <-- (H1,H0) << 32
53
sbb $0, H1 C No further borrow
59
C Set (F2,F1,F0) <-- (H2,H1,H0) << 32
60
C To free registers, add in T1, T0 as soon as H0, H1 have been copied
87
C We now have H2, H1, H0, T1, T0, with 33 bits left to reduce
88
C Set F0 <-- (H2, H1) >> 32
89
C Set (F2,F1) <-- (H2, H1 & 0xffffffff00000000)
90
C H1 <-- H1 & 0xffffffff
95
movl XREG(H1), XREG(H1) C Clears high 32 bits
96
sub H1, F1 C Clears low 32 bits
115
EPILOGUE(nettle_ecc_224_modp)