Skip to content

Instantly share code, notes, and snippets.

View Davidson-Souza's full-sized avatar

Davidson Souza Davidson-Souza

View GitHub Profile
@Davidson-Souza
Davidson-Souza / run.sh
Last active July 18, 2021 23:26
This (terrible) code will show some statistics of the bitcoin mining, in a more or less accurate way. The code is intended to be easy to read and understand.
# In order to run this example in Unix-like systems, like linux, you should click in "raw" and copy-paste the code in a .js file
# like main.js. The run the follow:
npm init
npm install node-bitcoin-rpc bignumber.js
node main.js
@Davidson-Souza
Davidson-Souza / Non-ct.diff
Created July 13, 2023 16:44
Using valgrind ctime with Rust code, without biding valgrind lib
diff --git a/src/FsChaCha20/fschacha20.rs b/src/FsChaCha20/fschacha20.rs
index ba8e185..781c3e1 100644
--- a/src/FsChaCha20/fschacha20.rs
+++ b/src/FsChaCha20/fschacha20.rs
@@ -54,6 +54,9 @@ impl FSChaCha20 {
}
pub fn decrypt(&mut self, chunk: &[u8]) -> Vec<u8> {
+ if self.key[0] == 0 {
+ println!("Key is not initialized");
@Davidson-Souza
Davidson-Souza / index.html
Last active August 16, 2023 15:16
This is a super simple example of verifying the validity of a utreexo on the web.
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
</head>
<body>
<!-- Note the usage of `type=module` here as this is an ES6 module -->
<script src="mock_data.js"></script>
<script type="module" src="main.js"></script>