X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-tcl.git;a=blobdiff_plain;f=hbytes%2Fhbytes.h;h=c5ffc06bbf0da4cd07826a2f1bdf9e6cb0a0c3b5;hp=75ce6c816bf0f86f95fb3ded4d91c2f88cfb7702;hb=aa983421528c717a29c402c0cb4c8438b96fd860;hpb=9b7d11070d3e9dc1eb61cbccd5155f47a27047c3 diff --git a/hbytes/hbytes.h b/hbytes/hbytes.h index 75ce6c8..c5ffc06 100644 --- a/hbytes/hbytes.h +++ b/hbytes/hbytes.h @@ -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 {