Skip to content

Instantly share code, notes, and snippets.

View visvirial's full-sized avatar
💭
On my way

Vis Virial (a.k.a. びりある) visvirial

💭
On my way
View GitHub Profile
#!/usr/bin/env python
def jizoku(i):
if i < 10:
return 0
a = 1
while i > 0:
a *= i % 10
i /= 10
return jizoku(a) + 1
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
@visvirial
visvirial / Elliptic Curve Oblivious Transfer.md
Last active July 31, 2020 08:38
Oblivious transfer (OT) protocol that transfers points on an elliptic curve, instead of binary strings.

We propose an elliptic curve-version of oblivious transfer (ECOT) protocol which transfers points on an elliptic curve, instead of binary strings.

Oblivious transfer (OT)

Oblivious transfer (OT) is an important cryptographic primitive used in many cryptographic protocols as a building block. In the oblivious transfer protocols, the sender has messages m0 and m1 and the receiver wishes to retrieve one of the two messages

Keybase proof

I hereby claim:

  • I am visvirial on github.
  • I am mhyuga (https://keybase.io/mhyuga) on keybase.
  • I have a public key whose fingerprint is 4486 9F12 2BE4 6ED5 336E 6F68 EB94 6CB1 1439 4B39

To claim this, I am signing this object:

@visvirial
visvirial / g^(a^2) incomputability.md
Last active April 19, 2021 06:24
Proof of computing (g^a => g^(a^2)) is impossible under the DH assumption.

Statement

We prove that g^(a^2) cannot be computed efficiently from g^a under the Diffie-Hellman (DH) assumption. More rigorously, the following statement holds:

Let G be a cyclic group and g be a generater of G.
Given an oracle which can compute g^(a^2) from a given g^a for any integer a,
there exists a polynomial time algorithm which computes g^(xy) from g^x and g^y for any integers x and y.
import fetch from 'cross-fetch';
import { PublicKey, Connection, Keypair, Transaction } from '@solana/web3.js';
import * as anchor from '@project-serum/anchor';
import { QuarrySDK } from '@quarryprotocol/quarry-sdk';
import { SolanaProvider } from "@saberhq/solana-contrib";
import { Token } from '@saberhq/token-utils';
export default class Wallet {