Posted to tcl by patthoyts at Sun Apr 09 13:47:49 GMT 2006view raw

  1. proc ::DES::Init {mode key iv {weak 0}} {
  2. variable uid
  3. set Key [namespace current]::[incr uid]
  4. upvar #0 $Key state
  5. array set state [list M $mode I $iv K [des::keyset create $key $weak]]
  6. return $Key
  7. }
  8.  
  9. proc ::DES::Encrypt {Key data} {
  10. upvar #0 $Key state
  11. set iv $state(I)
  12. set r [des::encrypt $state(K) $data $state(M) iv]
  13. set state(I) $iv
  14. return $r
  15. }

Comments

Posted by rmax at Wed Apr 12 22:25:17 GMT 2006 [text] [code]

Another comment...