Skip to content

Instantly share code, notes, and snippets.

@davidrusu
davidrusu / ring-sigs.org
Created December 29, 2021 04:52
Ring Signature Presentation

Elliptic Curve Cryptography Basics

Lets quickly build up a ECC system so that we are all on the same page.

Elliptic Curve Cryptography Basics: Finate Field

First, define a finate field F_q where q is a large prime.

Operations in F_q are all done modulo q.

@davidrusu
davidrusu / stepper.py
Last active January 11, 2018 16:49
steppers
from random import random
def busy_block(stepper):
res = None
while stepper is not None:
stepper, res = stepper()
print(res)
return res
float angle(vec2 uv) {
float a = atan(uv.y / uv.x);
if (uv.x < 0.) {
a += PI;
}
if (uv.x > 0. && uv.y < 0.) {
a += PI2;
}
return a;
}
#include <stdio.h>
#include <time.h>
#include <ApplicationServices/ApplicationServices.h> /* ApplicationServices.framework needed */
char *logFileName = "./keystroke.log";
FILE *logFile = NULL;
int counter = 0;
struct timespec prev_time;
void setup() {
size(500, 500);
}
void tree(float x, float y, float length, float angle) {
if (length < 2) {
return;
}
float ny = y - length * sin(angle);
float nx = x + length * cos(angle);
import java.awt.event.KeyEvent;
float drag = 0.9;
class Point {
float x, y, vx, vy;
Point(float x, float y) {
this.x = x;
this.y = y;
int count = 1;
void setup() {
size(500, 500);
}
void keyPressed() {
if (keyCode == UP) {
count += 1;
} else if (keyCode == DOWN) {
from random import shuffle
from math import log2, floor
def main():
A = list(range(15))
B = list(range(10))
print("Before:\t A =", A)
print("\t B =", B)
N = len(A)
P = 5 # Number of procs
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize) ;; You might already have this line
(require 'multiple-cursors)
@davidrusu
davidrusu / Dockerfile for nginx
Created August 16, 2015 01:34
docker and docker-compose
FROM tutum/nginx
RUN rm /etc/nginx/sites-enabled/default
ADD sites-enabled/ /etc/nginx/sites-enabled
ADD static/ /www/static
# the directory structure of the nginx component:
# ./nginx
# ├── Dockerfile
# ├── sites-enabled
# │ └── app