/ Check-in [a48a7b78]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make the sha3 extension part of the amalgamation, enabled using SQLITE_ENABLE_SHA3.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sha3
Files: files | file ages | folders
SHA3-256: a48a7b78597c1551fd4e29b9a733ab8c8a60ad82721b90d7f645987ca65cee6e
User & Date: drh 2019-08-12 15:19:24
Context
2019-08-12
15:37
Fix the build for compilation using separate files rather than the amalgamation. Leaf check-in: 1e0f4869 user: drh tags: sha3
15:19
Make the sha3 extension part of the amalgamation, enabled using SQLITE_ENABLE_SHA3. check-in: a48a7b78 user: drh tags: sha3
14:17
Add a TESTCTRL that disables the verification of type, name, and tbl_name in the sqlite_master table. check-in: 48d9b48a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Makefile.in.

   182    182            icu.lo insert.lo json1.lo legacy.lo loadext.lo \
   183    183            main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
   184    184            memdb.lo memjournal.lo \
   185    185            mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
   186    186            notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
   187    187            pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
   188    188            random.lo resolve.lo rowset.lo rtree.lo \
   189         -         sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
          189  +         sqlite3session.lo select.lo shathree.lo sqlite3rbu.lo status.lo stmt.lo \
   190    190            table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
   191    191            update.lo userauth.lo upsert.lo util.lo vacuum.lo \
   192    192            vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
   193    193            vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
   194    194            window.lo utf.lo vtab.lo
   195    195   
   196    196   # Object files for the amalgamation.
................................................................................
   360    360     $(TOP)/ext/userauth/userauth.c \
   361    361     $(TOP)/ext/userauth/sqlite3userauth.h
   362    362   SRC += \
   363    363     $(TOP)/ext/rbu/sqlite3rbu.h \
   364    364     $(TOP)/ext/rbu/sqlite3rbu.c
   365    365   SRC += \
   366    366     $(TOP)/ext/misc/json1.c \
          367  +  $(TOP)/ext/misc/shathree.c \
   367    368     $(TOP)/ext/misc/stmt.c
   368    369   
   369    370   # Generated source code files
   370    371   #
   371    372   SRC += \
   372    373     keywordhash.h \
   373    374     opcodes.c \
................................................................................
   596    597   # Standard options to testfixture
   597    598   #
   598    599   TESTOPTS = --verbose=file --output=test-out.txt
   599    600   
   600    601   # Extra compiler options for various shell tools
   601    602   #
   602    603   SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
          604  +SHELL_OPT += -DSQLITE_ENABLE_SHA3
   603    605   #SHELL_OPT += -DSQLITE_ENABLE_FTS5
   604    606   SHELL_OPT += -DSQLITE_ENABLE_RTREE
   605    607   SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
   606    608   SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
   607    609   SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
   608    610   SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
   609    611   SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
   610    612   SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
   611    613   SHELL_OPT += -DSQLITE_ENABLE_DESERIALIZE
   612    614   SHELL_OPT += -DSQLITE_INTROSPECTION_PRAGMAS
   613         -FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
          615  +FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_SHA3
   614    616   FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ
          617  +FUZZCHECK_OPT += -DSQLITE_ENABLE_SHA3
   615    618   FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
   616    619   FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
   617    620   FUZZCHECK_OPT += -DSQLITE_ENABLE_DESERIALIZE
   618    621   FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
   619    622   #FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS5
   620    623   FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
   621    624   FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
................................................................................
  1152   1155   
  1153   1156   sqlite3session.lo:	$(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
  1154   1157   	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
  1155   1158   
  1156   1159   json1.lo:	$(TOP)/ext/misc/json1.c
  1157   1160   	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
  1158   1161   
         1162  +shathree.lo:	$(TOP)/ext/misc/shathree.c
         1163  +	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/shathree.c
         1164  +
  1159   1165   stmt.lo:	$(TOP)/ext/misc/stmt.c
  1160   1166   	$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
  1161   1167   
  1162   1168   # FTS5 things
  1163   1169   #
  1164   1170   FTS5_SRC = \
  1165   1171      $(TOP)/ext/fts5/fts5.h \

Changes to Makefile.msc.

   344    344   #
   345    345   !IFNDEF OPT_FEATURE_FLAGS
   346    346   !IF $(MINIMAL_AMALGAMATION)==0
   347    347   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
   348    348   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
   349    349   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1
   350    350   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_JSON1=1
          351  +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SHA3=1
   351    352   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
   352    353   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
   353    354   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
   354    355   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1
   355    356   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1
   356    357   !ENDIF
   357    358   OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
................................................................................
  1226   1227            icu.lo insert.lo json1.lo legacy.lo loadext.lo \
  1227   1228            main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \
  1228   1229            memdb.lo memjournal.lo \
  1229   1230            mutex.lo mutex_noop.lo mutex_unix.lo mutex_w32.lo \
  1230   1231            notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
  1231   1232            pager.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
  1232   1233            random.lo resolve.lo rowset.lo rtree.lo \
  1233         -         sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
         1234  +         sqlite3session.lo select.lo shathree.lo sqlite3rbu.lo status.lo stmt.lo \
  1234   1235            table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
  1235   1236            update.lo upsert.lo util.lo vacuum.lo \
  1236   1237            vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
  1237   1238            vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
  1238   1239            window.lo utf.lo vtab.lo
  1239   1240   # <</mark>>
  1240   1241   
................................................................................
  1415   1416     $(TOP)\ext\fts3\fts3_unicode2.c \
  1416   1417     $(TOP)\ext\fts3\fts3_write.c \
  1417   1418     $(TOP)\ext\icu\icu.c \
  1418   1419     $(TOP)\ext\rtree\rtree.c \
  1419   1420     $(TOP)\ext\session\sqlite3session.c \
  1420   1421     $(TOP)\ext\rbu\sqlite3rbu.c \
  1421   1422     $(TOP)\ext\misc\json1.c \
         1423  +  $(TOP)\ext\misc\shathree.c \
  1422   1424     $(TOP)\ext\misc\stmt.c
  1423   1425   
  1424   1426   # Extension header files, part 1.
  1425   1427   #
  1426   1428   SRC08 = \
  1427   1429     $(TOP)\ext\fts1\fts1.h \
  1428   1430     $(TOP)\ext\fts1\fts1_hash.h \
................................................................................
  1661   1663   SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_DESERIALIZE=1
  1662   1664   !ENDIF
  1663   1665   
  1664   1666   # <<mark>>
  1665   1667   # Extra compiler options for various test tools.
  1666   1668   #
  1667   1669   MPTESTER_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5
  1668         -FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1
         1670  +FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_SHA3
  1669   1671   FUZZCHECK_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000 -DSQLITE_PRINTF_PRECISION_LIMIT=1000
         1672  +FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_SHA3
  1670   1673   FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DESERIALIZE
  1671   1674   FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS4
  1672   1675   FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_RTREE
  1673   1676   FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_GEOPOLY
  1674   1677   FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DBSTAT_VTAB
  1675   1678   
  1676   1679   FUZZCHECK_SRC = $(TOP)\test\fuzzcheck.c $(TOP)\test\ossfuzz.c
................................................................................
  2249   2252   
  2250   2253   fts3_write.lo:	$(TOP)\ext\fts3\fts3_write.c $(HDR) $(EXTHDR)
  2251   2254   	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\fts3\fts3_write.c
  2252   2255   
  2253   2256   json1.lo:	$(TOP)\ext\misc\json1.c $(HDR) $(EXTHDR)
  2254   2257   	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\misc\json1.c
  2255   2258   
         2259  +shathree.lo:	$(TOP)\ext\misc\shathree.c $(HDR) $(EXTHDR)
         2260  +	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\misc\shathree.c
         2261  +
  2256   2262   stmt.lo:	$(TOP)\ext\misc\stmt.c $(HDR) $(EXTHDR)
  2257   2263   	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\misc\stmt.c
  2258   2264   
  2259   2265   rtree.lo:	$(TOP)\ext\rtree\rtree.c $(HDR) $(EXTHDR)
  2260   2266   	$(LTCOMPILE) $(CORE_COMPILE_OPTS) $(NO_WARN) -DSQLITE_CORE -c $(TOP)\ext\rtree\rtree.c
  2261   2267   
  2262   2268   sqlite3session.lo:	$(TOP)\ext\session\sqlite3session.c $(HDR) $(EXTHDR)
................................................................................
  2337   2343   TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
  2338   2344   TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
  2339   2345   TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
  2340   2346   TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
  2341   2347   TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
  2342   2348   TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
  2343   2349   TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_JSON1=1
         2350  +TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_SHA3=1
  2344   2351   TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1
  2345   2352   TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
  2346   2353   
  2347   2354   TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
  2348   2355   TESTFIXTURE_SRC1 = $(TESTEXT) $(SQLITE3C)
  2349   2356   !IF $(USE_AMALGAMATION)==0
  2350   2357   TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)

