Posted to tcl by patthoyts at Sun Apr 09 13:47:49 GMT 2006view raw
- proc ::DES::Init {mode key iv {weak 0}} {
- variable uid
- set Key [namespace current]::[incr uid]
- upvar #0 $Key state
- array set state [list M $mode I $iv K [des::keyset create $key $weak]]
- return $Key
- }
- proc ::DES::Encrypt {Key data} {
- upvar #0 $Key state
- set iv $state(I)
- set r [des::encrypt $state(K) $data $state(M) iv]
- set state(I) $iv
- return $r
- }
Comments
Posted by rmax at Wed Apr 12 22:25:17 GMT 2006 [text] [code]
Another comment...