💾 Archived View for gmi.noulin.net › gitRepositories › heartbeat › file › sel.h.gmi captured on 2024-06-20 at 11:56:00. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

heartbeat

Log

Files

Refs

README

sel.h (570B)

     1 #pragma once
     2 
     3 #include "sodium.h"
     4 
     5 #ifndef u8
     6 #define u8  uint8_t
     7 #endif
     8 
     9 typedef struct {
    10         u8 publicKey[crypto_box_PUBLICKEYBYTES];
    11         u8 secretKey[crypto_box_SECRETKEYBYTES];
    12         u8 remotePublicKey[crypto_box_PUBLICKEYBYTES];
    13         u8 nonce[crypto_box_NONCEBYTES];
    14 } keyst;
    15 
    16 /*
    17 These functions return 0 when they fail.
    18 */
    19 
    20 int selInit(void);
    21 void newKeysBuf(keyst *keys);
    22 int selPublicEncrypt(u8 *ciphertext/*result*/, size_t csize, const u8 *msg, size_t mlen, keyst *keys);
    23 int selPublicDecrypt(u8 *msg/*result*/, size_t msize, const u8 *ciphertext, size_t clen, keyst *keys);