Skip to content

Commit

Permalink
Version 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
soatok committed Sep 29, 2020
1 parent c4c5882 commit 03e982f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Constant-time algorithms written in TypeScript.
* `intdiv(N, D)` - Divide `N` into `D`, discarding remainder.
* Returns an integer.
* `modulo(N, D)` - Divide `N` into `D`, return the remainder.
* Returns an integer.
* `resize(buf, size)` - Return a resized `Uint8Array` object (to side-step memory access leakage)
* `select(x, a, b)` - Read it as a ternary. If `x` is true, returns `a`. Otherwise, returns `b`.
* `x` must be a `boolean`
Expand All @@ -49,3 +50,29 @@ Constant-time algorithms written in TypeScript.
* `trim_zeroes_right(buf)`
* `buf` must be a `Uint8Array`
* Returns a `Uint8Array`

## Frequently Asked Questions

### But Why Though?

![Mwahahahahahaha!](https://soatok.files.wordpress.com/2020/04/soatok_stickerpack-evil-laughter.png)

**For science!**

This is a proof-of-concept library, that will eventually implement
all of the algorithms described in [the accompanying blog post](https://soatok.blog/2020/08/27/soatoks-guide-to-side-channel-attacks/).

### What's with the blue {fox, wolf}?

My fursona is a [dhole](https://soatok.blog/2020/08/10/all-about-dholes-and-dhole-fursonas/), not a wolf.

### You should remove your fursona from this so my manager might take it seriously.

I don't owe you anything. I don't owe your manager anything.

Besides, if anyone is bigoted against a [predominantly LGBTQIA+ community](https://furscience.com/research-findings/sex-relationships-pornography/5-1-orientation/),
they're precisely the sort of person whose career I don't want to help.

In sum:

[![I will increase the thing](https://soatok.files.wordpress.com/2020/07/increase-the-thing.png)](https://soatok.blog/2020/07/09/a-word-on-anti-furry-sentiments-in-the-tech-community/)
7 changes: 3 additions & 4 deletions lib/trim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export function trim_zeroes_right(buf: Uint8Array): Uint8Array {
* @returns {Uint8Array}
*/
export function trim_zeroes_left(buf: Uint8Array): Uint8Array {
buf.reverse();
buf = trim_zeroes_right(buf);
buf.reverse();
return buf;
const ret = buf.slice();
ret.reverse();
return trim_zeroes_right(ret).reverse();
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "constant-time-js",
"version": "0.1.0",
"version": "0.1.1",
"description": "Constant-time algorithms in JavaScript",
"main": "index.ts",
"scripts": {
Expand Down

0 comments on commit 03e982f

Please sign in to comment.