summaryrefslogtreecommitdiff
path: root/src/crypto.h
diff options
context:
space:
mode:
authorHans-Christoph Steiner <hans@eds.org>2012-09-20 18:34:38 -0400
committerHans-Christoph Steiner <hans@eds.org>2012-09-20 18:34:38 -0400
commit487e15dc239ccdb3344d1c99ce120e872bab4a74 (patch)
treec986d492f6092ca7b4401d91515f74daed17fae2 /src/crypto.h
parent7bb481fda9ecb134804b49c2ce77ca28f7eea583 (diff)
Imported Upstream version 2.0.6
Diffstat (limited to 'src/crypto.h')
-rw-r--r--src/crypto.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/crypto.h b/src/crypto.h
index a5a62ec..c0e07ae 100644
--- a/src/crypto.h
+++ b/src/crypto.h
@@ -37,6 +37,10 @@
#define FILE_HEADER_SZ 16
+#ifndef CIPHER_VERSION
+#define CIPHER_VERSION "2.0.6"
+#endif
+
#ifndef CIPHER
#define CIPHER "aes-256-cbc"
#endif
@@ -78,9 +82,23 @@
#define CODEC_TRACE(X)
#endif
+#ifdef CODEC_DEBUG_PAGEDATA
+#define CODEC_HEXDUMP(DESC,BUFFER,LEN) \
+ { \
+ int __pctr; \
+ printf(DESC); \
+ for(__pctr=0; __pctr < LEN; __pctr++) { \
+ if(__pctr % 16 == 0) printf("\n%05x: ",__pctr); \
+ printf("%02x ",((unsigned char*) BUFFER)[__pctr]); \
+ } \
+ printf("\n"); \
+ fflush(stdout); \
+ }
+#else
+#define CODEC_HEXDUMP(DESC,BUFFER,LEN)
+#endif
-/* extensions defined in pragma.c */
-
+/* extensions defined in pager.c */
void sqlite3pager_get_codec(Pager *pPager, void **ctx);
int sqlite3pager_is_mj_pgno(Pager *pPager, Pgno pgno);
sqlite3_file *sqlite3Pager_get_fd(Pager *pPager);
@@ -91,7 +109,8 @@ void sqlite3pager_sqlite3PagerSetCodec(
void (*xCodecFree)(void*),
void *pCodec
);
-/* end extensions defined in pragma.c */
+void sqlite3pager_sqlite3PagerSetError(Pager *pPager, int error);
+/* end extensions defined in pager.c */
/*
** Simple shared routines for converting hex char strings to binary data
@@ -114,6 +133,7 @@ static void cipher_hex2bin(const char *hex, int sz, unsigned char *out){
typedef struct codec_ctx codec_ctx;
/* utility functions */
+int sqlcipher_ismemset(const unsigned char *a0, unsigned char value, int len);
int sqlcipher_memcmp(const unsigned char *a0, const unsigned char *a1, int len);
int sqlcipher_pseudorandom(void *, int);
void sqlcipher_free(void *, int);
@@ -149,6 +169,8 @@ void* sqlcipher_codec_ctx_get_data(codec_ctx *);
void sqlcipher_exportFunc(sqlite3_context *, int, sqlite3_value **);
+void sqlcipher_set_default_use_hmac(int use);
+
int sqlcipher_codec_ctx_set_use_hmac(codec_ctx *ctx, int use);
/* end extensions defined in crypto_impl.c */