Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nettle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
5
Merge Requests
5
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Nettle
nettle
Commits
a3888205
Commit
a3888205
authored
Feb 27, 2013
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x86_64 assembly for ecc_192_modp
parent
c8841e69
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
2 deletions
+85
-2
ChangeLog
ChangeLog
+5
-0
ecc-192.c
ecc-192.c
+8
-2
x86_64/ecc-192-modp.asm
x86_64/ecc-192-modp.asm
+72
-0
No files found.
ChangeLog
View file @
a3888205
2013-02-27 Niels Möller <nisse@lysator.liu.se>
* ecc-192.c: Check HAVE_NATIVE_ecc_192_modp, and use native
version if available.
* x86_64/ecc-192-modp.asm: New file.
* configure.ac (OPT_ASM_SOURCES): New substituted variable.
(asm_replace_list, asm_optional_list): New variables. For files in
asm_optional_list, also add them to OPT_ASM_SOURCES and define
...
...
ecc-192.c
View file @
a3888205
...
...
@@ -36,9 +36,15 @@
#include "ecc-192.h"
#if HAVE_NATIVE_ecc_192_modp
#define ecc_192_modp nettle_ecc_192_modp
void
ecc_192_modp
(
const
struct
ecc_curve
*
ecc
,
mp_limb_t
*
rp
);
/* Use that p = 2^{192} - 2^64 - 1, to eliminate 128 bits at a time. */
#if GMP_NUMB_BITS == 32
#
el
if GMP_NUMB_BITS == 32
/* p is 6 limbs, p = B^6 - B^2 - 1 */
static
void
ecc_192_modp
(
const
struct
ecc_curve
*
ecc
UNUSED
,
mp_limb_t
*
rp
)
...
...
@@ -89,7 +95,7 @@ ecc_192_modp (const struct ecc_curve *ecc UNUSED, mp_limb_t *rp)
}
#else
#define ecc_192_modp ecc_gener
o
c_modp
#define ecc_192_modp ecc_gener
i
c_modp
#endif
const
struct
ecc_curve
nettle_secp_192r1
=
...
...
x86_64/ecc-192-modp.asm
0 → 100644
View file @
a3888205
C
nettle
,
low
-
level
cryptographics
library
C
C
Copyright
(
C
)
2013
Niels
M
ö
ller
C
C
The
nettle
library
is
free
software
; you can redistribute it and/or modify
C
it
under
the
terms
of
the
GNU
Lesser
General
Public
License
as
published
by
C
the
Free
Software
Foundation
; either version 2.1 of the License, or (at your
C
option
)
any
later
version.
C
C
The
nettle
library
is
di
stributed
in
the
hope
that
it
will
be
useful
,
but
C
WITHOUT
ANY
WARRANTY
; without even the implied warranty of MERCHANTABILITY
C
or
FITNESS
FOR
A
PARTICULAR
PURPOSE.
See
the
GNU
Lesser
General
Public
C
License
for
more
details.
C
C
You
should
have
received
a
copy
of
the
GNU
Lesser
General
Public
License
C
al
ong
with
the
nettle
library
; see the file COPYING.LIB. If not, write to
C
the
Free
Software
Foundation
,
Inc.
,
51
Franklin
Street
,
Fifth
Floor
,
Boston
,
C
MA
02111
-
1301
,
USA.
.file
"ecc-192-modp.asm"
define
(
<
RP
>
,
<%
rsi
>
)
define
(
<
T1
>
,
<%
rdi
>
)
C
Overlaps
unused
ecc
input
define
(
<
T2
>
,
<%
rcx
>
)
define
(
<
T3
>
,
<%
rdx
>
)
define
(
<
T4
>
,
<%
r8
>
)
define
(
<
T5
>
,
<%
r9
>
)
define
(
<
T6
>
,
<%
r10
>
)
C
ecc_192_modp
(
const
struct
ecc_curve
*
ecc
,
mp_limb_t
*
rp
)
.text
ALIGN
(
4
)
PROLOGUE
(
nettle_ecc_192_modp
)
W64_ENTRY
(
2
,
0
)
C
First
:
(
B
+
1
)
*
{
r5
,
r4
}
<
B
^
3
+
B
^
2
-
B
mov
32
(
RP
),
T1
mov
40
(
RP
),
T2
mov
T2
,
T3
xor
T4
,
T4
add
T1
,
T2
adc
$
0
,
T3
adc
$
0
,
T4
add
8
(
RP
),
T1
adc
16
(
RP
),
T2
adc
24
(
RP
),
T3
adc
$
0
,
T4
C
Sum
is
<
2
B
^
4
+
B
^
3
-
B
-
1
,
so
{
T4
,
T3
}
<
3
B
C
Next
:
(
B
+
1
)
*
{
T4
,
T3
}
<
3
B
^
2
+
2
B
mov
T4
,
T5
add
T3
,
T4
adc
$
0
,
T5
xor
T6
,
T6
add
(
RP
),
T3
adc
T4
,
T1
adc
T5
,
T2
adc
$
0
,
T6
C
Fold
in
final
carry.
add
T6
,
T3
adc
T6
,
T1
adc
$
0
,
T2
mov
T3
,
(
RP
)
mov
T1
,
8
(
RP
)
mov
T2
,
16
(
RP
)
W64_EXIT
(
2
,
0
)
ret
EPILOGUE
(
nettle_ecc_192_modp
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment