Skip to content

Commit

Permalink
feat(6006): add lab5
Browse files Browse the repository at this point in the history
  • Loading branch information
uldissturms committed Jun 4, 2020
1 parent d607eef commit 3432bb0
Show file tree
Hide file tree
Showing 38 changed files with 4,629 additions and 0 deletions.
Binary file added 6006/ps5/MIT6_006F11_ps5.pdf
Binary file not shown.
Binary file added 6006/ps5/MIT6_006F11_ps5e.pdf
Binary file not shown.
87 changes: 87 additions & 0 deletions 6006/ps5/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
SOLUTION TEMPLATE INSTRUCTIONS

We have prepared templates for you in writeup/ps5_answers.tex and
writeup/ps5e_answers.tex. Please modify them to include all your answers, except
for the Python source code, and then upload the modified files to Stellar.

To fill in the answer to a problem, e.g. Problem 2(c), search the document for
the answer start / end markers, which look like this:
%%% PROBLEM 2(c) ANSWER START %%%
%%% PROBLEM 2(c) ANSWER END %%%

You should then write your answer between the ANSWER START and ANSWER END
marker lines. Do NOT edit the marker lines.

Your homework will be automatically graded, and any changes to the marker lines
or to the surrounding document may cause you to lose points. For additional
peace of mind, we recommend copying the original template to ps2_orig.tex, and
using a diff tool to compare your version to the original.
Linux / MacOS: diff ps2_sol.tex ps2_orig.tex
Windows: fc ps2_sol.tex ps2_orig.tex


MULTIPLE CHOICE QUESTIONS

The answer for multiple choice questions should be the number to the left of
your answer. For example, if Problem 1(a) has the answers:
1. log n
2. n
3. 3n
4. 4n

and you wish to answer "log n" (answer 1), your solution template should look
as follows:
%%% PROBLEM 1(a) ANSWER START %%%
1
%%% PROBLEM 1(a) ANSWER END %%%


TRUE / FALSE QUESTIONS

The answer for True / False questions should be the numbers to the left of
the true answers separated by a space. For example, if Problem 1(b) has the
choices:
1. Roses are red
2. Roses are blue
3. Violets are red
4. Violets are blue

and you wish to answer that choices 1 and 3 are true and choices 2 and 4 are
false, your solution template should look as follows:
%%% PROBLEM 1(b) ANSWER START %%%
1 3
%%% PROBLEM 1(b) ANSWER END %%%


PYTHON IDENTIFIER QUESTION

When answering questions that want the name of a Python variable, method or
class name, write the method name between the answer markers. Don't add any
fancy formatting, such as a \verbatim block.
%%% PROBLEM 2(c) ANSWER START %%%
method_name
%%% PROBLEM 2(c) ANSWER END %%%

You may use \_ instead of _, so that you can compile your solutions without
errors. Our grading tool will recognize the variation below as "method_name".
%%% PROBLEM 2(c) ANSWER START %%%
method\_name
%%% PROBLEM 2(c) ANSWER END %%%


PROOF / PSEUDO-CODE QUESTION

Write your proof or pseudo-code, in LaTeX, between the answer markers. The LaTeX
that you learned for PS 1 and PS 2 should be sufficient for PS 5. If you want to
be fancy and use the CLRS pseudo-code format, read the documentation at

http://www.cs.dartmouth.edu/~thc/clrscode/clrscode3e.pdf


COLLABORATORS

Remember to list the full names of your collaborators, separated by commas,
between the answer markers.
%%% COLLABORATORS START %%%
John Doe, Jane Doe
%%% COLLABORATORS END %%%
45 changes: 45 additions & 0 deletions 6006/ps5/rsa/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
RSA On the Knight's Shield (KT) Chip code for MIT 6.006 Fall 2011 PS5

The code distribution contains the following files:
* rsa.py - main body for the RSA code
* rsa_test.py - tester used for grading
* big_num.py - large number arithmetic
* big_num_test.py - tests showcasing the API in big_num.py
* ks_primitives.py - software emulation for the the KT chip builtins
* ks_primitives_test.py - tests showcasing the API in ks_primitives.py
* image_testgen.rb - testcase generator
* test/*.in - RSA test inputs
* test/*.gold - outputs that we believe to be correct for the RSA test inputs
* visualizer/bin/visualizer.html - visualizes the image decryption output
* visualizer/README.txt - Readme for the visualizer source code
* visualizer/* - visualizer source code


USAGE

image_testgen.rb takes two command-line arguments, the source image and the
length of the public key in bytes (digits in the KS large-number library).

Command-line example:
ruby image_testgen.rb images/smiley.png 4 > tests/1verdict_16.in


DEPENDENCIES

{rsa,big_num,ks_primitives}.py have been tested on Python 2.7, Python 3.2, and
PyPy 1.6.

The test generator was tested in Ruby 1.9.2, and requires OpenSSL support, as
well as the rmagick gem. The following commands will install the dependencies on
Ubuntu 11.10 and above.
sudo apt-get install ruby1.9.1-full build-essential
sudo update-alternatives --set ruby /usr/bin/ruby1.9.1
sudo apt-get install libmagickcore-dev libmagickwand-dev
sudo env REALLY_UPDATE_GEM_SYSTEM=1 gem update --system
sudo gem update --system
sudo gem install rmagick

The lines below will install the dependencies on Ubuntu 11.04 and below.
sudo apt-get install ruby rubygems ruby1.8-full build-essential
sudo apt-get install libmagickcore-dev libmagickwand-dev
sudo gem install rmagick
Loading

0 comments on commit 3432bb0

Please sign in to comment.