Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rsa-intel-fpga
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Julia Chomicka
rsa-intel-fpga
Commits
1572f1f8
Commit
1572f1f8
authored
10 months ago
by
Julia Chomicka
Browse files
Options
Downloads
Patches
Plain Diff
rename parameters in C implementation
parent
22a343e4
Branches
rsa-implementation-c
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rsa-c/rsa-c/rsa.c
+4
-4
4 additions, 4 deletions
rsa-c/rsa-c/rsa.c
with
4 additions
and
4 deletions
rsa-c/rsa-c/rsa.c
+
4
−
4
View file @
1572f1f8
...
...
@@ -19,9 +19,9 @@ int gcd(int a, int b) {
/*function that searches for d using inverted modulo*/
int
inverse_Modulo
(
int
e
,
int
n
)
{
int
inverse_Modulo
(
int
e
,
int
p_1_q_1
)
{
int
d
=
1
;
while
((
e
*
d
)
%
n
!=
1
)
while
((
e
*
d
)
%
p_1_q_1
!=
1
)
d
++
;
return
d
;
}
...
...
@@ -29,12 +29,12 @@ int inverse_Modulo(int e, int n) {
/* message encryption/decryption: modular exponentiation,
calculating x^e mod n by repeatedly multiplying x and taking the result modulo n*/
int
mod_Exp
(
int
x
,
int
e
,
int
p_1_q_1
)
{
int
mod_Exp
(
int
x
,
int
e
,
int
n
)
{
int
c
=
1
;
int
e_prim
=
0
;
while
(
e_prim
<
e
)
{
e_prim
++
;
c
=
(
x
*
c
)
%
p_1_q_1
;
c
=
(
x
*
c
)
%
n
;
}
return
c
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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