Skip to content

Instantly share code, notes, and snippets.

@AntonKueltz
AntonKueltz / fastecdsa_scalar_mul.py
Created May 19, 2020 00:32
fastecdsa scalar multiplication example
"""
In [1]: from fastecdsa.curve import P256
In [2]: k = 0xdecafbad
In [3]: Q = k * P256.G
In [4]: Q
Out[4]:
X: 0x602d9279f2f00327f397a670f5fa85dc46b761ddd7f1615ab1d1be187c8ce9da
class Node:
def __init__(self, data, prev, next):
self.data = data
self.prev = prev
self.next = next
class DoubleLinkedList:
def __init__(self):
self.head = None
class Node:
def __init__(self, key, data):
self.next = None
self.prev = None
self.key = key
self.data = data
class LinkedList:
def __init__(self):
#include <stdlib.h>
#include <vector>
class Bad {
public:
~Bad(){ throw 0; }
};
int main() {
Bad b1, b2;
// timeKeeper.h
class TimeKeeper {
public:
TimeKeeper();
~TimeKeeper(); // note the virtual keyword is missing
};
// wristWatch.h
class WristWatch : public TimeKeeper {
// house.h
class House {
//copying a house doesn't make much sense so disallow use of copy functions
private:
House(const House&); // copy constructor
House& operator=(const House&); // copy assignment
};
// main.cpp
int main(int argc, char * argv[]) {
// empty.h
class Empty {
// this class declares no members but still will implicitly have the
// below declared by the compiler (in the public scope)
/*
Empty(){...} // default constructor
Empty(const Empty& rhs){...} // copy constructor
~Empty(){...} // default destructor
Empty& operator=(const Empty& rhs){...} // copy assignment operator
class Board:
WIDTH = 9
HEIGHT = 9
def __init__(self):
self.squares = [
[5, 3, None, None, 7, None, None, None, None],
[6, None, None, 1, 9, 5, None, None, None],
[None, 9, 8, None, None, None, None, 6, None],
[8, None, None, None, 6, None, None, None, 3],
from random import choice
BOARD_SIZE = 5
class Node:
def __init__(self):
self.value = 0
self.children = {}
from time import sleep
class Cell:
ALIVE = True
DEAD = False
def __init__(self, status):
self.status = status