From cf79867094e8877f35639d50769d2fe9c2a8bd0b Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 11 Sep 2002 01:58:36 +0000 Subject: [PATCH] does modexps, makes signatures, needs sane hexstring handling --- base/chiark-tcl.h | 1 + base/hook.c | 12 ++++++++++++ base/tables-examples.tct | 2 ++ hbytes/hbytes.h | 1 + hbytes/hook.c | 12 ++++++++++++ 5 files changed, 28 insertions(+) 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