code wiki / (root) / nx_ws_crypto.nx

nx_ws_crypto.nx

buildroot/runtime/nx_ws_crypto.nx

6877 B226 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic ws
docsdependenciesstructsconstsfunctions

about

nx_ws_crypto.nx -- minimal SHA-1 + Base64 used by nx_websocket. Standalone copy that imports nx_syscalls_x86_64.nx directly so the x86_64 codec/comms toolchain doesn't pull in the RV64 syscall numbers via runtime/nx_sha1.nx + runtime/nx_base64.nx (which import "nx_syscalls.nx" -- the RV64 file). Same math, same constants; functions renamed `_wsx_*` to avoid symbol collision when both ecosystems coexist in one binary. genealogy_id: rfc_3174_sha1 + rfc_4648_base64 + nx_sha1_q10 + nx_base64_q10 lineage_id: nishi_ws_crypto_q10

dependencies 1 imports · 1 importers

nx_syscalls_x86_64.nx nx_ws_crypto.nx nx_websocket.nx

imports: nx_syscalls_x86_64.nx

imported by: nx_websocket.nx

structs

none

consts

20const _WSX_SHA1_H0: i64 = 0x67452301
21const _WSX_SHA1_H1: i64 = 0xEFCDAB89
22const _WSX_SHA1_H2: i64 = 0x98BADCFE
23const _WSX_SHA1_H3: i64 = 0x10325476
24const _WSX_SHA1_H4: i64 = 0xC3D2E1F0
26const _WSX_SHA1_K0: i64 = 0x5A827999
27const _WSX_SHA1_K1: i64 = 0x6ED9EBA1
28const _WSX_SHA1_K2: i64 = 0x8F1BBCDC
29const _WSX_SHA1_K3: i64 = 0xCA62C1D6
31const _WSX_M32: i64 = 0xFFFFFFFF
181const _WSX_B64_PAD: i64 = 0x3D

functions

33func _wsx_rotl(x: i64, k: i64) -> i64
called by 1: _wsx_sha1_block
44func _wsx_sha1_block(buf: *u8, off: i64, state: *i64) -> i64
called by 1: nx_wsx_sha1 calls 1: _wsx_rotl
112func _wsx_if_ge(a: i64, b: i64, v1: i64, v2: i64) -> i64
called by 1: nx_wsx_sha1
118func nx_wsx_sha1(data: *u8, n: i64, out: *u8) -> i64
183func _wsx_b64_char(n: i64) -> i64
called by 1: nx_wsx_b64_encode
193func nx_wsx_b64_encode(in_bytes: *u8, n: i64, out: *u8) -> i64
called by 1: nx_ws_accept_key calls 1: _wsx_b64_char