Skip to content

Update "a**b" writting to "a^b" in diffie-hellman description #1933

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

Merged
merged 3 commits into from
Jan 29, 2022

Conversation

Gautzilla
Copy link
Contributor

Creation of the diffie-hellman-description-simplifying branch
Rewriting from "a**b" to "a^b" for expressing exponentiation

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request! There seem to be some unrelated files in this PR. Could you remove them from the pull request?


Bob calculates

s = A**b mod p
s = A^b mod p

The calculations produce the same result! Alice and Bob now share
secret s.
Copy link
Member

Choose a reason for hiding this comment

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

I would like to suggest adding a note be added at the end of this document that mentions that in some programming languages ** is used as the method to indicate exponentiations instead of ^.

I think just replacing one form for another doesn't necessarily clear up the confusion for everyone, just shifts it.

Copy link
Contributor

@wolf99 wolf99 Jan 28, 2022

Choose a reason for hiding this comment

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

Might it be better to remove any implementation dependent form and instead use the mathematical form? (i.e. aᵇ).
That is what is being described after all.

Copy link
Member

Choose a reason for hiding this comment

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

Hard agree with @wolf99 comment. For example, in Python, ^ is used as a set operator, which is why ** is used for exponentiation. It varies widely by programming language.

Copy link
Member

Choose a reason for hiding this comment

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

@wolf99 I like your suggestion, however I worry about how the special character will translate for users. If there is no concern to worry about then 👍 from me too.

Copy link
Contributor Author

@Gautzilla Gautzilla Jan 29, 2022

Choose a reason for hiding this comment

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

I feel exactly like @rpottsoh : would aᵇ render properly in any IDE for people downloading the exercise through CLI?

I would like to suggest adding a note be added at the end of this document that mentions that in some programming languages ** is used as the method to indicate exponentiations instead of ^.

The note might just mention that a^b means "a raised to the power of b", or "aaa*...*a" b times", so that the description only uses mathematics and no programming conventions?

Copy link
Contributor

@SaschaMann SaschaMann Jan 29, 2022

Choose a reason for hiding this comment

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

We have other exercises that use them. If an IDE can't display standard characters like that, it's most likely a deliberate choice by the student to use an archaic IDE and make their life hard.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thus, I see no reason not to use this notation. I'll make a new commit.

Copy link
Member

Choose a reason for hiding this comment

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

deliberate choice by the student to use archaic IDE

I use ed (not always) and it displays it, so I wonder if you mean "IDE that sucks" rather than archaic.

Copy link
Member

Choose a reason for hiding this comment

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

Instead of trying to abstract it away:

s = (A to the power of b) mod p

@kotp kotp merged commit 87cd20f into exercism:main Jan 29, 2022
@Gautzilla Gautzilla deleted the diffie-hellman-description-simplifying branch January 29, 2022 16:08
@petertseng
Copy link
Member

Please squash when we have files like .vs that should never be in the history

@kotp
Copy link
Member

kotp commented Jan 31, 2022

I remembered the request that it be removed from the pull request, and since I saw Erik's approval, I did not bother to check (It was not removed from the pull request, only removed as a file). I did not bother to check that it was actually removed from the request.

@SaschaMann
Copy link
Contributor

I'm surprised the repo settings even allow anything but squash-merges (cc @iHiD)

@petertseng
Copy link
Member

petertseng commented Jan 31, 2022

There will be instances where we do not want to squash. So both options should be available. Please do not make squash the only option.

For the non-squash option I prefer merge over rebase, but that ship has sailed apparently.

EBWODP: We should have the discussion of acceptable ways to merge elsewhere, in #1934 . It is not apparently from the title of this pull request that it may contain this discussion.

@kotp
Copy link
Member

kotp commented Jan 31, 2022

Who is EBWODP? I do not know what that means, and there seems to be no indication in this forum what that means.

@ErikSchierboom
Copy link
Member

I remembered the request that it be removed from the pull request, and since I saw Erik's approval, I did not bother to check (It was not removed from the pull request, only removed as a file). I did not bother to check that it was actually removed from the request.

Ehm, but it was 90617be? There is no such thing as checking in a directory in git, a directory only ever exists if it has files in it.

@kotp
Copy link
Member

kotp commented Feb 1, 2022

You are right Erik, the reference to the vs file was carried over from the prior reference to that as a file, rather than the files in the directory.

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.

[Diffie Hellman] Add description that a**b means "a raised to the power of b"?
9 participants