Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SW_HW_Platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Farnoud Farahmand
SW_HW_Platform
Commits
756b492c
Commit
756b492c
authored
Sep 09, 2019
by
farnoud farahmand
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hardware verified
parent
5a8fa488
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
NTRUEncrypt.c
c_baremetal/NTRUEncrypt.c
+7
-13
No files found.
c_baremetal/NTRUEncrypt.c
View file @
756b492c
...
...
@@ -438,14 +438,12 @@ encrypt_cca(
TxBuffer
[
0
]
=
0x0000000000008800
;
//memcpy(TxBuffer+1, h, 443*2);
for
(
tx_rx_c
=
1
;
tx_rx_c
<
744
;
tx_rx_c
++
)
{
// initialize RxBuffer with 0's
TxBuffer
[
tx_rx_c
]
=
complement
&
h
[
tx_rx_c
-
1
];
TxBuffer
[
tx_rx_c
]
=
complement
&
h
[
744
-
tx_rx_c
-
1
];
}
TxBuffer
[
744
]
=
0x0000000000008200
;
for
(
tx_rx_c
=
745
;
tx_rx_c
<
1239
;
tx_rx_c
++
)
{
// initialize RxBuffer with 0's
TxBuffer
[
tx_rx_c
]
=
complement
&
r_pos
[
tx_rx_c
-
745
];
}
...
...
@@ -466,9 +464,9 @@ encrypt_cca(
xil_printf
(
"
\r\n
Encrypt Mult Execution Time (ENC) = %d
\r\n
"
,
execution_time
);
#endif
for
(
tx_rx_c
=
0
;
tx_rx_c
<
744
;
tx_rx_c
++
)
{
t
[
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
2
];
}
for
(
tx_rx_c
=
0
;
tx_rx_c
<
743
;
tx_rx_c
++
)
{
t
[
742
-
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
2
];
}
}
else
{
#if ROTATION_ON
...
...
@@ -578,13 +576,11 @@ int decrypt_cca(
TxBuffer
[
0
]
=
0x0000000000008400
;
//memcpy(TxBuffer+1, h, 443*2);
for
(
tx_rx_c
=
1
;
tx_rx_c
<
495
;
tx_rx_c
++
)
{
// initialize RxBuffer with 0's
TxBuffer
[
tx_rx_c
]
=
complement
&
F_pos
[
tx_rx_c
-
1
];
}
TxBuffer
[
495
]
=
0x0000000000009100
;
for
(
tx_rx_c
=
496
;
tx_rx_c
<
1239
;
tx_rx_c
++
)
{
// initialize RxBuffer with 0's
TxBuffer
[
tx_rx_c
]
=
complement
&
c
[
tx_rx_c
-
496
];
TxBuffer
[
tx_rx_c
]
=
complement
&
c
[
1239
-
tx_rx_c
-
1
];
}
...
...
@@ -606,7 +602,7 @@ int decrypt_cca(
#endif
for
(
tx_rx_c
=
0
;
tx_rx_c
<
743
;
tx_rx_c
++
)
{
m
[
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
2
];
m
[
742
-
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
2
];
}
}
else
{
#if ROTATION_ON
...
...
@@ -678,7 +674,6 @@ int decrypt_cca(
TxBuffer
[
0
]
=
0x0000000000009200
;
//memcpy(TxBuffer+1, h, 443*2);
for
(
tx_rx_c
=
1
;
tx_rx_c
<
495
;
tx_rx_c
++
)
{
// initialize RxBuffer with 0's
TxBuffer
[
tx_rx_c
]
=
complement
&
r_pos
[
tx_rx_c
-
1
];
}
...
...
@@ -700,7 +695,7 @@ int decrypt_cca(
#endif
for
(
tx_rx_c
=
0
;
tx_rx_c
<
743
;
tx_rx_c
++
)
{
t_rec
[
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
1
];
t_rec
[
742
-
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
1
];
}
}
else
{
#if ROTATION_ON
...
...
@@ -716,7 +711,6 @@ int decrypt_cca(
#if POLY_MUL_EXE
XTmrCtr_Stop
(
&
TMRInst
,
0
);
// Read Timer value
execution_time
=
XTmrCtr_GetValue
(
&
TMRInst
,
0
);
xil_printf
(
"
\r\n
Decrypt Mult Execution Time (DEC2) = %d
\r\n
"
,
execution_time
);
#endif
...
...
Farnoud Farahmand
@ffarahma
mentioned in commit
5d4b98c1
Sep 09, 2019
mentioned in commit
5d4b98c1
mentioned in commit 5d4b98c1c6adc51019e588c85744ed3ba6152c6a
Toggle commit list
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