Skip to content

Instantly share code, notes, and snippets.

View mratsim's full-sized avatar
:shipit:

Mamy Ratsimbazafy mratsim

:shipit:
  • Paris
View GitHub Profile
@mratsim
mratsim / PairingLibs.md
Created February 23, 2020 12:57 — forked from artjomb/PairingLibs.md
List of Pairing Libraries

Pairings can be used for all kinds of advanced cryptographic schemes such as Encryption (Identity-based, Attribute-based, Predicate-based, etc.), Signatures, Zero-Knowledge Proofs, etc. It is in no particular order.

Provides multiple types of Elliptic Curve groups with appropriate pairings on top of them. Code repository resides here.

License: LGPL
Language: C
Thesis: On the Implementation of Pairing-Based Cryptography by Ben Lynn (2007)

from py_ecc import bls
privkey = int('0x47b8192d77bf871b62e87859d653922725724a5c031afeabc60bcef5ff665138', 16)
message = bytes.fromhex('0000000000000000000000000000000000000000000000000000000000000000')
sig = bls.G2ProofOfPossession.Sign(privkey, message)
print(f'message: 0x{sig.hex()}')
# Constantine
# Copyright (c) 2018-2019 Status Research & Development GmbH
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
# ############################################################
#
@mratsim
mratsim / 2020-02-06-Eth2-impl-call-33.txt
Created February 6, 2020 14:53
2020-02-06-Eth2-impl-call-33
Nimbus
- Team in Brussels
- Running nimbus on 5 phones
impressive reception by the community:
https://twitter.com/m_ratsim/status/1224769743892230151
- Now using monthly sprint
- Milestones public: https://github.com/status-im/nim-beacon-chain/milestones
@mratsim
mratsim / 2020-01-23-Eth2-impl-call-32.txt
Created January 23, 2020 15:02
2020-01-23 - Eth2 implementer's call 32
Agenda: https://github.com/ethereum/eth2.0-pm/issues/123
Nimbus
- Spec v0.10 implemented
- except crypto: BLS hash_to_curve in progress and should be done this week or early next week
- side-note: crypto spec is nicely blending high-level goals, design rationales and implementation
may be interesting for Eth2
- Passing v0.10 test vectors
- waiting for BLS and SSZ generic missing vectors
cargo test test_map_to_curve_g2 --features bls381 -- --nocapture
@mratsim
mratsim / issue-log-83.md
Created January 17, 2020 18:32 — forked from goranmoomin/issue-log-83.md
actix-service Cell::get_mut() is unsound
@mratsim
mratsim / 2020-01-09-Eth2-impl-call-31.txt
Last active January 9, 2020 14:52
2020-01-09 Eth2 implementers call 31
Agenda: https://github.com/ethereum/eth2.0-pm/issues/118
——————
Nimbus:
Holidays
Core:
- 0.9.4 in sync
- 0.9.3 branch kept for fuzzing purposes
@mratsim
mratsim / FenwickTreeBitmap32.cs
Created January 2, 2020 23:46 — forked from anonymous/FenwickTreeBitmap32.cs
A Fenwick tree for slot usage tracking of 32 slots in a 64 bit bitmap
namespace TryOuts
{
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
/// <summary>
/// Tracker for usage of a block of 32 consecutive slots. Implemented as a
/// Fenwick tree with indexing optimized for queries. Encodes this
/// information into a long (64 bit) value, while leaving the high bit
@mratsim
mratsim / UsageTrackingBlock.cs
Created January 2, 2020 23:45 — forked from anonymous/UsageTrackingBlock.cs
A tracker of slot usage for a region spanning a total of 2^14 (16384) slots, in a total of 3072 bytes using a combination of a Fenwick tree and a bitmap vector.
namespace TryOuts
{
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
/// <summary>
/// Tracks usage of a block of 2^14 (16384) slots using a bitmap that
/// contains the 16384 used/free bit flags for each slot (taking up a
/// total space of 2048 bytes, accessed as an array of 512 ints), in