Skip to content

Instantly share code, notes, and snippets.

View alxiong's full-sized avatar

Alex Xiong alxiong

View GitHub Profile

Reflection on Eurocrypt 2023

Top personal takeaways are:

  • Lattice-based crypto is the perfect sub-direction to contribute in
    • Vadim's remark on state of lattice: KEM, signatures, FHE, Functional commitments, ZKPs. Some reduces to more structured Lattices than others for efficiency.
      • Confidence in lattice hardness, but IP issue is somewhat tricky.
      • The most convincing slide presents the CNSA timeline for mandatory transition to PQC by 2033 -- not a matter of if or when, it's gonna happen!
    • Missing:
  • threshold crypto (rejection sampling on individual share doesn't guarantee successful secret reconstruction?)
@alxiong
alxiong / conversion.rs
Created May 23, 2021 04:00
Two-way, deterministic, infalliable conversion between Scalars and Bytes
use ark_bls12_381::Fr as BlsScalar;
use ark_ff::{FpParameters, PrimeField};
// The number of bits that can be reliably stored for BlsScalar. (Should equal
// SELF::MODULUS_BITS - 1)
const BLS_SCALAR_BIT_CAPACITY: u32 = <BlsScalar as PrimeField>::Params::CAPACITY;
// 31 bytes a chunk
const BLS_SCALAR_BYTE_CAPACITY: usize = BLS_SCALAR_BIT_CAPACITY as usize / 8;
/// Two-way, deterministic, infalliable conversion between arbitrary bytes (of

Keybase proof

I hereby claim:

  • I am alxiong on github.
  • I am alexxiong97 (https://keybase.io/alexxiong97) on keybase.
  • I have a public key ASAbph-GOODq3RMWsDvNBYTvUIHGdMAEj3V1ShQDGm9uOAo

To claim this, I am signing this object:

@alxiong
alxiong / LibPrecompiled.sol
Created April 8, 2019 05:12
scalarMult precompiled wrapper in Solidity
pragma solidity ^0.5.7;
/// @title LibPrecompiled - A wrapper around precomplied contracts for EC op
/// @notice This contract try to abstract away calling of precompiled native
/// contract to make using EC operations on BN_256 curve easier
contract LibPrecompiled {
// details see: https://cryptojedi.org/papers/dclxvi-20100714.pdf
// exact parameters: https://gist.github.com/AlexXiong97/217f42ee4d0dedc6182b182134caeed9
@alxiong
alxiong / main.go
Last active April 22, 2019 11:50
bn256 curve testing parameters generation
package main
import (
// "crypto/rand"
"fmt"
"github.com/cloudflare/bn256"
// "io"
"math/big"
)