hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 8d53a9b1060d8396de32f63471b771176dbdc7ab
parent 02e8711015f4c3d5e41a0f0fceb42f969de9b529
Author: Sebastian <sebastian@sebsite.pw>
Date:   Wed, 23 Feb 2022 15:11:14 -0500

all: remove trailing whitespace

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mcrypto/aes/aes_ct64.ha | 2+-
Mcrypto/aes/xts/README | 2+-
Mcrypto/aes/xts/xts.ha | 2+-
Mcrypto/authenc.ha | 4++--
Mcrypto/chacha/+test.ha | 2+-
Mcrypto/cipher/stream.ha | 2+-
Mcrypto/hmac/sha256.ha | 2+-
Mnet/dns/encode.ha | 2+-
Mrt/+linux/syscalls.ha | 4+---
Mstrings/trim.ha | 2+-
10 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/crypto/aes/aes_ct64.ha b/crypto/aes/aes_ct64.ha @@ -48,7 +48,7 @@ export type ct64_block = struct { sk_exp: [120]u64, }; -// Returns an AES [[crypto::cipher::block]] cipher implementation optimized for +// Returns an AES [[crypto::cipher::block]] cipher implementation optimized for // constant time operation on 64-bit systems. // // The caller must call [[ct64_init]] to add a key to the cipher before using diff --git a/crypto/aes/xts/README b/crypto/aes/xts/README @@ -14,7 +14,7 @@ key for each block. That means following vulnerabilities exist: - Replay: An adversary may change a block back to an old value, if write access is available. - Changing sectors: Changing of the cipher text will result in "random" plain - text. Authentication or error detection can be done before encryption, to + text. Authentication or error detection can be done before encryption, to resist such attacks. This is a low-level module which implements cryptographic primitives. Direct use diff --git a/crypto/aes/xts/xts.ha b/crypto/aes/xts/xts.ha @@ -10,7 +10,7 @@ export type block = struct { x: [aes::BLOCKSIZE]u8, }; -// Creates a AES-XTS instance. Must be initialized with [[init]] and always be +// Creates a AES-XTS instance. Must be initialized with [[init]] and always be // finished using [[finish]] to erase sensitive state from memory. export fn xts() block = block { b1 = aes::ct64(), diff --git a/crypto/authenc.ha b/crypto/authenc.ha @@ -58,10 +58,10 @@ export type box = (mac, nonce, []u8); // let nonce: crypto::nonce = [0...]; // random::buffer(key); // Or some other means of establishing the key // random::buffer(nonce); -// +// // let buf: [64]u8 = [0...]; // Populate with your message // let box = crypto::encrypt(&key, &nonce, buf[..], buf[..]); -// +// // // To decrypt this message: // let plaintext = match (crypto::decrypt(&key, &box, buf[..])) { // case let buf: []u8 => diff --git a/crypto/chacha/+test.ha b/crypto/chacha/+test.ha @@ -164,7 +164,7 @@ const xcipher: [_]u8 = [ xchacha20_init(&c, &xkey, &xnonce); defer cipher::finish(&c); - // just encrypt a few bytes of each block, to check if setctr works + // just encrypt a few bytes of each block, to check if setctr works setctr(&c, 1); cipher::stream_xor(&c, result[..5], xmsg[..5]); diff --git a/crypto/cipher/stream.ha b/crypto/cipher/stream.ha @@ -7,7 +7,7 @@ export type stream = struct { finish: *fn(s: *stream) void, }; -// Applies xor of the key produced by the stream to src and writes the result +// Applies xor of the key produced by the stream to src and writes the result // in dest. 'dest' and 'src' may be the same slice, and both slices must have // the same length. export fn stream_xor(s: *stream, dest: []u8, src: []u8) void = { diff --git a/crypto/hmac/sha256.ha b/crypto/hmac/sha256.ha @@ -13,7 +13,7 @@ export type sha256state = struct { }; // Creates a [[crypto::mac::mac]] that computes an HMAC with given 'key' using -// SHA256 as underlying hash function. +// SHA256 as underlying hash function. // // The caller must take extra care to call [[mac::finish]] when they are // finished using the MAC function, which, in addition to freeing state diff --git a/net/dns/encode.ha b/net/dns/encode.ha @@ -102,7 +102,7 @@ fn rrecord_encode(enc: *encoder, r: *rrecord) (void | error) = { }; fn encode_op(op: *op) u16 = - (op.qr: u16 << 15u16) | + (op.qr: u16 << 15u16) | (op.opcode: u16 << 11u16) | (if (op.aa) 0b0000010000000000u16 else 0u16) | (if (op.tc) 0b0000001000000000u16 else 0u16) | diff --git a/rt/+linux/syscalls.ha b/rt/+linux/syscalls.ha @@ -234,7 +234,7 @@ export fn sendfile( count: size, ) (size | errno) = wrap_return(syscall4(SYS_sendfile, out: u64, in: u64, offs: uintptr: u64, count: u64))?: size; - + export @noreturn fn exit(status: int) void = syscall1(SYS_exit, status: u64); export fn kill(pid: int, signal: int) (void | errno) = { @@ -273,13 +273,11 @@ export fn munmap(addr: *void, length: size) (void | errno) = { wrap_return(syscall2(SYS_munmap, addr: uintptr: u64, length: u64))?; }; - export fn mprotect(addr: *void, length: size, prot: uint) (void | errno) = { wrap_return(syscall3(SYS_mprotect, addr: uintptr: u64, length: u64, prot: u64))?; }; - export fn lseek(fd: int, off: i64, whence: uint) (i64 | errno) = { return wrap_return(syscall3(SYS_lseek, diff --git a/strings/trim.ha b/strings/trim.ha @@ -81,7 +81,7 @@ export fn trim(input: str, exclude: rune...) str = assert(ltrim("((()(())))())", '(', ')') == ""); assert(ltrim("abacadabra", 'a', 'b', 'c', 'd') == "ra"); assert(ltrim("𝚊𝚋𝚊𝚌𝚊𝚍𝚊𝚋𝚛𝚊", '𝚊', '𝚋', '𝚌', '𝚍') == "𝚛𝚊"); - + assert(rtrim("") == ""); assert(rtrim("hello ") == "hello"); assert(rtrim("hello, world\r\n\r\n") == "hello, world");