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/bash | |
# Aborda imediatamente se qualquer um dos comandos abaixo retornar um erro. | |
set -e | |
DEBUG="${DEBUG:-0}" | |
if [ -z "${SGX_SDK_DIR}" ]; then | |
# diretório onde o SGX SDK será instalado | |
SGX_SDK_DIR="/opt/intel" | |
fi |
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
/* | |
* @author Lohann Paterno Coutinho Ferreira <developer@lohann.dev> | |
* | |
* Example on how to add numbers using only bitwise operators: | |
* - xor: ^ | |
* - and: & | |
* - not: ~ | |
* - or: | | |
* | |
* # Motivation |
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
// Script auxiliar para fazer a chamada automaticamente no WebAluno a partir do | |
// arquivo `.csv` gerado pelo Microsoft Teams, para utilizar o script basta logar | |
// no WebAluno e abrir a chamada, então basta copiar e colar a função abaixo no | |
// console do navegador, o script então: | |
// 1 - Irá pedir para vc abrir o Report CSV gerado pelo Microsoft Teams. | |
// 2 - Irá extrair os alunos automaticamente da primeira coluna do CSV. | |
// 3 - Irá marcar as checkbox dos alunos que faltaram, e desmarcar dos que vieram. | |
// 4 - Os nomes que estavam no Teams, mas não na lista de chamada serão reportados no final da execuçãp. | |
// Aproveite! | |
// |
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
// WasteGas | |
// This contract spends 100% of the gas you provide to it, always, and return success. | |
// @author Lohann Paterno Coutinho Ferreira <developer@lohann.dev> | |
// | |
JUMPDEST | |
PUSH1 52 | |
GAS | |
GT | |
PUSH0 | |
JUMPI |
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] | |
name = "rust-wasm-minimal" | |
version = "0.1.0" | |
edition = "2021" | |
[lib] | |
name = "rust_wasm_minimal" | |
crate-type = ["cdylib"] | |
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] |
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] | |
name = "wasm-executor" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
anyhow = "1.0.91" | |
wasmtime = { version = "26.0.0", default-features = false, features = ["cache", "cranelift", "wat", "parallel-compilation", "pooling-allocator"] } |
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.json -- | |
// "dependencies": { | |
// "wabt": "^1.0.36" | |
// } | |
/** | |
* The WAT code (WebAssembly Text Format) which must be compiled to WASM (binary). | |
* - Library used to compile: https://github.com/WebAssembly/wabt | |
* - WebAssembly instructions set: https://webassembly.github.io/spec/core/text/instructions.html | |
*/ |
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
// -- Cargo.toml -- | |
// [dependencies] | |
// rand = { version = "0.8.5" } | |
// const-hex = { version = "1.13.1" } | |
use rand::prelude::*; | |
// Tamanho do secret e do vetor de inicialização. | |
const BLOCK_SIZE: usize = 16; | |
#[allow(clippy::manual_memcpy)] |
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 fn modpow(g: u32, exp: u128, n: u32) -> u32 { | |
let mut exponente = exp; | |
let mut resultado = 1; | |
let mut double = g; | |
while exponente > 0 { | |
if exponente % 2 == 1 { | |
resultado *= double; | |
resultado %= n; | |
} | |
exponente /= 2; |
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
// Author: Lohann Paterno Coutinho Ferreira | |
// | |
use num_bigint::BigUint; // ^0.4.6 | |
use num_traits::{One, Zero}; // ^0.2.19 | |
use num_integer::Integer; // ^0.1.46 | |
#[allow(clippy::unwrap_used, clippy::cast_possible_truncation)] | |
fn main() { | |
/// Decimal precision used when printing float and rational values. | |
const PRECISION: u32 = 32; |
NewerOlder