Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

David Wong mimoo

🎯
Focusing
Block or report user

Report or block mimoo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View randomness.md
@mimoo
mimoo / bls.md
Last active Aug 17, 2019
BLS signatures
View bls.md

BLS signatures

Cheatsheet

signature scheme:

  • key_gen: public_key = generator^priv
  • sign: signature = H(m)^priv
  • verify: pairing(signature, generator) = pairing(H(m), public_key)
View signatures.md

Signatures

Use

  • a digital signature provides integrity, authentication and non-repudiation.
  • if trust is transitive, digital signatures can be used to build public key infrastructures (PKI). PKI allow trust to be reduced to a smaller set of keys.

Timeline

  • 1977 - RSA encryption and signature algorithm is published.
@mimoo
mimoo / restaurants.md
Last active Jul 5, 2019
San Francisco
View restaurants.md

Chinese

  • ChongQingXiaoMian. Order all of this: beef in picked mustard green noodles soup, wonton with spicy oil, lamb skewer, braised beef with rice

  • Spicy King. Pretty much like ChongQingXiaoMian (same menu I think)

  • The House of Pancake. Get a bit of everything (pancake, skewers, noodles, etc.)

  • Mr Szechuan. Get food, and get their dark sugar iced milk drink with boba and egg pudding.

  • Z&Y. Solid sichuan food for big groups.

  • Dumpling Time. (fusion)

View BFTree.py
# Receive the candidate block info from the block producer
block_info_candidate = receive_from_block_producer()
(block_hash, prior_block_depth, proposed_current_block_depth) = block_info_candidate
# Verify the block info candidate using HotStuff and chain rules.
if verify_block(block_info_candidate, ...):
block_info = block_info_candidate
else:
block_info = (None, current_block_depth)
@mimoo
mimoo / todo.md
Created Jun 3, 2019
San Francisco
View todo.md

San Francisco

Restaurants

Chinese

  • the pancake house
  • Z & Y
  • chongqingxiaomian
  • dumpling time
@mimoo
mimoo / ECC.md
Last active Jun 3, 2019
Elliptic Curve Cryptography
View ECC.md

Elliptic Curve Cryptography (ECC)

Abstract

ECC is about a group created via:

  • a 2-dimension elliptic curve: an equation with unknowns x and y
    • every Elliptic Curve follows this formula: y2 + a1 x y + a3 y = x3 + a2 x2 + a4 x + a6 (for some specified a1, a2, a3, a4, a6)
    • actually, it can be shorten to this y2 = x3 + a x + b (short weierstrass form) in practice because the characteristic (order of a prime field) 2 and 3 points in prime fields (except for binary (GF(2x)) and GF(3x) curves)
    • a curve of characteristic 2 (defined over GF(2x)) can be simplified to y2 + xy = x3 + ax2 + b
@mimoo
mimoo / MAC.md
Last active May 8, 2019
history of mac
View MAC.md

Message Authentication Codes

  • why is it called MAC?

MACs seems to be used for:

  • authentication and integrity
  • randomness, if used as a PRF (not all MACs are PRFs, HMAC is)
  • key derivation, if used as a PRF in a KDF (HKDF)
@mimoo
mimoo / post_quantum_crypto.md
Last active Apr 3, 2019
Quantum Computers and Cryptography
View post_quantum_crypto.md

I estimate the chance of a practical ECC-breaking quantum computer to be low, e.g. 2^(-10)

Dan Brown

I do not view the threat as particular urgent (i.e. 10+ years away, if ever)

Tony Arcieri

@mimoo
mimoo / disk_encryption.md
Last active Mar 9, 2019
Disk Encryption: Tweakable Wide-block ciphers
View disk_encryption.md

Introduction

This is useful for disk encryption. We need:

  • wide blocks, because we can't store an authentication tag
  • tweakable, because we can't store a nonce

But why can't we transform the metadata into a nonce? Maybe that's what tweak is (or can be).

It looks like:

You can’t perform that action at this time.