Changes to ext/misc/shathree.c.

    22     22   ** The sha3_query(Y) function evalutes all queries in the SQL statements of Y
    23     23   ** and returns a hash of their results.
    24     24   **
    25     25   ** The SIZE argument is optional.  If omitted, the SHA3-256 hash algorithm
    26     26   ** is used.  If SIZE is included it must be one of the integers 224, 256,
    27     27   ** 384, or 512, to determine SHA3 hash variant that is computed.
    28     28   */
           29  +#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_SHA3)
           30  +#if !defined(SQLITEINT_H)
    29     31   #include "sqlite3ext.h"
           32  +#endif
    30     33   SQLITE_EXTENSION_INIT1
    31     34   #include <assert.h>
    32     35   #include <string.h>
    33     36   #include <stdarg.h>
           37  +#ifndef SQLITE_CORE
    34     38   typedef sqlite3_uint64 u64;
           39  +#endif
    35     40   
    36     41   /******************************************************************************
    37     42   ** The Hash Engine
    38     43   */
    39     44   /*
    40     45   ** Macros to determine whether the machine is big or little endian,
    41     46   ** and whether or not that determination is run-time or compile-time.
................................................................................
   680    685         }
   681    686       }
   682    687       sqlite3_finalize(pStmt);
   683    688     }
   684    689     sqlite3_result_blob(context, SHA3Final(&cx), iSize/8, SQLITE_TRANSIENT);
   685    690   }
   686    691   
   687         -
   688         -#ifdef _WIN32
   689         -__declspec(dllexport)
   690         -#endif
   691         -int sqlite3_shathree_init(
   692         -  sqlite3 *db,
   693         -  char **pzErrMsg,
   694         -  const sqlite3_api_routines *pApi
   695         -){
          692  +/*
          693  +** Register the SHA3 functions on the database connection db.
          694  +** Return any errors encountered.
          695  +*/
          696  +int sqlite3Sha3Init(sqlite3 *db){
   696    697     int rc = SQLITE_OK;
   697         -  SQLITE_EXTENSION_INIT2(pApi);
   698         -  (void)pzErrMsg;  /* Unused parameter */
   699    698     rc = sqlite3_create_function(db, "sha3", 1, SQLITE_UTF8, 0,
   700    699                                  sha3Func, 0, 0);
   701    700     if( rc==SQLITE_OK ){
   702    701       rc = sqlite3_create_function(db, "sha3", 2, SQLITE_UTF8, 0,
   703    702                                    sha3Func, 0, 0);
   704    703     }
   705    704     if( rc==SQLITE_OK ){
................................................................................
   708    707     }
   709    708     if( rc==SQLITE_OK ){
   710    709       rc = sqlite3_create_function(db, "sha3_query", 2, SQLITE_UTF8, 0,
   711    710                                    sha3QueryFunc, 0, 0);
   712    711     }
   713    712     return rc;
   714    713   }
          714  +
          715  +/*
          716  +** Registration entry point for when this module is compiled as a shared
          717  +** library.
          718  +*/
          719  +#ifndef SQLITE_CORE
          720  +#ifdef _WIN32
          721  +__declspec(dllexport)
          722  +#endif
          723  +int sqlite3_shathree_init(
          724  +  sqlite3 *db,
          725  +  char **pzErrMsg,
          726  +  const sqlite3_api_routines *pApi
          727  +){
          728  +  int rc = SQLITE_OK;
          729  +  SQLITE_EXTENSION_INIT2(pApi);
          730  +  (void)pzErrMsg;  /* Unused parameter */
          731  +  return sqlite3Sha3Init(db);
          732  +}
          733  +#endif /* SQLITE_CORE */
          734  +#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_SHA3) */

