This file contains hidden or 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
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 { |
This file contains hidden or 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/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}" |
This file contains hidden or 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
. | |
└── 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 |
This file contains hidden or 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
//! 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. |
This file contains hidden or 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
//! 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. |
This file contains hidden or 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
//! 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] |
This file contains hidden or 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
package main | |
import ( | |
"crypto/sha256" | |
"crypto/x509" | |
"fmt" | |
"io/ioutil" | |
) | |
func main() { |
This file contains hidden or 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
// This file was automatically generated by zig-witx - Do not edit manually. | |
pub const handle = i32; | |
pub const char = u8; | |
pub const untyped_ptr = usize; | |
pub const wasi_string_ptr = *u8; | |
// size | |
pub const size = u32; |
This file contains hidden or 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
// This file was automatically generated by zig-witx - Do not edit manually. | |
pub const handle = i32; | |
pub const char = u8; | |
pub const untyped_ptr = usize; | |
pub const wasi_string_ptr = *u8; | |
// Error codes. | |
pub const crypto_errno = enum(u16) { | |
// Operation succeeded. |
This file contains hidden or 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
export function wasm_call_ctors() { | |
export function add(a:int, b:int):int { | |
export function memset(a:int, b:int, c:int):int { | |
export function memset_1(a:int, b:int, c:int, d:int):int { | |
export function memcpy(a:int, b:int, c:int):int { | |
export function memmove(a:int, b:ubyte_ptr, c:int):int { | |
export function memcmp(a:ubyte_ptr, b:ubyte_ptr, c:int):int { | |
export function bcmp(a:ubyte_ptr, b:ubyte_ptr, c:int):int { | |
export function fmodf(a:float, b:float):float { | |
export function fmod(a:double, b:double):double { |