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
Container Registry
Model registry
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
Dmitry Baryshkov
nettle
Commits
ff3ef3d5
Commit
ff3ef3d5
authored
22 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
* x86/machine.m4 (AES_ROUND): New macro.
Rev: src/nettle/x86/machine.m4:1.5
parent
c90b962b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
x86/machine.m4
+37
-16
37 additions, 16 deletions
x86/machine.m4
with
37 additions
and
16 deletions
x86/machine.m4
+
37
−
16
View file @
ff3ef3d5
dnl AES_LAST_ROUND(a, b, c, d)
dnl Leaves result in %edi
dnl Note that we have to quote $ in constants.
define(<AES_LAST_ROUND>, <
movl %e<>$1<>x,%edi
andl <$>0x000000ff,%edi
movl %e<>$2<>x,%ebp
andl <$>0x0000ff00,%ebp
orl %ebp,%edi
movl %e<>$3<>x,%ebp
andl <$>0x00ff0000,%ebp
orl %ebp,%edi
movl %e<>$4<>x,%ebp
andl <$>0xff000000,%ebp
orl %ebp,%edi>)dnl
dnl AES_LOAD(key, src)
dnl AES_LOAD(key, src)
dnl Loads the next block of data from src, and add the subkey pointed
dnl Loads the next block of data from src, and add the subkey pointed
dnl to by key.
dnl to by key.
...
@@ -45,3 +29,40 @@ define(<AES_STORE>, <
...
@@ -45,3 +29,40 @@ define(<AES_STORE>, <
movl %ebx,4($2)
movl %ebx,4($2)
movl %ecx,8($2)
movl %ecx,8($2)
movl %edx,12($2)>)dnl
movl %edx,12($2)>)dnl
dnl AES_ROUND(table,a,b,c,d)
dnl Computes one word of the AES round. Leaves result in %edi.
define(<AES_ROUND>, <
movl %e<>$2<>x, %esi
andl <$>0xff, %esi
shll <$>2,%esi C index in table
movl AES_TABLE0 + $1 (%esi),%edi
movl %e<>$3<>x, %esi
shrl <$>6,%esi
andl <$>0x000003fc,%esi C clear all but offset bytes
xorl AES_TABLE1 + $1 (%esi),%edi
movl %e<>$4<>x,%esi C third one
shrl <$>14,%esi
andl <$>0x000003fc,%esi
xorl AES_TABLE2 + $1 (%esi),%edi
movl %e<>$5<>x,%esi C fourth one
shrl <$>22,%esi
andl <$>0x000003fc,%esi
xorl AES_TABLE3 + $1 (%esi),%edi>)dnl
dnl AES_LAST_ROUND(a, b, c, d)
dnl Computes one word of the final round. Leaves result in %edi.
dnl Note that we have to quote $ in constants.
define(<AES_LAST_ROUND>, <
movl %e<>$1<>x,%edi
andl <$>0x000000ff,%edi
movl %e<>$2<>x,%ebp
andl <$>0x0000ff00,%ebp
orl %ebp,%edi
movl %e<>$3<>x,%ebp
andl <$>0x00ff0000,%ebp
orl %ebp,%edi
movl %e<>$4<>x,%ebp
andl <$>0xff000000,%ebp
orl %ebp,%edi>)dnl
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