Changes to main.mk.

    66     66            icu.o insert.o json1.o legacy.o loadext.o \
    67     67            main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \
    68     68            memdb.o memjournal.o \
    69     69            mutex.o mutex_noop.o mutex_unix.o mutex_w32.o \
    70     70            notify.o opcodes.o os.o os_unix.o os_win.o \
    71     71            pager.o pcache.o pcache1.o pragma.o prepare.o printf.o \
    72     72            random.o resolve.o rowset.o rtree.o \
    73         -         select.o sqlite3rbu.o status.o stmt.o \
           73  +         select.o shathree.o sqlite3rbu.o status.o stmt.o \
    74     74            table.o threads.o tokenize.o treeview.o trigger.o \
    75     75            update.o upsert.o userauth.o util.o vacuum.o \
    76     76            vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o vdbesort.o \
    77     77   	 vdbetrace.o wal.o walker.o where.o wherecode.o whereexpr.o \
    78     78            utf.o vtab.o window.o
    79     79   
    80     80   LIBOBJ += sqlite3session.o
................................................................................
   238    238     $(TOP)/ext/userauth/userauth.c \
   239    239     $(TOP)/ext/userauth/sqlite3userauth.h
   240    240   SRC += \
   241    241     $(TOP)/ext/rbu/sqlite3rbu.c \
   242    242     $(TOP)/ext/rbu/sqlite3rbu.h
   243    243   SRC += \
   244    244     $(TOP)/ext/misc/json1.c \
          245  +  $(TOP)/ext/misc/shathree.c \
   245    246     $(TOP)/ext/misc/stmt.c
   246    247   
   247    248   
   248    249   # FTS5 things
   249    250   #
   250    251   FTS5_HDR = \
   251    252      $(TOP)/ext/fts5/fts5.h \
................................................................................
   516    517   # Standard options to testfixture
   517    518   #
   518    519   TESTOPTS = --verbose=file --output=test-out.txt
   519    520   
   520    521   # Extra compiler options for various shell tools
   521    522   #
   522    523   SHELL_OPT += -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
          524  +SHELL_OPT += -DSQLITE_ENABLE_SHA3
   523    525   SHELL_OPT += -DSQLITE_ENABLE_RTREE
   524    526   SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
   525    527   SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
   526    528   SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
   527    529   SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
   528    530   SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
   529    531   SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
   530    532   SHELL_OPT += -DSQLITE_INTROSPECTION_PRAGMAS
   531         -FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
          533  +FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_SHA3
   532    534   FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
          535  +FUZZCHECK_OPT += -DSQLITE_ENABLE_SHA3
   533    536   FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
   534    537   FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
   535    538   FUZZCHECK_OPT += -DSQLITE_ENABLE_DESERIALIZE
   536    539   FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4
   537    540   FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
   538    541   FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
   539    542   FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
