chiark / gitweb /
hbcrypto hash-{init,update,final} for incremental hashing
[chiark-tcl.git] / crypto / crypto.c
index 988d1bceb01e643afc7a14ef7b7cc57734990960..a926def525bc5298426ce7e1d7cfd84f94f2e514 100644 (file)
@@ -147,15 +147,6 @@ int cht_do_padmethodinfo_pkcs5(ClientData cd, Tcl_Interp *ip, int *ok) {
   return TCL_OK;
 }
 
-int cht_do_hbcrypto_hash(ClientData cd, Tcl_Interp *ip, const HashAlgInfo *alg,
-                  HBytes_Value message, HBytes_Value *result) {
-  Byte *dest;
-
-  dest= cht_hb_arrayspace(result,alg->hashsize);
-  alg->oneshot(dest, cht_hb_data(&message), cht_hb_len(&message));
-  return TCL_OK;
-}
-
 #define OBJ_CIPHKEY(o) ((CiphKeyValue*)(o)->internalRep.otherValuePtr)
 
 typedef struct {
@@ -195,7 +186,7 @@ static void key_t_dup(Tcl_Obj *src_obj, Tcl_Obj *dup_obj) {
 }
 
 static void key_t_ustr(Tcl_Obj *o) {
-  obj_updatestr_array(o, OBJ_CIPHKEY(o)->value, OBJ_CIPHKEY(o)->valuelen);
+  cht_obj_updatestr_array(o, OBJ_CIPHKEY(o)->value, OBJ_CIPHKEY(o)->valuelen);
 }
 
 static int key_t_sfa(Tcl_Interp *ip, Tcl_Obj *o) {