chiark / gitweb /
Serpent seems to work. Byte order is very strange.
[chiark-tcl.git] / hbytes / hbytes.h
index 75ce6c816bf0f86f95fb3ded4d91c2f88cfb7702..c5ffc06bbf0da4cd07826a2f1bdf9e6cb0a0c3b5 100644 (file)
@@ -4,6 +4,7 @@
  *  hbytes raw2h BINARY                          => hex
  *  hbytes h2raw HEX                             => binary
  *
+ *  hbytes length VALUE                          => count
  *  hbytes prepend VAR [VALUE ...]         = set VAR [concat VALUE ... $VAR]
  *  hbytes append VAR [VALUE ...]          = set VAR [concat $VAR VALUE ...]
  *  hbytes concat VAR [VALUE ...]          = set VAR [concat VALUE ...]
@@ -14,7 +15,7 @@
  *
  *  hbytes pkcs5 pa|ua VAR ALG                   => worked?  (always 1 for p)
  *  hbytes pkcs5 pn|un VAR BLOCKSIZE             => worked?  (always 1 for p)
- *  hbytes blockcipher d|e VAR ALG MODE [IV]     => IV
+ *  hbytes blockcipher d|e VAR ALG KEY MODE [IV] => IV
  *
  *  hbytes hash ALG MESSAGE                      => hash
  *  hbytes hmac ALG MESSAGE KEY [MACLENGTH]      => mac
@@ -91,6 +92,8 @@ void hbytes_free(HBytes_Value *frees);
 
 int staticerr(Tcl_Interp *ip, const char *m);
 void objfreeir(Tcl_Obj *o);
+void obj_updatestr_array(Tcl_Obj *o, const Byte *array, int l);
+int get_urandom(Tcl_Interp *ip, Byte *buffer, int l);
 
 /* from parse.c */
 
@@ -113,7 +116,7 @@ const void *enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
                                    const char *what);
 #define enum_lookup_cached(ip,o,table,what)                    \
     (enum_lookup_cached_func((ip),(o),                         \
-                            sizeof((table)[0]),&(table)[0],    \
+                            &(table)[0],sizeof((table)[0]),    \
                             (what)))
   /* table should be a pointer to an array of structs of size
    * entrysize, the first member of which should be a const char*.
@@ -130,6 +133,13 @@ int enum1_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o,
 
 void memxor(Byte *dest, const Byte *src, int l);
 
+typedef struct {
+  const char *name;
+  int pad, use_algname;
+} PadMethod;
+
+Tcl_ObjType blockcipherkey_type;
+
 /* from hash.c */
 
 typedef struct {