func calcAes30Params(pass []uint16, salt []byte) (key, iv []byte) {
	p := make([]byte, 0, len(pass)*2+len(salt))
	for _, v := range pass {
		p = append(p, byte(v), byte(v>>8))
	}
	p = append(p, salt...)
	hash := sha1.New()
	iv = make([]byte, 16)
	s := make([]byte, 0, hash.Size())
	for i := 0; i < hashRounds; i++ {
		hash.Write(p)
		hash.Write([]byte{byte(i), byte(i >> 8), byte(i >> 16)})
		if i%(hashRounds/16) == 0 {
			s = hash.Sum(s[:0])
			iv[i/(hashRounds/16)] = s[4*4+3]
		}
	}
	key = hash.Sum(s[:0])
	key = key[:16]
	for k := key; len(k) >= 4; k = k[4:] {
		k[0], k[1], k[2], k[3] = k[3], k[2], k[1], k[0]
	}
	return key, iv
}
Calculates the key and iv for AES decryption given a password and salt.
package rardecode
import (
	"bufio"
	"bytes"
	"crypto/sha1"
	"errors"
	"hash"
	"hash/crc32"
	"io"
	"io/ioutil"
	"strconv"
	"strings"
	"time"
	"unicode/utf16"
)
const (
	blockArc     = 0x73
	blockFile    = 0x74
	blockService = 0x7a
	blockEnd     = 0x7b
	blockHasData = 0x8000
	arcVolume    = 0x0001
	arcSolid     = 0x0008
	arcNewNaming = 0x0010
	arcEncrypted = 0x0080
	fileSplitBefore = 0x0001
	fileSplitAfter  = 0x0002
	fileEncrypted   = 0x0004
	fileSolid       = 0x0010
	fileWindowMask  = 0x00e0
	fileLargeData   = 0x0100
	fileUnicode     = 0x0200
	fileSalt        = 0x0400
	fileVersion     = 0x0800
	fileExtTime     = 0x1000
	endArcNotLast = 0x0001
	saltSize    = 8  
	cacheSize30 = 4  
	hashRounds  = 0x40000
)
var (
	errMultipleDecoders = errors.New("rardecode: multiple decoders in a single archive not supported")
)
type blockHeader15 struct {
	htype    byte  
	flags    uint16
	data     readBuf  
	dataSize int64    
}
type fileHash32 struct {
	hash.Hash32         
	sum         uint32  
}
func (h *fileHash32) valid() bool {
	return h.sum == h.Sum32()
}
type archive15 struct {
	byteReader                
	v          *bufio.Reader  
	dec        decoder        
	decVer     byte           
	multi      bool           
	old        bool           
	solid      bool           
	encrypted  bool
	pass       []uint16               
	checksum   fileHash32             
	buf        readBuf                
	keyCache   [cacheSize30]struct {  
		salt []byte
		key  []byte
		iv   []byte
	}
}