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
[package] | |
name = "trimmedSHA512" | |
version = "0.1.0" | |
edition = "2021" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[dependencies] | |
clap = { version = "4.0.29", features = ["derive"] } | |
sha2 = "*" |
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
[package] | |
name = "challenges-47" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
rsa = "*" | |
rand = "*" | |
num-traits = "*" | |
num-bigint-dig = "*" |
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
/* It was few month ago I was busy with this solution, and I didn't left the note on the amendment to the exercise I wanted | |
to propose (since I wasn't sure it would be reasonable). Though I left the tag #result to indicate the problem that I saw. | |
IIRC I wanted to propose switching `Option` result from `new` method to `match_sting`. */ | |
#![feature(iter_intersperse)] | |
use require_lifetimes::require_lifetimes; | |
#[derive(Debug, PartialEq, Eq, Clone)] | |
enum MatcherToken<'t> { | |
/// This is just text without anything special. | |
RawText(&'t str), |
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
use proc_macro::TokenStream; | |
use quote::{format_ident, quote}; | |
use syn::{ | |
parse_macro_input, spanned::Spanned, AngleBracketedGenericArguments, Data::Struct, DeriveInput, | |
Error, Fields::Named, GenericArgument, Ident, Meta, Path, PathArguments, Type, TypePath, | |
}; | |
#[proc_macro_derive(Builder, attributes(builder))] | |
pub fn derive(input: TokenStream) -> TokenStream { | |
let input = parse_macro_input!(input as DeriveInput); |
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
pragma circom 2.1.6; | |
include "circomlib/circuits/comparators.circom"; | |
/* the exercise says "of a given field F", but I feel like it's really bigger task, which is quite narrow in it's learning | |
potential so the `template` is parameterized only with the curve coefficients */ | |
// WARNING: it's for user discretion to ensure that both points are on the curve | |
template WsAdd (a) { // **parameter is $A$ coefficient of the curve** | |
signal input p_1[3]; | |
signal input p_2[3]; |
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
#[test_only] | |
module my_first_package::my_first_package_tests { | |
// uncomment this line to import the module | |
use my_first_package::my_module; | |
const ENotImplemented: u64 = 0; | |
#[test] | |
public fun test_sword_create() { | |
let ctx = tx_context::dummy(); |