Giter Club home page Giter Club logo

subspace_assignment's Introduction

Alex Johnson Subspace Coding Assignment

Prerequisites

Rust and Cargo

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Installation

Clone the repository and build (debug).

git clone https://github.com/aljo242/subspace_assignment.git
cd subspace_assignment
cargo build

Release Build

cargo build --release

Run

This performs a basic run through: Block -> encoding -> cipher text -> decoding -> Block. Results are printed to the command line.

cargo run

Testing

Tests can be found in ./src/lib.rs.

cargo test

Benchmarking

cargo bench

Links

Description

In Subspace, we adapt the underlying modular square root permutation to create a block cipher. This ensures farmers expend some minimum wall-clock time T (and proportional computation) while encoding each piece, while verifiers only have to expend time T/C to decode each piece, where C is a constant speed-up proportional to the size of the Prime used.

Assignment:

Port the underlying square root permutation to Rust using the C implementation as a guide. Please note that you are not being asked to port Sloth or create a block cipher, only the underlying square root permutation.

  1. For a prime size of 256 bits, derive the largest prime and resulting exponent.
  2. For a given input block of 256 bits (akin to the plain text), compute the modular square root (akin to the cipher text).
  3. For a given output block of 256 btis (akin to the cipher text) compute the inverse square root (which would result in the original plain text).
  4. Provide appropriate unit tests and integration tests.
  5. Provide appropriate comments and inline documentation
  6. Provide an appropriate readme with setup and installation instructions.

Bonus

Create benchmarks using criterion for and determine the constant verification speedup for a 256 bit prime.

Plan:

  • Set up project skeleton with criterion benchmarking and unit testing
  • Learn how to use the rug crate to create 256 bit blocks
  • Translate the equivalent functions from the pysloth C implementation.

License

MIT

subspace_assignment's People

Stargazers

Alex Johnson avatar

Watchers

Alex Johnson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.