package igeimport ()// NewIGEDecrypter returns an IGE cipher.BlockMode which decrypts using IGE and// the given cipher.Block.//// Note: iv must contain two iv values for IGE (concatenated), otherwise this// function will panic. See ErrInvalidIV for more information.func ( cipher.Block, []byte) IGE {if := checkIV(, ); != nil {panic(.Error()) }return (*igeDecrypter)(newIGE(, ))}typeigeDecrypterigefunc ( *igeDecrypter) () int {return .block.BlockSize()}func ( *igeDecrypter) (, []byte) {DecryptBlocks(.block, .iv, , )}// DecryptBlocks is a simple shorthand for IGE decrypting.// Note: unlike NewIGEDecrypter, DecryptBlocks does NOT COPY iv.// So you must not modify passed iv.func ( cipher.Block, , , []byte) {if := checkIV(, ); != nil {panic(.Error()) }iflen()%.BlockSize() != 0 {panic("src not full blocks") }iflen() < len() {panic("len(dst) < len(src)") } := .BlockSize() := [:] := [:]for := 0; < len(); += { := [ : + : +]xor.Bytes([:+:+], [:+:+], ) .Decrypt([:+:+], [:+:+])xor.Bytes([:+:+], [:+:+], ) = [ : +] = }}
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.