Skip to content

Instantly share code, notes, and snippets.

Avatar

Frank Denis jedisct1

View GitHub Profile
View gist:61ea3283bd22ea44b779bf24b60ff0d4
cargo vet diff aead 0.4.3 0.5.1 (used by aes-gcm, chacha20poly1305)
cargo vet diff aes 0.7.5 0.8.2 (used by aes-gcm)
cargo vet diff aes-gcm 0.9.4 0.10.1 (used by wasi-crypto)
cargo vet diff base64ct 1.1.1 1.5.3 (used by spki, pem-rfc7468)
cargo vet diff bindgen 0.59.2 0.60.1 (used by boring-sys)
cargo vet diff chacha20 0.8.1 0.9.0 (used by chacha20poly1305)
cargo vet diff chacha20poly1305 0.9.0 0.10.1 (used by wasi-crypto)
cargo vet diff cipher 0.3.0 0.4.3 (used by aes, ctr, aes-gcm, and 2 others)
cargo vet diff const-oid 0.6.2 0.9.1 (used by der, digest)
cargo vet diff crypto-bigint 0.2.11 0.4.9 (used by rfc6979, e
View cryptobench.c
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef USE_WOLFSSL
#include <wolfssl/options.h>
#endif
#include <openssl/ssl.h>
View gist:bfd09ef7f246041b192c196af7a7ac55
diff --git a/src/Compilation.zig b/src/Compilation.zig
index b00f13581..4e21245f4 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -4474,7 +4474,7 @@ fn detectLibCIncludeDirs(
// If linking system libraries and targeting the native abi, default to
// using the system libc installation.
- if (link_system_libs and is_native_abi and !target.isMinGW()) {
+ if ((link_system_libs or target.isDarwin()) and is_native_abi and !target.isMinGW()) {
View relaycheck.sh
#! /bin/sh
CONFIG="/tmp/dnscrypt-proxy.toml"
TEST_SERVER="sdns://AQcAAAAAAAAADTUxLjE1LjEyMi4yNTAg6Q3ZfapcbHgiHKLF7QFoli0Ty1Vsz3RXs1RUbxUrwZAcMi5kbnNjcnlwdC1jZXJ0LnNjYWxld2F5LWFtcw"
DNSCRYPT_PROXY=~/src/dnscrypt-proxy/dnscrypt-proxy/dnscrypt-proxy
PIDFILE="/tmp/dnscrypt-proxy.pid"
relaycheck() {
stamp="$1"
{
View gist:23c38853005f5dad07abca35dcddcdc2
const std = @import("std");
const big = std.math.big;
const Allocator = std.mem.Allocator;
const crypto = std.crypto;
const Managed = big.int.Managed;
const Const = big.int.Const;
const Order = std.math.Order;
fn powMod(res: *Managed, b: Const, e: Const, m: Const) !void {
View zig.sh
#! /bin/sh
if ! command zig version >/dev/null; then
echo "Zig >= 0.8.0 is required" >&2
exit 1
fi
TARGET="x86_64-linux-gnu"
export PREFIX="$(pwd)/libsodium-${TARGET}"
View gist:fca61a2695d7831914571e7f36556abd
.
└── zig
├── include
│   ├── __clang_cuda_builtin_vars.h
│   ├── __clang_cuda_cmath.h
│   ├── __clang_cuda_complex_builtins.h
│   ├── __clang_cuda_device_functions.h
│   ├── __clang_cuda_intrinsics.h
│   ├── __clang_cuda_libdevice_declares.h
│   ├── __clang_cuda_math.h
View secp256k1.zig
//! Autogenerated: './src/ExtractionOCaml/word_by_word_montgomery' --lang Zig secp256k1 64 '2^256 - 2^32 - 977' --internal-static --public-function-case camelCase --private-function-case camelCase --no-prefix-fiat
//! curve description: secp256k1
//! machine_wordsize = 64 (from "64")
//! requested operations: (all)
//! m = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f (from "2^256 - 2^32 - 977")
//!
//! NOTE: In addition to the bounds specified above each function, all
//! functions synthesized for this Montgomery arithmetic require the
//! input to be strictly less than the prime modulus (m), and also
//! require the input to be in the unique saturated representation.
View p256.zig
//! Autogenerated: './src/ExtractionOCaml/word_by_word_montgomery' --lang Zig p256 64 '2^256 - 2^224 + 2^192 + 2^96 - 1' --internal-static --public-function-case camelCase --private-function-case camelCase --no-prefix-fiat
//! curve description: p256
//! machine_wordsize = 64 (from "64")
//! requested operations: (all)
//! m = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff (from "2^256 - 2^224 + 2^192 + 2^96 - 1")
//!
//! NOTE: In addition to the bounds specified above each function, all
//! functions synthesized for this Montgomery arithmetic require the
//! input to be strictly less than the prime modulus (m), and also
//! require the input to be in the unique saturated representation.
@jedisct1
jedisct1 / a.zig
Last active April 17, 2021 23:26
View a.zig
//! Autogenerated: './src/ExtractionOCaml/unsaturated_solinas' --lang Zig curve25519 64 '(auto)' 2^255-19 --internal-static --public-function-case camelCase --private-function-case camelCase --no-prefix-fiat
//! curve description: curve25519
//! machine_wordsize = 64 (from "64")
//! requested operations: (all)
//! n = 5 (from "(auto)")
//! s-c = 2^255 - [(1, 19)] (from "2^255-19")
//! tight_bounds_multiplier = 1 (from "")
//!
//! Computed values:
//! carry_chain = [0, 1, 2, 3, 4, 0, 1]