Posted to tcl by steveb at Wed Sep 16 15:44:17 GMT 2020view raw

  1. if (objc > 3) {
  2. Tcl_WrongNumArgs(interp, 2, objv, "source ?password?");
  3. return TCL_ERROR;}
  4.  
  5. bufcrypt=Tcl_GetByteArrayFromObj(objv[1],&length);
  6. if(objc == 3) altkey = Tcl_GetByteArrayFromObj(objv[2],NULL);
  7. else altkey = key;
  8. num = 0;
  9. BF_set_key(&sch,16,altkey);
  10. BF_cfb64_encrypt(bufcrypt,bufcrypt,(long)length,&sch,ivec,&num,BF_DECRYPT);
  11. resultPtr=Tcl_GetObjResult(interp);
  12. Tcl_SetByteArrayObj(resultPtr,bufcrypt,length);
  13. return TCL_OK;

Comments

Posted by steveb at Wed Sep 16 15:48:39 GMT 2020 [text] [code]

Here are the bones of the Tcl interface and calls of the actual encrytion routines.