Skip to content

Instantly share code, notes, and snippets.

@Sc00bz
Sc00bz / pake-api.md
Last active January 15, 2023 11:38
PAKE API

PAKE API

Goal

The goal of this API is to make it easy to use and misuse resistant. The bulk of the code using this API can be reused. With the only difference being the start() call and getting the server secret at the end when registering. When registering, the server passes a null/empty secret to start() since it doesn't have one yet. Also start() might not return a message. This is fine. It just means the other party sends the first message.

Pseudocode API

PAKE_USER_CLIENT
PAKE_USER_SERVER
PAKE_USER_A
@Sc00bz
Sc00bz / cpace-mg.txt
Last active January 31, 2023 16:16
CPace is a balanced PAKE and defined on multiplicative groups
CPace (defined on multiplicative groups)
CPace is the best balanced PAKE that I know of. CPace defined on ECC can be
found here:
https://gist.github.com/Sc00bz/545eb39a369b67242634bd9c3302627c
Costs per step
A: - *^^
B: *^ ^
@Sc00bz
Sc00bz / adx.asm
Created March 4, 2023 02:17
"z[] += x[] * y" with ADX instruction set *untested*
# Related to https://abyssdomain.expert/@filippo/109925743627302756
# // len(z) == len(x)... or len(z) <= len(x) and everything is based on len(z)
# // z[] += x[] * y
# // c = overflow (ie c is "z[len(z)]")
# func addMulVVW(z, x []uint, y uint) (c uint)
# {
lea RSI,[x] # RSI = "&x"
lea RDI,[z] # RDI = "&z"
@Sc00bz
Sc00bz / bs-speke-mg.txt
Last active April 24, 2023 10:50
BS-SPEKE is an augmented PAKE and defined on multiplicative groups
BS-SPEKE (defined on multiplicative groups)
BS-SPEKE is a modified B-SPEKE with blind salt (OPRF). Modified B-SPEKE is a
similar change from SPEKE as from SPAKE2 to SPAKE2+ to make it augmented. Doing
this saves a scalar point multiply vs original B-SPEKE with blind salt. BS-SPEKE
is the best augmented PAKE that I know of. Only problem is there are no proofs,
but it's not hard to take the SPEKE proof, add the OPAQUE proof for OPRF, and
it's obvious that the augmented change makes it augmented. So if anyone knows
how to formally state that in a proof, that would be awesome to have. BS-SPEKE
defined on ECC can be found here:
@Sc00bz
Sc00bz / double-bs-speke.txt
Last active May 6, 2023 10:32
Double BS-SPEKE is an doubly augmented PAKE
Double BS-SPEKE
Double BS-SPEKE is BS-SPEKE but with 3DH vs Noise-KN to make it a doubly
augmented PAKE. Double BS-SPEKE is the best doubly augmented PAKE that I know
of. Only problem is there are no proofs, but it's not hard to take the SPEKE
proof, add the OPAQUE proof for OPRF, and it's obvious that the doubly augmented
change makes it doubly augmented. So if anyone knows how to formally state that
in a proof, that would be awesome to have. BS-SPEKE defined on multiplicative
groups can be found here:
https://gist.github.com/Sc00bz/ec1f5fcfd18533bf0d6bf31d1211d4b4