Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
PALISADE
PALISADE Development
Commits
13505087
Commit
13505087
authored
Mar 03, 2020
by
Yuriy Polyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimized NTT
parent
fce47424
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
src/core/lib/math/transfrm.cpp
src/core/lib/math/transfrm.cpp
+9
-10
No files found.
src/core/lib/math/transfrm.cpp
View file @
13505087
...
...
@@ -224,24 +224,25 @@ void NumberTheoreticTransform<VecType>::ForwardTransformToBitReverse(const VecTy
result
->
SetModulus
(
modulus
);
usint
i
,
m
,
j1
,
j2
,
indexOmega
,
indexLo
,
indexHi
;
NativeInteger
preconOmega
;
IntType
omega
,
omegaFactor
,
loVal
,
hiVal
,
zero
(
0
);
for
(
i
=
0
;
i
<
n
;
++
i
)
{
for
(
uint32_t
i
=
0
;
i
<
n
;
++
i
)
{
(
*
result
)[
i
]
=
element
[
i
];
}
uint32_t
indexOmega
,
indexHi
;
NativeInteger
preconOmega
;
IntType
omega
,
omegaFactor
,
loVal
,
hiVal
,
zero
(
0
);
usint
t
=
(
n
>>
1
);
usint
logt1
=
GetMSB64
(
t
);
for
(
m
=
1
;
m
<
n
;
m
<<=
1
)
{
for
(
i
=
0
;
i
<
m
;
++
i
)
{
for
(
uint32_t
m
=
1
;
m
<
n
;
m
<<=
1
,
t
>>=
1
,
--
logt1
)
{
uint32_t
j1
,
j2
;
for
(
uint32_t
i
=
0
;
i
<
m
;
++
i
)
{
j1
=
i
<<
logt1
;
j2
=
j1
+
t
;
indexOmega
=
m
+
i
;
omega
=
rootOfUnityTable
[
indexOmega
];
preconOmega
=
preconRootOfUnityTable
[
indexOmega
];
for
(
indexLo
=
j1
;
indexLo
<
j2
;
++
indexLo
)
{
for
(
uint32_t
indexLo
=
j1
;
indexLo
<
j2
;
++
indexLo
)
{
indexHi
=
indexLo
+
t
;
loVal
=
(
*
result
)[
indexLo
];
omegaFactor
=
(
*
result
)[
indexHi
];
...
...
@@ -265,8 +266,6 @@ void NumberTheoreticTransform<VecType>::ForwardTransformToBitReverse(const VecTy
}
}
}
t
>>=
1
;
logt1
--
;
}
return
;
}
...
...
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