................................................................................
   810    813   
   811    814   fts5.o:	fts5.c
   812    815   	$(TCCX) -DSQLITE_CORE -c fts5.c
   813    816   
   814    817   json1.o:	$(TOP)/ext/misc/json1.c
   815    818   	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
   816    819   
          820  +shathree.o:	$(TOP)/ext/misc/shathree.c
          821  +	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/shathree.c
          822  +
   817    823   stmt.o:	$(TOP)/ext/misc/stmt.c
   818    824   	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
   819    825   
   820    826   rtree.o:	$(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
   821    827   	$(TCCX) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
   822    828   
   823    829   

Changes to src/ctime.c.

   290    290     "ENABLE_RTREE",
   291    291   #endif
   292    292   #if SQLITE_ENABLE_SELECTTRACE
   293    293     "ENABLE_SELECTTRACE",
   294    294   #endif
   295    295   #if SQLITE_ENABLE_SESSION
   296    296     "ENABLE_SESSION",
          297  +#endif
          298  +#if SQLITE_ENABLE_SHA3
          299  +  "ENABLE_SHA3",
   297    300   #endif
   298    301   #if SQLITE_ENABLE_SNAPSHOT
   299    302     "ENABLE_SNAPSHOT",
   300    303   #endif
   301    304   #if SQLITE_ENABLE_SORTER_REFERENCES
   302    305     "ENABLE_SORTER_REFERENCES",
   303    306   #endif

Changes to src/main.c.

    24     24   #endif
    25     25   #if defined(SQLITE_ENABLE_ICU) || defined(SQLITE_ENABLE_ICU_COLLATIONS)
    26     26   # include "sqliteicu.h"
    27     27   #endif
    28     28   #ifdef SQLITE_ENABLE_JSON1
    29     29   int sqlite3Json1Init(sqlite3*);
    30     30   #endif
           31  +#ifdef SQLITE_ENABLE_SHA3
           32  +int sqlite3Sha3Init(sqlite3*);
           33  +#endif
    31     34   #ifdef SQLITE_ENABLE_STMTVTAB
    32     35   int sqlite3StmtVtabInit(sqlite3*);
    33     36   #endif
    34     37   #ifdef SQLITE_ENABLE_FTS5
    35     38   int sqlite3Fts5Init(sqlite3*);
    36     39   #endif
    37     40   
................................................................................
  3295   3298   #endif
  3296   3299   
  3297   3300   #ifdef SQLITE_ENABLE_JSON1
  3298   3301     if( !db->mallocFailed && rc==SQLITE_OK){
  3299   3302       rc = sqlite3Json1Init(db);
  3300   3303     }
  3301   3304   #endif
         3305  +
         3306  +#ifdef SQLITE_ENABLE_SHA3
         3307  +  if( !db->mallocFailed && rc==SQLITE_OK){
         3308  +    rc = sqlite3Sha3Init(db);
         3309  +  }
         3310  +#endif
  3302   3311   
  3303   3312   #ifdef SQLITE_ENABLE_STMTVTAB
  3304   3313     if( !db->mallocFailed && rc==SQLITE_OK){
  3305   3314       rc = sqlite3StmtVtabInit(db);
  3306   3315     }
  3307   3316   #endif
  3308   3317   

Changes to src/shell.c.in.

   932    932   #define SQLITE_EXTENSION_INIT2(X) (void)(X)
   933    933   
   934    934   #if defined(_WIN32) && defined(_MSC_VER)
   935    935   INCLUDE test_windirent.h
   936    936   INCLUDE test_windirent.c
   937    937   #define dirent DIRENT
   938    938   #endif
   939         -INCLUDE ../ext/misc/shathree.c
   940    939   INCLUDE ../ext/misc/fileio.c
   941    940   INCLUDE ../ext/misc/completion.c
   942    941   INCLUDE ../ext/misc/appendvfs.c
   943    942   INCLUDE ../ext/misc/memtrace.c
   944    943   #ifdef SQLITE_HAVE_ZLIB
   945    944   INCLUDE ../ext/misc/zipfile.c
   946    945   INCLUDE ../ext/misc/sqlar.c
................................................................................
  4147   4146         }
  4148   4147         exit(1);
  4149   4148       }
  4150   4149   #ifndef SQLITE_OMIT_LOAD_EXTENSION
  4151   4150       sqlite3_enable_load_extension(p->db, 1);
  4152   4151   #endif
  4153   4152       sqlite3_fileio_init(p->db, 0, 0);
  4154         -    sqlite3_shathree_init(p->db, 0, 0);
         4153  +    /* sqlite3_shathree_init(p->db, 0, 0); */
  4155   4154       sqlite3_completion_init(p->db, 0, 0);
  4156   4155   #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
  4157   4156       sqlite3_dbdata_init(p->db, 0, 0);
  4158   4157   #endif
  4159   4158   #ifdef SQLITE_HAVE_ZLIB
  4160   4159       sqlite3_zipfile_init(p->db, 0, 0);
  4161   4160       sqlite3_sqlar_init(p->db, 0, 0);

