Skip to content

Instantly share code, notes, and snippets.

View alinush's full-sized avatar
🇷🇴

Alin Tomescu alinush

🇷🇴
View GitHub Profile
@alinush
alinush / aptos-keyless-ceremony-may2024_attestation.log
Created May 2, 2024 00:14
Attestation for aptos-keyless-ceremony-may2024 MPC Phase 2 Trusted Setup ceremony
Hey, I'm alinush-1724810 and I have contributed to the aptos-keyless-ceremony-may2024.
The following are my contribution signatures:
Circuit # 1 (main_39f9c44b4342ed5e6941fae36cf6c87c52b1e17f)
Contributor # 12
Contribution Hash: 8bda3a66 1e4978bf 89396a3a 0913408b
d45146e5 09aae40c 8e415476 f578ac0a
1e789d01 72b66dd4 2bb1d181 9da32f8b
449ae513 36cd8248 fde5b489 8f92db93
@alinush
alinush / aptos-oidb-zk-ceremony_attestation.log
Created February 22, 2024 17:34
Attestation for aptos-oidb-zk-ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm alinush-1724810 and I have contributed to the aptos-oidb-zk-ceremony.
The following are my contribution signatures:
Circuit # 1 (main)
Contributor # 1
Contribution Hash: 65c3e44a e8ae9dcd 2406d1b4 7413e09c
72a6587b 5dbc6e00 ac607c84 cefbc4c1
a9dd4d2c 39d78381 ea2a8cf2 8d3f4e91
c32c2e8b eaf17465 b9bc8045 a529ecf1
pub struct RistrettoPoint(u128);
/// Returns mutable references to two Ristretto points in the vector using split_at_mut. Otherwise,
/// the Rust compiler would complain.
fn get_two_muts(v: &mut Vec<RistrettoPoint>, a: usize, b: usize) -> (&mut RistrettoPoint, &mut RistrettoPoint) {
use std::cmp::Ordering;
let (sw, a, b) = match Ord::cmp(&a, &b) {
Ordering::Less => (false, a, b),
Ordering::Greater => (true, b, a),
#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
struct Args {
/// Can be either: merkle_sha3, merkle_blake2s, merkle_blake2b, merkle++, merkle++naive, or verkle
#[clap(short, long)]
_type: String, // TODO: list options
/// Tree arity
#[clap(short, long, default_value = "2")]
arity: usize,
GT MultiPairing(const std::vector<G1>& g1, const std::vector<G2>& g2) {
assertEqual(g1.size(), g2.size());
using G1_precomp = libff::default_ec_pp::G1_precomp_type;
using G2_precomp = libff::default_ec_pp::G2_precomp_type;
using Fqk = libff::default_ec_pp::Fqk_type;
std::vector<G1_precomp> g1p;
std::vector<G2_precomp> g2p;
@alinush
alinush / rotate-table-headers.tex
Created October 3, 2020 15:54
Rotate LaTeX headers
\documentclass{article}
\usepackage{adjustbox}
\usepackage{array}
\newcolumntype{R}[2]{%
>{\adjustbox{angle=#1,lap=\width-(#2)}\bgroup}%
l%
<{\egroup}%
}
@alinush
alinush / openmp_sections.cpp
Created July 22, 2018 21:49
Checking some OpenMP code
// Compile with: g++ -fopenmp /tmp/lol.cpp && ./a.out
// Set number of threads: export OMP_NUM_THREADS=16
// Expected behaviour: should print a = 1, b = 2 and only two different threads should launch
#include <iostream>
#include <omp.h>
using namespace std;
int main() {
### Keybase proof
I hereby claim:
* I am alinush on github.
* I am alinush (https://keybase.io/alinush) on keybase.
* I have a public key whose fingerprint is D729 B209 4137 DFAA A906 919C 0F7B 2557 0802 3006
To claim this, I am signing this object:
@alinush
alinush / TestWatcher.java
Created August 23, 2014 06:18
Java JUnit TestWatcher
@Rule
public TestWatcher watchman = new TestWatcher() {
@Override
protected void starting(final Description description) {
String methodName = description.getMethodName();
String className = description.getClassName();
className = className.substring(className.lastIndexOf('.') + 1);
System.out.println("\n * Running " + className + "::" + methodName);
}
@alinush
alinush / DoubleToString.c
Created July 14, 2013 23:50
Convert a double variable to a string
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
TCHAR * DoubleToString (TCHAR * buffer, double value, unsigned int precision)
{
// 'i' is going to be the current index into the buffer
unsigned int i = 0, j = 0, nDigits = 0;
unsigned long integer;