X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fbluesky-private.h;h=dfcb7c54443362ee4a797c481a32629ad632be4e;hb=818d00b4cceab93949aec208c8555aa8c409a0f2;hp=74b4e06784d6a32663b1315c2ea8c86f6b4faab4;hpb=f32dd89994b4f01a78d024bd1aa2ed41f526b8c8;p=bluesky.git diff --git a/bluesky/bluesky-private.h b/bluesky/bluesky-private.h index 74b4e06..dfcb7c5 100644 --- a/bluesky/bluesky-private.h +++ b/bluesky/bluesky-private.h @@ -75,6 +75,14 @@ void bluesky_crypt_derive_keys(BlueSkyCryptKeys *keys, const gchar *master); BlueSkyRCStr *bluesky_crypt_encrypt(BlueSkyRCStr *in, const uint8_t *key); BlueSkyRCStr *bluesky_crypt_decrypt(BlueSkyRCStr *in, const uint8_t *key); +void bluesky_crypt_block_encrypt(gchar *cloud_block, size_t len, + BlueSkyCryptKeys *keys); +gboolean bluesky_crypt_block_decrypt(gchar *cloud_block, size_t len, + BlueSkyCryptKeys *keys); +void bluesky_cloudlog_encrypt(GString *segment, BlueSkyCryptKeys *keys); +void bluesky_cloudlog_decrypt(char *segment, size_t len, + BlueSkyCryptKeys *keys); + /* Storage layer. Requests can be performed asynchronously, so these objects * help keep track of operations in progress. */ typedef enum { @@ -240,6 +248,7 @@ struct cloudlog_header { #define JOURNAL_MAGIC "\nLog" #define CLOUDLOG_MAGIC "AgI-" +#define CLOUDLOG_MAGIC_ENCRYPTED "AgI=" // CLOUDLOG_MAGIC[3] ^= 0x10 /* A record which tracks an object which has been written to a local log, * cached, locally, and/or written to the cloud. */