Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nettle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Norbert Pócs
nettle
Commits
58fd6577
Commit
58fd6577
authored
1 year ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
x86_64: Fix alignment bug in _nettle_ghash_update.
parent
966da449
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ChangeLog
+7
-0
7 additions, 0 deletions
ChangeLog
x86_64/ghash-update.asm
+16
-6
16 additions, 6 deletions
x86_64/ghash-update.asm
with
23 additions
and
6 deletions
ChangeLog
+
7
−
0
View file @
58fd6577
2023-05-16 Niels Möller <nisse@lysator.liu.se>
* x86_64/ghash-update.asm: Use separate unaligned load
instructions (movups) to load the tabulated values, since they are
only 8-byte aligned and pand memory operands require 16-byte
alignment.
2023-05-15 Niels Möller <nisse@lysator.liu.se>
* eccdata.c (output_bignum_redc): Add missing mpz_clear, reported
...
...
This diff is collapsed.
Click to expand it.
x86_64/ghash-update.asm
+
16
−
6
View file @
58fd6577
...
...
@@ -44,6 +44,8 @@ define(`M0', `%xmm2')
define
(
`M1', `
%
xmm3
'
)
define
(
`M2', `
%
xmm4
'
)
define
(
`M3', `
%
xmm5
'
)
define
(
`T0', `
%
xmm6
'
)
define
(
`T1', `
%
xmm7
'
)
.file
"ghash-update.asm"
...
...
@@ -54,7 +56,7 @@ define(`M3', `%xmm5')
.text
ALIGN
(
16
)
PROLOGUE
(
_nettle_ghash_update
)
W64_ENTRY
(
4
,
6
)
W64_ENTRY
(
4
,
8
)
sub
$
1
,
BL
OCKS
movups
(
XP
),
X
jc
.Ldone
...
...
@@ -77,10 +79,18 @@ ALIGN(16)
pshufd
$
0xaa
,
M3
,
M2
pshufd
$
0xff
,
M3
,
M3
pslld
$
1
,
X
pand
(
KEY
,
CNT
),
M0
pand
(
KEY32
,
CNT
),
M1
pand
16
(
KEY
,
CNT
),
M2
pand
16
(
KEY32
,
CNT
),
M3
C
Tabulated
values
are
only
8
-
byte
al
igned
,
and
therefore
C
can
'
t
be
used
as
memory
operands
to
pand.
It
would
be
nice
C
if
we
could
force
16
-
byte
al
ignment
on
nettle_block16
,
using
C
C11
al
ignas.
movups
(
KEY
,
CNT
),
T0
movups
(
KEY32
,
CNT
),
T1
pand
T0
,
M0
pand
T1
,
M1
movups
16
(
KEY
,
CNT
),
T0
movups
16
(
KEY32
,
CNT
),
T1
pand
T0
,
M2
pand
T1
,
M3
pxor
M0
,
M1
pxor
M2
,
M3
pxor
M1
,
R
...
...
@@ -98,6 +108,6 @@ ALIGN(16)
.Ldone:
movups
X
,
(
XP
)
mov
SRC
,
%
rax
W64_EXIT
(
4
,
6
)
W64_EXIT
(
4
,
8
)
ret
EPILOGUE
(
_nettle_ghash_update
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment