Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
9225bbfc
Commit
9225bbfc
authored
Mar 29, 2011
by
Adam Langley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypto/cipher: bad CTR IV length now triggers panic
R=rsc CC=golang-dev
https://golang.org/cl/4326042
parent
d41d6fec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
ctr.go
src/pkg/crypto/cipher/ctr.go
+4
-0
No files found.
src/pkg/crypto/cipher/ctr.go
View file @
9225bbfc
...
@@ -22,6 +22,10 @@ type ctr struct {
...
@@ -22,6 +22,10 @@ type ctr struct {
// NewCTR returns a Stream which encrypts/decrypts using the given Block in
// NewCTR returns a Stream which encrypts/decrypts using the given Block in
// counter mode. The length of iv must be the same as the Block's block size.
// counter mode. The length of iv must be the same as the Block's block size.
func
NewCTR
(
block
Block
,
iv
[]
byte
)
Stream
{
func
NewCTR
(
block
Block
,
iv
[]
byte
)
Stream
{
if
len
(
iv
)
!=
block
.
BlockSize
()
{
panic
(
"cipher.NewCTR: iv length must equal block size"
)
}
return
&
ctr
{
return
&
ctr
{
b
:
block
,
b
:
block
,
ctr
:
dup
(
iv
),
ctr
:
dup
(
iv
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment