1
0
mirror of https://github.com/golang/go synced 2024-11-18 05:04:47 -07:00

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/1754
Reviewed-by: Adam Langley <agl@golang.org>
This commit is contained in:
Shenghou Ma 2014-12-18 03:18:23 -05:00 committed by Minux Ma
parent c0abdd9f29
commit 354467ffbb

View File

@ -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)
}