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

Lab 6: 6a, 6b, 7 #22

Open
BertLisser opened this issue Oct 18, 2017 · 3 comments
Open

Lab 6: 6a, 6b, 7 #22

BertLisser opened this issue Oct 18, 2017 · 3 comments

Comments

@BertLisser
Copy link

BertLisser commented Oct 18, 2017

6a

main66 = do
  print "MR with k = 1";
  testMR 1 1;
  print "MR with k = 2";
  testMR 1 2;
  print "MR with k = 3"; 
  testMR 1 3;
  print "MR with k = 4"; 
  testMR 1 4;

Why not

main66 = do
  print "MR with k = 1";
  testMR 100 1;
  print "MR with k = 2";
  testMR 100 2;
  print "MR with k = 3"; 
  testMR 100 3;
  print "MR with k = 4"; 
  testMR 100 4;

like in main65. Incomplete report.

6a(=4)

6b

The same remark as in 6a.

6b(=4)

main68 = do
    let msg = 12234 -- base 5 digits
    (m, n) <- genPair
    let publicKey  = rsaPublic m n
    let privateKey = rsaPrivate m n
    let encodeMsg  = rsaEncode publicKey msg -- encode original message
    let decodeMsg  = rsaDecode privateKey encodeMsg -- decode encoded message
    print (show msg ++ " " ++ show encodeMsg ++ " " ++ show decodeMsg)

{- 
*Lab6_8> main68
"15122 23950 15122"

I expect

*Lab6_8> main68
"12234 ????? 12234"

7(=4)

@rashadaoud
Copy link
Contributor

rashadaoud commented Oct 18, 2017

Hello Bert,

Thanks for the feedback.

For exercise 6, you're right. We stated at the bottom in comments section, the tester can increase n up to what number s/he like and re-execute main function, if s/he is willing to wait for the results. We thought there will be no point of repeating the reporting in the comments section for n = 2, 3, ... up to 100. The algorithm was not fooled with multiple n values. Hopefully that answers your question on why not executing on a bigger n.

for ex.8 (you wrote 7 probably what you meant is 8), yes that is totally correct. We were testing on many messages and then we fixed one in the main. Apparently at the end we forgot to update the reporting in the comments section, before we commit to github. If msg is set to 15122 in main, the report will be the one shown in the comments section.

@BertLisser
Copy link
Author

After this update:
7 (<-8)

@rashadaoud
Copy link
Contributor

Thanks for following up on this..

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

No branches or pull requests

2 participants