This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
exts=".aux .lof .log .lot .fls .out .toc .dvi .bbl .bcf .blg -blx.aux -blx.bib -blx.bib .run.xml .fdb_latexmk .synctex.gz .syntex.gz(busy) .pdfsync .algorithms .alg .loa .thm .nav .snm .vrb .acn .acr .glg .glo .gls .brf .lol .idx .ilg .ind .ist .maf .mtc .mtc0 .pyg .nlo .tdo .xdy .keys" | |
for x in "${@:-.}"; do | |
arg=$(echo ${x:-.} | perl -pe 's/\.(tex|pdf)$//') | |
if [[ -d "$arg" ]]; then | |
for ext in $exts; do | |
rm -f "$arg"/*$ext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on http://cr.yp.to/streamciphers/timings/estreambench/submissions/salsa20/chacha8/ref/chacha.c | |
import binascii | |
import numpy as np | |
np.seterr(over='ignore') | |
def rotl32(v, c): | |
assert isinstance(v, np.uint32) | |
assert isinstance(c, np.uint32) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pure Python ChaCha20 | |
# Based on Numpy implementation: https://gist.github.com/chiiph/6855750 | |
# Based on http://cr.yp.to/chacha.html | |
# | |
# I wanted an implementation of ChaCha in clean, understandable Python | |
# as a way to get a handle on the algorithm for porting to another language. | |
# There are plenty of bindings but few pure implementations, because | |
# Pure Python is too slow for normal practical use in Cryptography. | |
# | |
# The preceding implementation used NumPy, which avoided a lot of the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |