Home | History | Annotate | Download | only in cipher

Lines Matching refs:CTR

5 // Counter (CTR) mode.
7 // CTR converts a block cipher into a stream cipher by
15 type ctr struct {
17 ctr []byte
25 // implementation of CTR, like crypto/aes. NewCTR will check for this interface
34 if ctr, ok := block.(ctrAble); ok {
35 return ctr.NewCTR(iv)
44 return &ctr{
46 ctr: dup(iv),
52 func (x *ctr) refill() {
58 x.b.Encrypt(x.out[remain:], x.ctr)
62 for i := len(x.ctr) - 1; i >= 0; i-- {
63 x.ctr[i]++
64 if x.ctr[i] != 0 {
73 func (x *ctr) XORKeyStream(dst, src []byte) {