Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement RSA benchmark-test #191

Merged
merged 1 commit into from
Nov 15, 2023
Merged

Implement RSA benchmark-test #191

merged 1 commit into from
Nov 15, 2023

Conversation

GorogPeter
Copy link
Contributor

In my code, I used commented asserts to specify the inputs. In my humble opinion, it (e.g. // assert(prime1 > 255);) looks better than a text one (e.g. // prime1 has to be greater than 255). Is it okay, or should I change it?

Moreover, in some cases, I preferred to use if and while statements that contain a short, single and simple instruction, without brackets. For me, it looks more readable and more straightforward than with them. Is it okay, or should I change it?

For example, this:

if (e == 0) return 1;
x = x % m;
if (e == 1) return x;
if (x <= 1) return x;

instead of this:

if (e == 0) {
    return 1;
}
x = x % m;
if (e == 1) {
    return x;
}
if (x <= 1) {
    return x;
}

Copy link
Collaborator

@ksh8281 ksh8281 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
IMO style with benchmark is not important for us!

Copy link
Collaborator

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


uint64_t squareRoot(uint64_t number) {
uint64_t root = 0;
while (square(root + 1) <= number) root++;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This style is unusal, we should follow more common style.

@ksh8281 ksh8281 merged commit ed6d35d into Samsung:main Nov 15, 2023
@GorogPeter GorogPeter deleted the RSA branch November 16, 2023 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants