X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=hbytes%2Fhbytes.h;h=d4a5719eee94763cd73c77f3b8e6e021affa1168;hb=310a482133795d0bee9621003c0a0b3813a47037;hp=c6fe050b8d675f29a6a6bfb8162391c2e08518d5;hpb=bdab939bce799bf55ccd401543f5f13a3203b047;p=chiark-tcl.git diff --git a/hbytes/hbytes.h b/hbytes/hbytes.h index c6fe050..d4a5719 100644 --- a/hbytes/hbytes.h +++ b/hbytes/hbytes.h @@ -14,10 +14,10 @@ * * hbytes pkcs5 pa|ua VAR ALG => worked? (always 1 for p) * hbytes pkcs5 pn|un VAR BLOCKSIZE => worked? (always 1 for p) - * hbytes blockcipher e|d VAR ALG MODE [IV] => IV + * hbytes blockcipher d|e VAR ALG MODE [IV] => IV * - * hbytes hash ALG VALUE => hash - * hbytes hmac ALG VALUE KEY [MACLENGTH] => mac + * hbytes hash ALG MESSAGE => hash + * hbytes hmac ALG MESSAGE KEY [MACLENGTH] => mac * * Refs: HMAC: RFC2104 */ @@ -43,7 +43,8 @@ extern Tcl_ObjType hbytes_type; int staticerr(Tcl_Interp *ip, const char *m); void objfreeir(Tcl_Obj *o); -Tcl_Obj *hbytes_set(Tcl_Obj *overwrite, const Byte *array, int l); +void hbytes_set(HBytes_Value *upd, const Byte *array, int l); +Tcl_Obj *hbytes_set_obj(Tcl_Obj *overwrite, const Byte *array, int l); /* from enum.c */ @@ -63,10 +64,24 @@ const void *enum_lookup_cached_func(Tcl_Interp *ip, Tcl_Obj *o, * set to the error message. */ +/* from crypto.c */ + +typedef struct { + int blocksize, hashsize; +} HashAlgInfo; + +typedef struct { + int blocksize; +} BlockCipherAlgInfo; + +typedef struct { + int dummy; +} BlockCipherModeInfo; + /* useful macros */ -#define HBYTES(o) ((HBytes_Value*)&(o)->internalRep.twoPtrValue) -#define HBYTES_LEN(o) (HBYTES((o))->end - HBYTES((o))->start) +#define HBYTES(o) (*(HBytes_Value*)&(o)->internalRep.twoPtrValue) +#define HBYTES_LEN(hb) ((hb).end - (hb).start) #define TALLOC(s) ((void*)Tcl_Alloc((s))) #define TFREE(f) (Tcl_Free((void*)(f)))