ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
keymask.h File Reference

Go to the source code of this file.

Macros

#define KEYMASK_DIGEST_SIZE   32
#define KEYMASK_WIDTH   34
#define KEYMASK_ROWS   18
#define KEYMASK_BUFFER_SIZE   1655

Functions

asciichat_error_t key_fingerprint_digest (const uint8_t public_key[ED25519_PUBLIC_KEY_SIZE], uint8_t digest[32])
asciichat_error_t keymask_render (const uint8_t digest[32], bool unicode, char *out, size_t size)

Macro Definition Documentation

◆ KEYMASK_BUFFER_SIZE

#define KEYMASK_BUFFER_SIZE   1655

Definition at line 13 of file keymask.h.

Referenced by key_identity_format().

◆ KEYMASK_DIGEST_SIZE

#define KEYMASK_DIGEST_SIZE   32

◆ KEYMASK_ROWS

#define KEYMASK_ROWS   18

Definition at line 11 of file keymask.h.

Referenced by key_identity_art_end(), and keymask_render().

◆ KEYMASK_WIDTH

#define KEYMASK_WIDTH   34

Definition at line 10 of file keymask.h.

Referenced by key_identity_art_end(), key_identity_format(), and keymask_render().

Function Documentation

◆ key_fingerprint_digest()

asciichat_error_t key_fingerprint_digest ( const uint8_t public_key[ED25519_PUBLIC_KEY_SIZE],
uint8_t digest[32] )

SHA-256 of the 32 public-key bytes, independent of key source or encoding.

References ED25519_PUBLIC_KEY_SIZE, and KEYMASK_DIGEST_SIZE.

◆ keymask_render()

asciichat_error_t keymask_render ( const uint8_t digest[32],
bool unicode,
char * out,
size_t size )

Keymask v2: domain-separated constructed mask from the public-key digest. ASCII and UTF-8 represent the same geometry. No terminal I/O or allocations. This is a recognition aid; exact and perceptual collisions are possible.

References KEYMASK_DIGEST_SIZE, and out.