Skip to content

Instantly share code, notes, and snippets.

Open this in zkREPL →

This file can be included into other zkREPLs with include "gist:9c8d24ea5fd8507b90c3695c21a1c67e";

@mskd12
mskd12 / vc.rs
Created March 16, 2021 18:45
Fast vector commitments
extern crate curve25519_dalek;
extern crate rand;
use curve25519_dalek::constants;
use curve25519_dalek::traits::MultiscalarMul;
use curve25519_dalek::scalar::Scalar;
use curve25519_dalek::edwards::EdwardsPoint;
use curve25519_dalek::edwards::VartimeEdwardsPrecomputation;
use curve25519_dalek::traits::VartimePrecomputedMultiscalarMul;

Keybase proof

I hereby claim:

  • I am mskd12 on github.
  • I am deepakmaram (https://keybase.io/deepakmaram) on keybase.
  • I have a public key ASCgBYP9p0fXeyyNNZDPugLJsqOOn-agb7kmsjkiAY1WNAo

To claim this, I am signing this object:

@mskd12
mskd12 / AES128GCM.java
Created March 14, 2019 17:28
Manually decrypt a TLS 1.2 session
package org.code.tlsdecrypt;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import org.bouncycastle.crypto.InvalidCipherTextException;
import org.bouncycastle.crypto.engines.AESEngine;
import org.bouncycastle.crypto.engines.AESFastEngine;
import org.bouncycastle.crypto.modes.AEADBlockCipher;
@mskd12
mskd12 / gist:7095ab3bc058f6089e17a9c0c5baa2e6
Created July 26, 2018 03:09
error in sgxtime, rust-sgx-sdk
diff --git a/samplecode/hello-rust/enclave/src/lib.rs b/samplecode/hello-rust/enclave/src/lib.rs
index ed49b2a..f23800e 100644
--- a/samplecode/hello-rust/enclave/src/lib.rs
+++ b/samplecode/hello-rust/enclave/src/lib.rs
@@ -43,6 +43,9 @@ use std::vec::Vec;
use std::io::{self, Write};
use std::slice;
+use std::time::*;
+use std::untrusted::time::SystemTimeEx;
#include <stdlib.h>
#include <stdio.h>
int login() {
int accessLevel = 0xff;
char username[16];
char password[32];
printf("Username (max 15 characters): ");
gets(username);
printf("Password (max 31 characters): ");
kasndkadaksdbsakjb
@mskd12
mskd12 / yo
Created April 3, 2017 09:45
bam
CHeck
checklasda
akdsja