Changes to src/test_config.c.

   221    221   #endif
   222    222   
   223    223   #ifdef SQLITE_ENABLE_JSON1
   224    224     Tcl_SetVar2(interp, "sqlite_options", "json1", "1", TCL_GLOBAL_ONLY);
   225    225   #else
   226    226     Tcl_SetVar2(interp, "sqlite_options", "json1", "0", TCL_GLOBAL_ONLY);
   227    227   #endif
          228  +
          229  +#ifdef SQLITE_ENABLE_SHA3
          230  +  Tcl_SetVar2(interp, "sqlite_options", "sha3", "1", TCL_GLOBAL_ONLY);
          231  +#else
          232  +  Tcl_SetVar2(interp, "sqlite_options", "sha3", "0", TCL_GLOBAL_ONLY);
          233  +#endif
   228    234   
   229    235   #ifdef SQLITE_HAS_CODEC
   230    236     Tcl_SetVar2(interp, "sqlite_options", "has_codec", "1", TCL_GLOBAL_ONLY);
   231    237   #else
   232    238     Tcl_SetVar2(interp, "sqlite_options", "has_codec", "0", TCL_GLOBAL_ONLY);
   233    239   #endif
   234    240   

Changes to tool/mksqlite3c.tcl.

   399    399      fts3_icu.c
   400    400      sqlite3rbu.c
   401    401      dbstat.c
   402    402      dbpage.c
   403    403      sqlite3session.c
   404    404      fts5.c
   405    405      stmt.c
          406  +   shathree.c
   406    407   } {
   407    408     copy_file tsrc/$file
   408    409   }
   409    410   
   410    411   # Synthesize an alternative sqlite3_sourceid() implementation that
   411    412   # that tries to detects changes in the amalgamation source text
   412    413   # and modify returns a modified source-id if changes are detected.

Changes to tool/warnings.sh.

    16     16   
    17     17   rm -f sqlite3.c
    18     18   make sqlite3.c
    19     19   echo '********** No optimizations.  Includes FTS4/5, GEOPOLY, JSON1 ***'
    20     20   echo '**********    ' Options: $WARNING_OPTS
    21     21   gcc -c $WARNING_OPTS -std=c89 \
    22     22         -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \
    23         -      -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \
           23  +      -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_SHA3 \
    24     24         sqlite3.c
    25     25   if test x`uname` = 'xLinux'; then
    26     26   echo '********** Android configuration ******************************'
    27     27   echo '**********    ' Options: $WARNING_ANDROID_OPTS
    28     28   gcc -c \
    29     29     -DHAVE_USLEEP=1 \
    30     30     -DSQLITE_HAVE_ISNAN \
................................................................................
    52     52   gcc -c $WARNING_OPTS -std=c89 \
    53     53         -ansi -DSQLITE_ENABLE_STAT4 -DSQLITE_THREADSAFE=0 \
    54     54         sqlite3.c
    55     55   echo '********** Optimized -O3.  Includes FTS4/5, GEOPOLY, JSON1 ******'
    56     56   echo '**********    ' Options: $WARNING_OPTS
    57     57   gcc -O3 -c $WARNING_OPTS -std=c89 \
    58     58         -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \
    59         -      -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \
           59  +      -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_SHA3 \
    60     60         sqlite3.c