"bytes"
"crypto/internal/fips140/aes"
"crypto/internal/fips140/alias"
+ "crypto/internal/fips140only"
"crypto/subtle"
)
if b, ok := b.(*aes.Block); ok {
return aes.NewCBCEncrypter(b, [16]byte(iv))
}
+ if fips140only.Enabled {
+ panic("crypto/cipher: use of CBC with non-AES ciphers is not allowed in FIPS 140-only mode")
+ }
if cbc, ok := b.(cbcEncAble); ok {
return cbc.NewCBCEncrypter(iv)
}
if b, ok := b.(*aes.Block); ok {
return aes.NewCBCDecrypter(b, [16]byte(iv))
}
+ if fips140only.Enabled {
+ panic("crypto/cipher: use of CBC with non-AES ciphers is not allowed in FIPS 140-only mode")
+ }
if cbc, ok := b.(cbcDecAble); ok {
return cbc.NewCBCDecrypter(iv)
}
"bytes"
"crypto/internal/fips140/aes"
"crypto/internal/fips140/alias"
+ "crypto/internal/fips140only"
"crypto/subtle"
)
if block, ok := block.(*aes.Block); ok {
return aesCtrWrapper{aes.NewCTR(block, iv)}
}
+ if fips140only.Enabled {
+ panic("crypto/cipher: use of CTR with non-AES ciphers is not allowed in FIPS 140-only mode")
+ }
if ctr, ok := block.(ctrAble); ok {
return ctr.NewCTR(iv)
}