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
5d4b98c1
Commit
5d4b98c1
authored
Sep 09, 2019
by
farnoud farahmand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Hardware verified"
This reverts commit
756b492c
.
parent
756b492c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
NTRUEncrypt.c
c_baremetal/NTRUEncrypt.c
+13
-7
No files found.
c_baremetal/NTRUEncrypt.c
View file @
5d4b98c1
...
...
@@ -438,12 +438,14 @@ encrypt_cca(
TxBuffer
[
0
]
=
0x0000000000008800
;
//memcpy(TxBuffer+1, h, 443*2);
for
(
tx_rx_c
=
1
;
tx_rx_c
<
744
;
tx_rx_c
++
)
{
TxBuffer
[
tx_rx_c
]
=
complement
&
h
[
744
-
tx_rx_c
-
1
];
// initialize RxBuffer with 0's
TxBuffer
[
tx_rx_c
]
=
complement
&
h
[
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
];
}
...
...
@@ -464,9 +466,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
<
743
;
tx_rx_c
++
)
{
t
[
742
-
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
2
];
}
for
(
tx_rx_c
=
0
;
tx_rx_c
<
744
;
tx_rx_c
++
)
{
t
[
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
2
];
}
}
else
{
#if ROTATION_ON
...
...
@@ -576,11 +578,13 @@ 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
++
)
{
TxBuffer
[
tx_rx_c
]
=
complement
&
c
[
1239
-
tx_rx_c
-
1
];
// initialize RxBuffer with 0's
TxBuffer
[
tx_rx_c
]
=
complement
&
c
[
tx_rx_c
-
496
];
}
...
...
@@ -602,7 +606,7 @@ int decrypt_cca(
#endif
for
(
tx_rx_c
=
0
;
tx_rx_c
<
743
;
tx_rx_c
++
)
{
m
[
742
-
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
2
];
m
[
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
2
];
}
}
else
{
#if ROTATION_ON
...
...
@@ -674,6 +678,7 @@ 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
];
}
...
...
@@ -695,7 +700,7 @@ int decrypt_cca(
#endif
for
(
tx_rx_c
=
0
;
tx_rx_c
<
743
;
tx_rx_c
++
)
{
t_rec
[
742
-
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
1
];
t_rec
[
tx_rx_c
]
=
RxBuffer
[
tx_rx_c
+
1
];
}
}
else
{
#if ROTATION_ON
...
...
@@ -711,6 +716,7 @@ 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
...
...
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