From: ian Date: Wed, 11 Sep 2002 01:58:36 +0000 (+0000) Subject: does modexps, makes signatures, needs sane hexstring handling X-Git-Tag: debian/1.1.1~153 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=cf79867094e8877f35639d50769d2fe9c2a8bd0b;p=chiark-tcl.git does modexps, makes signatures, needs sane hexstring handling --- diff --git a/base/chiark-tcl.h b/base/chiark-tcl.h index 23cad20..f482cc5 100644 --- a/base/chiark-tcl.h +++ b/base/chiark-tcl.h @@ -15,6 +15,7 @@ * * hbytes range VALUE START SIZE => substring (or error) * hbytes overwrite VAR START VALUE + * hbytes trimleft VALUE removes any leading 0 octets * hbytes repeat VALUE COUNT => COUNT copies of VALUE * * hbytes h2ulong HEX => ulong (HEX len must be 4) diff --git a/base/hook.c b/base/hook.c index f364978..0adb6b5 100644 --- a/base/hook.c +++ b/base/hook.c @@ -210,6 +210,18 @@ int do_hbytes_overwrite(ClientData cd, Tcl_Interp *ip, return TCL_OK; } +int do_hbytes_trimleft(ClientData cd, Tcl_Interp *ip, HBytes_Var v) { + const Byte *o, *p, *e; + o= p= hbytes_data(v.hb); + e= p + hbytes_len(v.hb); + + while (p hb diff --git a/hbytes/hbytes.h b/hbytes/hbytes.h index 23cad20..f482cc5 100644 --- a/hbytes/hbytes.h +++ b/hbytes/hbytes.h @@ -15,6 +15,7 @@ * * hbytes range VALUE START SIZE => substring (or error) * hbytes overwrite VAR START VALUE + * hbytes trimleft VALUE removes any leading 0 octets * hbytes repeat VALUE COUNT => COUNT copies of VALUE * * hbytes h2ulong HEX => ulong (HEX len must be 4) diff --git a/hbytes/hook.c b/hbytes/hook.c index f364978..0adb6b5 100644 --- a/hbytes/hook.c +++ b/hbytes/hook.c @@ -210,6 +210,18 @@ int do_hbytes_overwrite(ClientData cd, Tcl_Interp *ip, return TCL_OK; } +int do_hbytes_trimleft(ClientData cd, Tcl_Interp *ip, HBytes_Var v) { + const Byte *o, *p, *e; + o= p= hbytes_data(v.hb); + e= p + hbytes_len(v.hb); + + while (p