Skip to content

Instantly share code, notes, and snippets.

View c-plus-plus-equals-c-plus-one's full-sized avatar

JanuaryPersimmon2024 c-plus-plus-equals-c-plus-one

  • Terra incognita.
  • 11:14 (UTC +03:00)
View GitHub Profile
@c-plus-plus-equals-c-plus-one
c-plus-plus-equals-c-plus-one / ANSWERS.md
Last active October 13, 2025 15:23
RareSkills ZK Homework Exercises 1, 2, 3, 4

Assuming p=71 for all below problems.

  1. Find the elements in a finite field that are congruent to the following values:
    1. -1 ≅ 70 (since -1 mod 71 = 70 and 70-(-1) = 71, 71 % 71 == 0;
    2. -4 ≅ 67. 67 - (-4) = 71;
    3. -160 ≅ 53;
    4. 500 ≅ 429.
/// PoC: SOURCE=ETH, DEST=Linea, no L1 inclusion → routes to hardcoded Linea ChainSpec branch
/// This demonstrates the wrong-spec code path without relying on on-chain verification.
/// It confirms:
/// - Non-OpStack path (OpEvmInput is None)
/// - Validators later expect ETH_MAINNET_CHAIN_SPEC for SOURCE=ETH
/// - The builder else-branch used LINEA_MAINNET_CHAIN_SPEC (hardcoded)
#[tokio::test]
async fn test_poc_wrong_chain_spec_eth_non_opstack_no_inclusion() {
use alloy::transports::http::reqwest::Url;
use risc0_steel::ethereum::{EthEvmEnv, ETH_MAINNET_CHAIN_SPEC};
@ve3
ve3 / Encryption.js
Last active August 10, 2023 10:51
Encrypt and decrypt between programming languages (PHP & JavaScript). (Newer version here https://gist.github.com/ve3/b16b2dfdceb0e4e24ecd9b9078042197 )
/**
* Encryption class for encrypt/decrypt that works between programming languages.
*
* @author Vee Winch.
* @link https://stackoverflow.com/questions/41222162/encrypt-in-php-openssl-and-decrypt-in-javascript-cryptojs Reference.
* @link https://github.com/brix/crypto-js/releases crypto-js.js can be download from here.
*/
class Encryption {