aboutsummaryrefslogtreecommitdiffstats
path: root/serve/crypto.h
diff options
context:
space:
mode:
Diffstat (limited to 'serve/crypto.h')
-rw-r--r--serve/crypto.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/serve/crypto.h b/serve/crypto.h
index 5083b23..4919c49 100644
--- a/serve/crypto.h
+++ b/serve/crypto.h
@@ -8,7 +8,7 @@
* first time a server seals, opens a seal or connects to an https receiver
* (serve/crypto.c): one that does none of these maps no OpenSSL, 2.3 MiB
* less resident and 0.6 MiB less of its own. */
-enum { PURE_CRYPTO_VERSION = 1 };
+enum { PURE_CRYPTO_VERSION = 2 };
typedef struct {
unsigned version;
@@ -20,12 +20,18 @@ typedef struct {
int (*tls_read)(PureTls *, void *bytes, int size);
int (*tls_write)(PureTls *, const void *bytes, int size);
void (*tls_close)(PureTls *);
- /* Sealing, as serve/seal.h says, in the suite named. */
+ /* Sealing, as serve/seal.h says; a sender's sessions in the suite named. */
PureSealKey *(*seal_key)(const char *path, char public_hex[2 * PURE_SEAL_KEY + 1], char *error, size_t size);
void (*seal_key_free)(PureSealKey *);
- bool (*seal)(const char *suite, const unsigned char peer[PURE_SEAL_KEY], const char *aad,
- const unsigned char *plain, size_t size, unsigned char *out);
- bool (*unseal)(const PureSealKey *, const char *suite, const char *aad, const unsigned char *sealed, size_t size,
+ PureSealer *(*sealer)(const char *suite, const unsigned char peer[PURE_SEAL_KEY], const PureSealKey *own,
+ unsigned char enc[PURE_SEAL_KEY]);
+ bool (*seal)(PureSealer *, const char *aad, const unsigned char *plain, size_t size, unsigned char *out,
+ uint64_t *n);
+ void (*sealer_free)(PureSealer *);
+ PureOpener *(*opener)(const PureSealKey *, const char *suite, const unsigned char enc[PURE_SEAL_KEY],
+ const unsigned char *from);
+ bool (*unseal)(PureOpener *, uint64_t n, const char *aad, const unsigned char *sealed, size_t size,
unsigned char *plain);
+ void (*opener_free)(PureOpener *);
} PureCrypto;
#endif