|
cwist
Modern C web framework with libttak runtime
|
Small SHA-1 and Base64 helpers used by the WebSocket handshake path. More...

Go to the source code of this file.
Macros | |
| #define | ROL(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) |
| #define | blk0(i) (block->l[i] = (ROL(block->l[i], 24) & 0xFF00FF00) | (ROL(block->l[i], 8) & 0x00FF00FF)) |
| #define | blk(i) |
| #define | R0(v, w, x, y, z, i) |
| #define | R1(v, w, x, y, z, i) |
| #define | R2(v, w, x, y, z, i) |
| #define | R3(v, w, x, y, z, i) |
| #define | R4(v, w, x, y, z, i) |
Functions | |
| void | sha1 (const uint8_t *data, size_t len, uint8_t *hash) |
| Compute a SHA-1 digest for the provided input bytes. | |
| char * | base64_encode (const uint8_t *data, size_t input_length, size_t *output_length) |
| Base64-encode binary data for WebSocket handshake header generation. | |
Small SHA-1 and Base64 helpers used by the WebSocket handshake path.
Definition in file ws_utils.c.
| #define blk0 | ( | i | ) | (block->l[i] = (ROL(block->l[i], 24) & 0xFF00FF00) | (ROL(block->l[i], 8) & 0x00FF00FF)) |
Definition at line 17 of file ws_utils.c.
| #define ROL | ( | value, | |
| bits | |||
| ) | (((value) << (bits)) | ((value) >> (32 - (bits)))) |
Definition at line 11 of file ws_utils.c.
Base64-encode binary data for WebSocket handshake header generation.
Base64-encode a byte buffer for handshake header generation.
| data | Input bytes to encode. |
| input_length | Number of input bytes. |
| output_length | Output parameter that receives the encoded length. |
Definition at line 258 of file ws_utils.c.
References cap, and cwist_alloc().
Referenced by cwist_websocket_upgrade_response().
Compute a SHA-1 digest for the provided input bytes.
Compute the SHA-1 digest for a byte range.
| data | Input bytes to hash. |
| len | Number of bytes in data. |
| hash | Output buffer that receives the 20-byte digest. |
Definition at line 235 of file ws_utils.c.
References cap.
Referenced by cwist_websocket_upgrade_response().