4 * hbytes raw2h BINARY => hex
5 * hbytes h2raw HEX => binary
7 * hbytes prefix VAR [VALUE ...] = set VAR [concat VALUE ... $VAR]
8 * hbytes append VAR [VALUE ...] = set VAR [concat $VAR VALUE ...]
9 * hbytes concat VAR [VALUE ...] = set VAR [concat VALUE ...]
10 * hbytes unprepend VAR PREFIXLENGTH => prefix (removed from VAR)
11 * hbytes unappend VAR SUFFIXLENGTH => suffix (removed from VAR)
12 * hbytes chopto VAR NEWVARLENGTH => suffix (removed from VAR)
15 * hbytes pkcs5 pa|ua VAR ALG => worked? (always 1 for p)
16 * hbytes pkcs5 pn|un VAR BLOCKSIZE => worked? (always 1 for p)
17 * hbytes blockcipher d|e VAR ALG MODE [IV] => IV
19 * hbytes hash ALG MESSAGE => hash
20 * hbytes hmac ALG MESSAGE KEY [MACLENGTH] => mac
33 typedef unsigned char Byte;
38 Byte *start, *end; /* always allocated dynamically */
39 } HBytes_Value; /* overlays internalRep */
41 extern Tcl_ObjType hbytes_type;
43 int staticerr(Tcl_Interp *ip, const char *m);
44 void objfreeir(Tcl_Obj *o);
46 void hbytes_set(HBytes_Value *upd, const Byte *array, int l);
47 Tcl_Obj *hbytes_set_obj(Tcl_Obj *overwrite, const Byte *array, int l);
51 extern Tcl_ObjType enum_nearlytype;
53 const void *enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
54 size_t entrysize, const void *firstentry,
56 #define enum_lookup_cached(ip,o,table,what) \
57 (enum_lookup_cached_func((ip),(o), \
58 sizeof((table)[0]),&(table)[0], \
60 /* table should be a pointer to an array of structs of size
61 * entrysize, the first member of which should be a const char*.
62 * The table should finish with a null const char *.
63 * On error, 0 is returned and the ip->result will have been
64 * set to the error message.
70 int blocksize, hashsize;
79 } BlockCipherModeInfo;
83 #define HBYTES(o) (*(HBytes_Value*)&(o)->internalRep.twoPtrValue)
84 #define HBYTES_LEN(hb) ((hb).end - (hb).start)
86 #define TALLOC(s) ((void*)Tcl_Alloc((s)))
87 #define TFREE(f) (Tcl_Free((void*)(f)))