Overview
Comment: | Implement cryptographic hash algorithms. (These are not currently used by Free Hero Mesh but is expected to be used in future.) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
12934338676a381159f7149f6a415d92 |
User & Date: | user on 2022-01-13 06:48:00 |
Other Links: | manifest | tags |
Context
2022-01-15
| ||
05:59 | Implement the user sounds (uncompressed) and MML sounds; does not work in the game yet, and built-in sounds are not yet implemented. check-in: 5c902e7a3f user: user tags: trunk | |
2022-01-13
| ||
06:48 | Implement cryptographic hash algorithms. (These are not currently used by Free Hero Mesh but is expected to be used in future.) check-in: 1293433867 user: user tags: trunk | |
2022-01-12
| ||
02:28 | Use 23-bit code page numbers. check-in: 0ced76ece7 user: user tags: trunk | |
Changes
Modified ARCHITECTURE from [2e9d020285] to [cf4caa50f5].
︙ | |||
41 42 43 44 45 46 47 48 49 50 51 52 53 54 | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | + + + + + + | heromesh.h: Contains structures, macros, and function and variables for Free Hero Mesh, which can be used by multiple files. game.c: The game play. The game behaviour is implemented in exec.c; this one just handles the input and display, and solution replay, and any move which is made calls exec.c to execute the mode. It contains one function (locate_me) which is called by exec.c. hash.c,hash.h: A set of functions for computing cryptographic hashes. These functions can be used outside of Free Hero Mesh, too. If you want to add new algorithms, use the multicodec table to assign the numbers. (Currently they are not used for anything, but some planned features may use it in future.) instruc,instruc.h,instruc.js: The "instruc" file contains a list of the keywords and internal operator names used in the class definitions. Some of these are only used internally, although most are available directly as keywords. Many are also opcodes in the compiled P-code, although some are only used as keywords, which are handled during class loading. The instruc.js program generates instruc.h from instruc. |
︙ |
Modified compile from [9ee9dc5e0b] to [552320bf15].
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | - + + + + | #!/bin/bash -- set -e if test "$1" = "p"; then echo 'Using portable mode.' test -d bin || mkdir bin export EXE=bin/heromesh test -e bin/current.heromeshrc || cp default.heromeshrc bin/current.heromeshrc fi test -f CFLAGS || echo xxx > CFLAGS |
Modified function.c from [77517819b9] to [830d643cb4].
︙ | |||
8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | + | #include <stdlib.h> #include <string.h> #include "sqlite3.h" #include "smallxrm.h" #include "heromesh.h" #include "cursorshapes.h" #include "instruc.h" #include "hash.h" typedef struct { struct sqlite3_vtab_cursor; sqlite3_int64 rowid; char unique,eof; Uint16 arg[4]; } Cursor; |
︙ | |||
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | + + + + + + + + + | return; } else { a=sqlite3_value_int(*argv)&0xFFFF; if(!a || (a&~0x3FFF) || !classes[a] || (classes[a]->cflags&CF_NOCLASS2)) return; } found: sqlite3_result_int64(cxt,a|((sqlite3_int64)TY_CLASS<<32)); } static void fn_hash(sqlite3_context*cxt,int argc,sqlite3_value**argv) { const unsigned char*u=sqlite3_value_blob(*argv); int n=sqlite3_value_bytes(*argv); long long h=sqlite3_value_int64(argv[1]); int m=hash_length(h); if(sqlite3_value_type(*argv)==SQLITE_NULL || !m) return; sqlite3_result_blob(cxt,hash_buffer(h,u,n),m,free); } static void fn_heromesh_escape(sqlite3_context*cxt,int argc,sqlite3_value**argv) { const unsigned char*u=sqlite3_value_blob(*argv); int un=sqlite3_value_bytes(*argv); char*e; int en=0; int i=0; |
︙ | |||
1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 | 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 | + | void init_sql_functions(sqlite3_int64*ptr0,sqlite3_int64*ptr1) { sqlite3_create_function(userdb,"BASENAME",0,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_basename,0,0); sqlite3_create_function(userdb,"BCAT",-1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_bcat,0,0); sqlite3_create_function(userdb,"BYTE",-1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_byte,0,0); sqlite3_create_function(userdb,"CL",1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_cl,0,0); sqlite3_create_function(userdb,"CLASS_DATA",2,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_class_data,0,0); sqlite3_create_function(userdb,"CVALUE",1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_cvalue,0,0); sqlite3_create_function(userdb,"HASH",2,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_hash,0,0); sqlite3_create_function(userdb,"HEROMESH_ESCAPE",1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_heromesh_escape,0,0); sqlite3_create_function(userdb,"HEROMESH_TYPE",1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_heromesh_type,0,0); sqlite3_create_function(userdb,"HEROMESH_UNESCAPE",1,SQLITE_UTF8|SQLITE_DETERMINISTIC,0,fn_heromesh_unescape,0,0); sqlite3_create_function(userdb,"INRECT",2,SQLITE_UTF8,0,fn_inrect,0,0); sqlite3_create_function(userdb,"LEVEL",0,SQLITE_UTF8,&level_ord,fn_level,0,0); sqlite3_create_function(userdb,"LEVEL_CACHEID",0,SQLITE_UTF8|SQLITE_DETERMINISTIC,ptr0,fn_cacheid,0,0); sqlite3_create_function(userdb,"LEVEL_ID",0,SQLITE_UTF8,&level_id,fn_level,0,0); |
︙ |
Added hash.c version [56ec27ebd5].