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 / android-backup-apk-and-datas.md
Created September 23, 2023 21:25 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

Fetch application APK

0x1319645b02b60d36f9e3804a38e888fcfc13323c1eed57c2df6aa94910bc8f82

@mratsim
mratsim / cpp.std.coroutines.draft.md
Created December 22, 2020 15:25 — forked from MattPD/cpp.std.coroutines.draft.md
C++ links: Coroutines (WIP draft)
F1 = GF(21888242871839275222246405745257275088696311157297823662689037894645226208583)
G1 = EllipticCurve(F1,[0,3])
print(G1)
P1 = G1(1,2)
F2 = GF(21888242871839275222246405745257275088696311157297823662689037894645226208583^2,"i",modulus=x^2 + 1)
TwistB = 3*F2("9+i")^(-1)
G2 = EllipticCurve(F2,[0,TwistB])
@mratsim
mratsim / erase_from_memory.h
Created April 14, 2020 10:05 — forked from mimoo/erase_from_memory.h
Include this file to get the `erase_from_memory` function that zeros memory. See https://www.cryptologie.net/article/419/zeroing-memory-compiler-optimizations-and-memset_s/
#ifndef __ERASE_FROM_MEMORY_H__
#define __ERASE_FROM_MEMORY_H__ 1
#define __STDC_WANT_LIB_EXT1__ 1
#include <stdlib.h>
#include <string.h>
void *erase_from_memory(void *pointer, size_t size_data, size_t size_to_remove) {
#ifdef __STDC_LIB_EXT1__
memset_s(pointer, size_data, 0, size_to_remove);
"""
https://cryptosith.org/michael/data/talks/2013-08-01-SIAMAG13.pdf
https://www.issac-conference.org/2015/Slides/Schost.pdf
http://www.craigcostello.com.au/pairings/PairingsForBeginners.pdf
"""
fresh_compute = False # Perform expensive-(ish) computations for curve orders
field_modulus = 22369874298875696930346742206501054934775599465297184582183496627646774052458024540232479018147881220178054575403841904557897715222633333372134756426301062487682326574958588001132586331462553235407484089304633076250782629492557320825577
desired_curve_order = 258664426012969094010652733694893533536393512754914660539884262666720468348340822774968888139573360124440321458177
@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)

@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 / 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