Commit 354467ff authored by Shenghou Ma's avatar Shenghou Ma Committed by Minux Ma

crypto/cipher: update docs for the Stream interface

Specify what will happen if len(dst) != len(src).

Change-Id: I66afa3730f637753b825189687418f14ddec3629
Reviewed-on: https://go-review.googlesource.com/1754Reviewed-by: 's avatarAdam Langley <agl@golang.org>
parent c0abdd9f
......@@ -29,6 +29,9 @@ type Block interface {
type Stream interface {
// XORKeyStream XORs each byte in the given slice with a byte from the
// cipher's key stream. Dst and src may point to the same memory.
// If len(dst) < len(src), XORKeyStream should panic. It is acceptable
// to pass a dst bigger than src, and in that case, XORKeyStream will
// only update dst[:len(src)] and will not touch the rest of dst.
XORKeyStream(dst, src []byte)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment