Skip to content

Commit 03e982f

Browse files
committed
Version 0.1.1
1 parent c4c5882 commit 03e982f

File tree

4 files changed

+32
-6
lines changed

4 files changed

+32
-6
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Constant-time algorithms written in TypeScript.
3232
* `intdiv(N, D)` - Divide `N` into `D`, discarding remainder.
3333
* Returns an integer.
3434
* `modulo(N, D)` - Divide `N` into `D`, return the remainder.
35+
* Returns an integer.
3536
* `resize(buf, size)` - Return a resized `Uint8Array` object (to side-step memory access leakage)
3637
* `select(x, a, b)` - Read it as a ternary. If `x` is true, returns `a`. Otherwise, returns `b`.
3738
* `x` must be a `boolean`
@@ -49,3 +50,29 @@ Constant-time algorithms written in TypeScript.
4950
* `trim_zeroes_right(buf)`
5051
* `buf` must be a `Uint8Array`
5152
* Returns a `Uint8Array`
53+
54+
## Frequently Asked Questions
55+
56+
### But Why Though?
57+
58+
![Mwahahahahahaha!](https://soatok.files.wordpress.com/2020/04/soatok_stickerpack-evil-laughter.png)
59+
60+
**For science!**
61+
62+
This is a proof-of-concept library, that will eventually implement
63+
all of the algorithms described in [the accompanying blog post](https://soatok.blog/2020/08/27/soatoks-guide-to-side-channel-attacks/).
64+
65+
### What's with the blue {fox, wolf}?
66+
67+
My fursona is a [dhole](https://soatok.blog/2020/08/10/all-about-dholes-and-dhole-fursonas/), not a wolf.
68+
69+
### You should remove your fursona from this so my manager might take it seriously.
70+
71+
I don't owe you anything. I don't owe your manager anything.
72+
73+
Besides, if anyone is bigoted against a [predominantly LGBTQIA+ community](https://furscience.com/research-findings/sex-relationships-pornography/5-1-orientation/),
74+
they're precisely the sort of person whose career I don't want to help.
75+
76+
In sum:
77+
78+
[![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/)

lib/trim.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ export function trim_zeroes_right(buf: Uint8Array): Uint8Array {
2525
* @returns {Uint8Array}
2626
*/
2727
export function trim_zeroes_left(buf: Uint8Array): Uint8Array {
28-
buf.reverse();
29-
buf = trim_zeroes_right(buf);
30-
buf.reverse();
31-
return buf;
28+
const ret = buf.slice();
29+
ret.reverse();
30+
return trim_zeroes_right(ret).reverse();
3231
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "constant-time-js",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Constant-time algorithms in JavaScript",
55
"main": "index.ts",
66
"scripts": {

0 commit comments

Comments
 (0)