Skip to content

Instantly share code, notes, and snippets.

@axelexic
axelexic / llvm-defaults.sh
Created April 12, 2023 21:50
LLVM-Clang-LLDB-Ubuntu-Defautls
#!/usr/bin/env sh
sudo update-alternatives --install \
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-16 200 \
--slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-16 \
--slave /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-16 \
--slave /usr/bin/llvm-bcanalyzer llvm-bcanalyzer /usr/bin/llvm-bcanalyzer-16 \
--slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-16 \
--slave /usr/bin/llvm-diff llvm-diff /usr/bin/llvm-diff-16 \
--slave /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-16 \
@axelexic
axelexic / Schoof.sage
Last active January 27, 2021 07:28
Schoof algorithm (without Elkies/Atkins improvements) to compute number of points on a curve
from sage.all_cmdline import *
def curve_fx(e: EllipticCurve):
a4 = e.a4()
a6 = e.a6()
X,Y=e.multiplication_by_m(1)
return X**3 + a4*X + a6
def trace_mod_2(e: EllipticCurve):
(X,Y) = e.multiplication_by_m(1)
@axelexic
axelexic / velu.sage
Created August 31, 2020 07:56
Velu's formula for computing isogeny in short Weirstrass form
from sage.all_cmdline import *
Fq=GF(11)
E=EllipticCurve(Fq, [3,7])
G0=(E.gens()[0])
R = PolynomialRing(Fq, 'X,Y'); R.inject_variables()
def normalize_rational_map(rational_map, curve : EllipticCurve):
def reduce_y2(poly, fx):
xterms = 0
@axelexic
axelexic / .pdbrc
Created August 5, 2020 08:34
Python dot pdbbrc to list source code after each step
alias n next ;; list
alias c continue ;; list
alias s step ;; list
alias finish up ;; list
alias f up ;; list
alias fini up ;; list
alias d down ;; list
alias u until ;; list
def normalize(polyList, fx):
const_term = 0
y_term = 0
for i, v in enumerate(polyList):
xterm = polyList[i]
if i % 2 == 0:
expo = int(i/2)
const_term = const_term + xterm * (fx ^ expo)
else:
### Keybase proof
I hereby claim:
* I am axelexic on github.
* I am yogeshswami (https://keybase.io/yogeshswami) on keybase.
* I have a public key whose fingerprint is 50DE 2256 43D7 ADC8 BECB A227 A8C3 5CDF 033B EE05
To claim this, I am signing this object: