* HBYTES LENGTH OVERRUN block too long
* HBYTES LENGTH RANGE input length or offset is -ve or silly
* HBYTES LENGTH UNDERRUN block too short (or offset too big)
+ * HBYTES LENGTH MISMATCH when blocks must be exactly same length
* HBYTES SYNTAX supposed hex block had wrong syntax
* HBYTES VALUE OVERFLOW value to be conv'd to hex too big/long
* SOCKADDR AFUNIX LENGTH path for AF_UNIX socket too long
return TCL_OK;
}
+int do_hbytes_xor(ClientData cd, Tcl_Interp *ip,
+ HBytes_Var v, HBytes_Value d) {
+ int l;
+ Byte *dest;
+ const Byte *source;
+
+ l= hbytes_len(v.hb);
+ if (hbytes_len(&d) != l) return
+ staticerr(ip, "hbytes xor lengths do not match", "HBYTES LENGTH MISMATCH");
+
+ dest= hbytes_data(v.hb);
+ source= hbytes_data(&d);
+ memxor(dest,source,l);
+ return TCL_OK;
+}
+
int do_hbytes_zeroes(ClientData cd, Tcl_Interp *ip,
int length, HBytes_Value *result) {
Byte *space;
v hb
count int
=> hb
+ xor
+ v hbv
+ d hb
random
length int
=> hb
* HBYTES LENGTH OVERRUN block too long
* HBYTES LENGTH RANGE input length or offset is -ve or silly
* HBYTES LENGTH UNDERRUN block too short (or offset too big)
+ * HBYTES LENGTH MISMATCH when blocks must be exactly same length
* HBYTES SYNTAX supposed hex block had wrong syntax
* HBYTES VALUE OVERFLOW value to be conv'd to hex too big/long
* SOCKADDR AFUNIX LENGTH path for AF_UNIX socket too long
return TCL_OK;
}
+int do_hbytes_xor(ClientData cd, Tcl_Interp *ip,
+ HBytes_Var v, HBytes_Value d) {
+ int l;
+ Byte *dest;
+ const Byte *source;
+
+ l= hbytes_len(v.hb);
+ if (hbytes_len(&d) != l) return
+ staticerr(ip, "hbytes xor lengths do not match", "HBYTES LENGTH MISMATCH");
+
+ dest= hbytes_data(v.hb);
+ source= hbytes_data(&d);
+ memxor(dest,source,l);
+ return TCL_OK;
+}
+
int do_hbytes_zeroes(ClientData cd, Tcl_Interp *ip,
int length, HBytes_Value *result) {
Byte *space;