Source File
cbc.go
Belonging Package
crypto/cipher
type cbcEncAble interface {
NewCBCEncrypter(iv []byte) BlockMode
}
func ( Block, []byte) BlockMode {
if len() != .BlockSize() {
panic("cipher.NewCBCEncrypter: IV length must equal block size")
}
if , := .(cbcEncAble); {
return .NewCBCEncrypter()
}
return (*cbcEncrypter)(newCBC(, ))
}
func ( *cbcEncrypter) () int { return .blockSize }
func ( *cbcEncrypter) (, []byte) {
if len()%.blockSize != 0 {
panic("crypto/cipher: input not full blocks")
}
if len() < len() {
panic("crypto/cipher: output smaller than input")
}
if subtle.InexactOverlap([:len()], ) {
panic("crypto/cipher: invalid buffer overlap")
}
:= .iv
type cbcDecAble interface {
NewCBCDecrypter(iv []byte) BlockMode
}
func ( Block, []byte) BlockMode {
if len() != .BlockSize() {
panic("cipher.NewCBCDecrypter: IV length must equal block size")
}
if , := .(cbcDecAble); {
return .NewCBCDecrypter()
}
return (*cbcDecrypter)(newCBC(, ))
}
func ( *cbcDecrypter) () int { return .blockSize }
func ( *cbcDecrypter) (, []byte) {
if len()%.blockSize != 0 {
panic("crypto/cipher: input not full blocks")
}
if len() < len() {
panic("crypto/cipher: output smaller than input")
}
if subtle.InexactOverlap([:len()], ) {
panic("crypto/cipher: invalid buffer overlap")
}
if len() == 0 {
return
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin 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. |