Skip to content

Instantly share code, notes, and snippets.

View itzmeanjan's full-sized avatar
😎
Working ...

Anjan Roy itzmeanjan

😎
Working ...
View GitHub Profile
@itzmeanjan
itzmeanjan / REAME.md
Last active April 14, 2023 11:30
Generate Known Answer Tests for Xoofff - Deck function instantiated with Xoodoo permutation

This gist holds steps for generating Known Answer Tests from Xoofff's reference C++ implementation ( more @ https://github.com/KeccakTeam/Xoodoo.git ), by applying following git patch s.t. these KATs can be used for ensuring functional correctness of my Rust library implementation of Xoofff ( more @ https://github.com/itzmeanjan/xoofff ).

  • Clone repository holding reference implementation of Xoofff
git clone https://github.com/KeccakTeam/Xoodoo.git
  • Pin repository state to specific commit.
@itzmeanjan
itzmeanjan / sphincs_kat_generation.patch
Created November 28, 2022 11:41
Git Patch for generating Known Answer Tests ( KATs ) from SPHINCS+ Reference Implementation
diff --git a/ref/Makefile b/ref/Makefile
index a3aabad..24c34e1 100644
--- a/ref/Makefile
+++ b/ref/Makefile
@@ -43,7 +43,7 @@ benchmarks: $(BENCHMARK)
benchmark: $(BENCHMARK:=.exec)
PQCgenKAT_sign: PQCgenKAT_sign.c $(DET_SOURCES) $(DET_HEADERS)
- $(CC) $(CFLAGS) -o $@ $(DET_SOURCES) $< -lcrypto
+ $(CC) $(CFLAGS) -o $@ $(DET_SOURCES) -I/usr/local/opt/[email protected]/include -L/usr/local/opt/[email protected]/lib $< -lcrypto
@itzmeanjan
itzmeanjan / README.md
Last active November 24, 2024 08:16
ML-DSA Known Answer Tests and Git Patch to Generate KATs from ML-DSA "Official" Reference Implementation
@itzmeanjan
itzmeanjan / README.md
Last active August 31, 2024 09:21
ML-KEM Known Answer Tests, along with Git Patch to Generate KATs from ML-KEM "Official" Reference Implementation
@itzmeanjan
itzmeanjan / test_montgomery_arithmetic.py
Last active October 22, 2024 05:08
Montgomery Modular Arithmetic for 256 -bit `secp256k1` Prime Field
#!/usr/bin/python3
from math import ceil
from typing import List, Tuple
from random import randint
def bit_count(num: int) -> int:
'''
Same as len(bin(num)[2:])
@itzmeanjan
itzmeanjan / determinant.py
Last active October 21, 2021 03:52
Computing Determinant of Square Matrix using Condensation Method
#!/usr/bin/python3
import numpy as np
from copy import deepcopy
from functools import reduce
from time import time
N = 1 << 8
'''
@itzmeanjan
itzmeanjan / cholesky_factorization.cpp
Created October 18, 2021 14:48
👽 Parallel Cholesky Factorization targeting Accelerators, using SYCL DPC++ 🔥
#include <CL/sycl.hpp>
#include <chrono>
#include <iostream>
#include <random>
using namespace sycl;
const uint N = 1 << 10;
const uint B = 1 << 5;
const float MULT_FACTOR = .5f;
@itzmeanjan
itzmeanjan / improved_lu_decomposition.cpp
Last active October 15, 2021 06:36
🏃‍♂️ Fast, Parallel LU Factorization, using SYCL DPC++ 🏅
#include <CL/sycl.hpp>
#include <chrono>
#include <iostream>
#include <random>
using namespace sycl;
constexpr uint N = 1 << 10;
constexpr uint B = 1 << 6;
@itzmeanjan
itzmeanjan / lu_decomposition.cpp
Last active October 11, 2021 05:43
✨ Parallel LU Decomposition on GPGPU, using SYCL DPC++ 🔆
#include <CL/sycl.hpp>
#include <chrono>
#include <iostream>
#include <random>
using namespace sycl;
constexpr uint N = 1 << 10;
constexpr uint B = 1 << 5;
@itzmeanjan
itzmeanjan / fft.cpp
Last active October 1, 2021 02:10
🤞 Parallel (inv)FFT on GPGPU, using SYCL DPC++ 🚀
#include <CL/sycl.hpp>
#include <chrono>
#include <complex>
#include <iostream>
using namespace sycl;
typedef std::complex<double> cmplx;
constexpr uint N = 1024;
constexpr uint B = 32;