Skip to content

Instantly share code, notes, and snippets.

View puria's full-sized avatar
🍩
🧘🏼‍♀️👷🏻‍♀️

Puria Nafisi Azizi puria

🍩
🧘🏼‍♀️👷🏻‍♀️
View GitHub Profile
@puria
puria / index.html
Created May 19, 2023 08:33
e2e encryption message wasm
<script type="module">
import { zencode_exec } from "https://jspm.dev/zenroom";
const keys = JSON.stringify({
"Alice": {
"keyring": {
"ecdh": "IStvfSREogWWYLB+DtpaSFqGJYMZMKvLIdGNN/H5DH4="
}
}
@puria
puria / index_wasm.html
Created May 17, 2023 12:40
zenroom run in the browser
<!DOCTYPE html>
<html class="h-100">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<style>
.container {
@puria
puria / logs
Created March 31, 2021 14:37
Lancio il contratto Scenario reflow Given I have a 'bls public key array' named 'public keys' and I have a 'string' named 'today' When I aggregate the bls public key from array 'public keys' and I rename the 'bls public key' to 'reflow public key' and I create the reflow session with uid 'today' Then print the 'reflow session'
initialize_malloc_heap()
claim_more_memory(numBytes=48)
claim_more_memory: claimed 0x10d66f70 - 0x10d66fa0 (48 bytes) via sbrk()
allocate_memory(align=16384, size=16384 bytes)
claim_more_memory(numBytes=16432)
claim_more_memory: claimed 0x10d66fa0 - 0x10d6afd0 (16432 bytes) via sbrk()
allocate_memory(align=16386, size=16384 bytes)
claim_more_memory(numBytes=16432)
claim_more_memory: claimed 0x10d6afd0 - 0x10d6f000 (16432 bytes) via sbrk()
allocate_memory(align=16384, size=16384 bytes)
➜ make check-py
[PY] zenroom_exec test/vararg.lua
testing vararg
+
+
+
OK
--- 0.030600772 seconds ---
@ ======================================== @
[PY] zenroom_exec test/utf8.lua
[{"id":"9ee52350.0f41","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"3082885d.e2afa8","type":"zencode","z":"9ee52350.0f41","name":"01-CITIZEN-credential-keygen","format":"text","source":"Scenario 'coconut': \"To run over the mobile wallet the first time and store the output as keypair.keys\"\nGiven that I am known as 'identifier'\nWhen I create my new keypair\nThen print all data","x":353.5,"y":97,"wires":[["d226062d.c0f668"]]},{"id":"7f05d40a.239d9c","type":"zencode","z":"9ee52350.0f41","name":"02-CITIZEN-credential-request","format":"text","source":"Scenario 'coconut': \"To run after the request keypair is stored (keypair.keys)\"\nGiven that I am known as 'identifier'\nand I have my credential keypair\nWhen I request a blind signature of my keypair\nThen print all data\n","x":810.2500076293945,"y":197.75000381469727,"wires":[["5b5d8d79.31ff34"]]},{"id":"d226062d.c0f668","type":"KEYS","z":"9ee52350.0f41","name":"","format":"json","source":"","x":571.5,"y":97,"wires":[["7f05d40a.239d9c"]]},
[!] Import error: obj is nil (issue_verify)
[!] Zencode debug states
{
IN = {
KEYS = {
petition = {
curve = "bls383",
encoding = "hex",
owner = "042a67cbac82b3e6c98516650cf3be60e8a9b2de33a3b48f15243fcbd5e8a8697a06a4158e21f44d0abf6a83414896a61a4292787022f5fa229f79fd1c6c4d1d12f84654b5dd40a05adc6e63a0111688a61b1aa829a22f753374f6cc8b0229c030",
schema = "petition",
FRESULT 0
{"petition": {"curve": "bls383", "encoding": "hex", "owner": "04356878b230d0bffc7e913736dbc2cdcfecfc21f02195177c1d501513a1c10fafc534668a306db5a7dcd57df8242226d61920f766bc0dca690598bdcd7aae09490d7681f9ec6197d84c8ed9e5484a8ad21717d7a224697fd3649279089970c71d", "schema": "petition", "scores": {"curve": "bls383", "encoding": "hex", "neg": {"left": "Infinity", "right": "Infinity"}, "pos": {"left": "Infinity", "right": "Infinity"}, "schema": "petition_scores", "zenroom": "0.9"}, "uid": "petition", "zenroom": "0.9"}, "petition_ecdh_sign": ["00000000000000000000000000000000bbd1ccd5ca91a78a1ec976d9990525a21b89b1782c635afba603cfd589465978", "000000000000000000000000000000007bf0ea1b1d2e75c70a759af5087fbb066c9473dbcef322e66b2f2b52a46dcd6e"], "proof": {"curve": "bls383", "encoding": "hex", "kappa": "1fe1c239265b2d0d8c137c50d43d82b0b2f780364d7b57a2082490955232bb3ce4b2be1513a11dcd181625e5846824db2cb5d9d6ce5a4da9fcd24d0eee51f99d410d579c7137b9d88eeaa5f0c6c8c23263b8c37b6ee5496821f45bedfa267ecb2e1c5e023118591290cd21c8

Keybase proof

I hereby claim:

  • I am puria on github.
  • I am puria (https://keybase.io/puria) on keybase.
  • I have a public key ASCYjfI7USY-2Ca9zdHqrXYZYo3i3I3A3PmaV4ASyvrwxAo

To claim this, I am signing this object:

{"verifier":{"schema":"issue_verify","alpha":"043cec5268019c4703aa2325fb0d876ff8739748ffd47fbdc56277bbe09b07f46514431c3fe836540282125ee6e94b15396fa72f4302f655edf960c386fcf23e910ed46714a24ede7f1ca58da913e9928c2ed0b853995a9475b6057b249ae836097a5dd65fb96f64cb08e1caed49cf312643d2d007e775b8bbc76d42c821909f90ba274348b45f2287ccd9f5b75c2dd24997163ce51ae35227d9618fff92d7a369e175ff001af188fe951f550e6cfecf4b01c091662f48fd9ac144643577bac9","curve":"bls383","zenroom":"0.9","encoding":"hex","beta":"39633f72297c4d5864f6345f8b92434e309e11febe8dd652221b52f7c05de0c5a65fc2afed6642dab5e0af7d835e632e039ed38369bbdbb706c34bd56764270fd697092e3de2fcc2e6f109a05e68afe615ff0656e321fbb5879921aed9e21f0c101451399d66fe5ac0195a50543ed9da4be00a9b49614a05297e91dca556624c2df0667369aaec66d3218203626f096739fb0f94ff86ead2e33f7f77dccd4713fc58fb50335da660c673e2c1b49837c9ffaa8a9f2ee8e132f0e14119e05b755b"},"petition":{"zenroom":"0.9","curve":"bls383","schema":"petition","uid":"petition","list":{"04450464eb130ba92a75e0c1a9b47bf089d53f8ff2e8e27f5e623c54
Sent {'type': 'http.request', 'body': '<1622 bytes>', 'more_body': False}
. loading lua initialisation
{
ACK = {
petition = {
list = {
["040066e581923acc9018be59e87796abdbc6d99e278f5b976d99f6417ab2fefef8d7ad29570e1956028e1c267dab08dd6148266c35aa2332754e4715c620f680e776e788cb6a55cba2b6beff4aa68bef1f6dbdaa96587e8ed60a4ea9a18504ad05"] = true
},
owner = ecp[] 044fab3cafdd4604879ce1024d283f733dda892b39002a52d38bb1cfa6a88aa36255e90419286791d5e14027b89978f44d3d23fe4347d5ee7d13923247249f1156e3bd79113c6466641cfe68116c75c4fd88a4737c40a462d7bf9871e22cdedb98,
scores = {