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 main | |
import ( | |
"io/ioutil" | |
"fmt" | |
"crypto" | |
"crypto/ecdsa" | |
"crypto/ed25519" | |
"crypto/elliptic" | |
"crypto/rand" |
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
#include <stdio.h> | |
#include <unistd.h> | |
void child(int n) { | |
while (1) | |
{ | |
sleep(1); | |
printf("child %d!\n", n); | |
} | |
} |
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
type Message = | |
{ kind: "request", request: string, fields: [string, string][] } | | |
{ kind: "response", response: string, fields: [string, string][] } | | |
{ kind: "event", event: string, fields: [string, string][] } | |
type Enum = { kind: "enum", enum: string, items: string[] } | |
type SpecItem = Message | Enum | |
function messageName(msg: Message): string { | |
switch(msg.kind) { |
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
#![feature(async_await, await_macro)] | |
use std::io; | |
use std::net::SocketAddr; | |
use futures::executor; | |
use futures::io::AsyncReadExt; | |
use futures::StreamExt; | |
use romio::{TcpListener, TcpStream}; |
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
> toxic ==> toxic | |
> | |
> Sending file [0]: 'large' (70.7 MiB) | |
> File transfer [0] for 'large' accepted. clock:1556250 | |
> 100.0% [==================================================] 3.0 MiB/s | |
> File 'large' successfully sent. end=4282650 | |
> Sending file [0]: 'large' (70.7 MiB) | |
> File transfer [0] for 'large' accepted. clock:9282914 | |
> 100.0% [==================================================] 0.0 Bytes/s | |
> File 'large' successfully sent. end=12203390 |
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
1. Alice creates ToxID | |
a. Key pair generation: curve25519xsalsa20poly1305, a particular combination of Curve25519, Salsa20, and Poly1305 specified in "Cryptography in NaCl". This function is conjectured to meet the standard notions of privacy and third-party unforgeability. | |
2. Bob creates ToxID | |
3. Alice and Bob exchange ToxID in public | |
a. You can exchange ToxIDs via email, key signing parties, publish on web sites... | |
b. There are 4 bytes at the end (NoSpam) used to regenerate ToxID in case of receiving a lot of friend requests from spammers. | |
4. Alice goes online |
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
extern crate common; | |
use common::measure_and_print; | |
use std::collections::{BinaryHeap, HashMap}; | |
use std::io; | |
#[derive(Debug, Eq, PartialEq)] | |
enum NodeKind { | |
Leaf(u8), | |
Branch(Box<Node>, Box<Node>), |
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 = "stack_string" | |
version = "0.1.0" | |
authors = ["Roman Proskuryakov <humbug@deeptown.org>"] | |
edition = "2018" | |
[dependencies] | |
libc = { version = "0.2", default-features = false } | |
heapless = { version = "0.4" } |
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
language: rust | |
os: | |
- linux | |
- osx | |
rust: | |
- 1.26.0 | |
- stable | |
- beta | |
- nightly |
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
humbug@home:~/zetox$ git diff | cat | |
diff --git a/Cargo.toml b/Cargo.toml | |
index 9206765..b4f0b15 100644 | |
--- a/Cargo.toml | |
+++ b/Cargo.toml | |
@@ -33,7 +33,7 @@ bytes = "0.4" | |
byteorder = "1" | |
futures = "0.1" | |
log = "0.4" | |
-sodiumoxide = "0.0.16" |
NewerOlder