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
use hex; | |
use secp256k1::{ecdsa::Signature, Message, Secp256k1, SecretKey}; | |
fn main() { | |
let msg = hex::decode(String::from( | |
"e9733bc60ea13c95c6527066bb975a2ff29a925e80aa14c213f686cbae5d2f36", | |
)) | |
.unwrap(); | |
let secp = Secp256k1::new(); |
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 ecdsa = std.crypto.sign.ecdsa; | |
fn hexToBytes(comptime size: usize, hex_str: []const u8) ![size]u8 { | |
var bytes: [size]u8 = undefined; | |
_ = try std.fmt.hexToBytes(&bytes, hex_str); | |
return bytes; | |
} | |
fn bytesToHex(comptime size: usize, bytes: []const u8) ![size]u8 { |
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
require "digest" # for hashing transaction data so we can sign it | |
require "securerandom" # for generating random nonces when signing | |
# ------------------------- | |
# Elliptic Curve Parameters | |
# ------------------------- | |
# y² = x³ + ax + b | |
$a = 0 | |
$b = 7 |
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 ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
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
begin | |
using Flux, MLDatasets, Statistics | |
using Flux: onehotbatch, onecold, logitcrossentropy, params | |
using Base.Iterators: partition | |
using Printf, BSON | |
using CUDA | |
using ImageShow | |
using Images | |
CUDA.allowscalar(true) | |
end |