chiark / gitweb /
hmac seems to work
[chiark-tcl.git] / base / chiark-tcl.h
index cfc96e912f9fd994de502e05c69c0f7e57ab04de..15abca2544407f8e5c7194888b7ec27787d36e98 100644 (file)
@@ -15,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
@@ -92,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 */
 
@@ -136,13 +138,20 @@ typedef struct {
   int pad, use_algname;
 } PadMethod;
 
-/* from hash.c */
+Tcl_ObjType blockcipherkey_type;
+
+/* from algtables.c */
 
 typedef struct {
-  int blocksize, hashsize;
+  const char *name;
+  int hashsize, blocksize, statesize;
+  void (*init)(void *state);
+  void (*update)(void *state, const Byte *data, int len);
+  void (*final)(void *state, Byte *digest);
+  void (*oneshot)(Byte *digest, const Byte *data, int len);
 } HashAlgInfo;
 
-/* from blockciph.c */
+extern const HashAlgInfo hashalginfos[];
 
 typedef struct {
   void (*make_schedule)(void *schedule, const Byte *key, int keylen);