Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for NewCBCDecrypter (0.28 sec)

  1. src/crypto/cipher/cbc.go

    // optimized implementation of CBC decryption, like crypto/aes.
    // NewCBCDecrypter will check for this interface and return the specific
    // BlockMode if found.
    type cbcDecAble interface {
    	NewCBCDecrypter(iv []byte) BlockMode
    }
    
    // NewCBCDecrypter returns a BlockMode which decrypts in cipher block chaining
    // mode, using the given Block. The length of iv must be the same as the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 28 03:55:33 UTC 2022
    - 5.4K bytes
    - Viewed (0)
  2. src/crypto/aes/modes_test.go

    	b := cipher.Block(&testBlock{})
    	if _, ok := b.(cbcDecAble); !ok {
    		t.Fatalf("testBlock does not implement the cbcDecAble interface")
    	}
    	bm := cipher.NewCBCDecrypter(b, []byte{})
    	if _, ok := bm.(testInterface); !ok {
    		t.Fatalf("cipher.NewCBCDecrypter did not use cbcDecAble interface")
    	}
    }
    
    // testStream implements the cipher.Stream interface.
    type testStream struct{}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 14 15:32:26 UTC 2018
    - 3.5K bytes
    - Viewed (0)
  3. src/crypto/cipher/cipher_test.go

    import (
    	"bytes"
    	"crypto/aes"
    	"crypto/cipher"
    	"crypto/des"
    	"testing"
    )
    
    func TestCryptBlocks(t *testing.T) {
    	buf := make([]byte, 16)
    	block, _ := aes.NewCipher(buf)
    
    	mode := cipher.NewCBCDecrypter(block, buf)
    	mustPanic(t, "crypto/cipher: input not full blocks", func() { mode.CryptBlocks(buf, buf[:3]) })
    	mustPanic(t, "crypto/cipher: output smaller than input", func() { mode.CryptBlocks(buf[:3], buf) })
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 13 21:42:23 UTC 2016
    - 2.2K bytes
    - Viewed (0)
  4. src/crypto/aes/modes.go

    }
    
    // cbcDecAble is implemented by cipher.Blocks that can provide an optimized
    // implementation of CBC decryption through the cipher.BlockMode interface.
    // See crypto/cipher/cbc.go.
    type cbcDecAble interface {
    	NewCBCDecrypter(iv []byte) cipher.BlockMode
    }
    
    // ctrAble is implemented by cipher.Blocks that can provide an optimized
    // implementation of CTR through the cipher.Stream interface.
    // See crypto/cipher/ctr.go.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 14 15:32:26 UTC 2018
    - 1.1K bytes
    - Viewed (0)
  5. src/crypto/aes/cbc_s390x.go

    	iv [BlockSize]byte
    }
    
    func (b *aesCipherAsm) NewCBCEncrypter(iv []byte) cipher.BlockMode {
    	var c cbc
    	c.b = b
    	c.c = b.function
    	copy(c.iv[:], iv)
    	return &c
    }
    
    func (b *aesCipherAsm) NewCBCDecrypter(iv []byte) cipher.BlockMode {
    	var c cbc
    	c.b = b
    	c.c = b.function + 128 // decrypt function code is encrypt + 128
    	copy(c.iv[:], iv)
    	return &c
    }
    
    func (x *cbc) BlockSize() int { return BlockSize }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:29:44 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  6. src/crypto/aes/cbc_ppc64x.go

    	iv  [BlockSize]byte
    }
    
    func (b *aesCipherAsm) NewCBCEncrypter(iv []byte) cipher.BlockMode {
    	var c cbc
    	c.b = b
    	c.enc = cbcEncrypt
    	copy(c.iv[:], iv)
    	return &c
    }
    
    func (b *aesCipherAsm) NewCBCDecrypter(iv []byte) cipher.BlockMode {
    	var c cbc
    	c.b = b
    	c.enc = cbcDecrypt
    	copy(c.iv[:], iv)
    	return &c
    }
    
    func (x *cbc) BlockSize() int { return BlockSize }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:31 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  7. src/crypto/cipher/fuzz_test.go

    			if !bytes.Equal(outdata, outgeneric) {
    				t.Fatalf("AES-CBC encryption does not match reference result: %x and %x, please report this error to ******@****.***", outdata, outgeneric)
    			}
    		}
    
    		cbcAsm = cipher.NewCBCDecrypter(c, commonIV)
    		cbcGeneric = cipher.NewCBCGenericDecrypter(c, commonIV)
    
    		if testing.Short() {
    			timeout = time.NewTimer(10 * time.Millisecond)
    		} else {
    			timeout = time.NewTimer(2 * time.Second)
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 03 13:39:12 UTC 2022
    - 2K bytes
    - Viewed (0)
  8. src/crypto/cipher/cbc_aes_test.go

    	for _, test := range cbcAESTests {
    		c, err := aes.NewCipher(test.key)
    		if err != nil {
    			t.Errorf("%s: NewCipher(%d bytes) = %s", test.name, len(test.key), err)
    			continue
    		}
    
    		decrypter := cipher.NewCBCDecrypter(c, test.iv)
    
    		data := make([]byte, len(test.out))
    		copy(data, test.out)
    
    		decrypter.CryptBlocks(data, data)
    		if !bytes.Equal(test.in, data) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 2.9K bytes
    - Viewed (0)
  9. src/crypto/cipher/benchmark_test.go

    	}
    }
    
    func BenchmarkAESCBCDecrypt1K(b *testing.B) {
    	buf := make([]byte, 1024)
    	b.SetBytes(int64(len(buf)))
    
    	var key [16]byte
    	var iv [16]byte
    	aes, _ := aes.NewCipher(key[:])
    	cbc := cipher.NewCBCDecrypter(aes, iv[:])
    	for i := 0; i < b.N; i++ {
    		cbc.CryptBlocks(buf, buf)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 28 19:13:50 UTC 2021
    - 3.3K bytes
    - Viewed (0)
  10. src/crypto/internal/boring/aes.go

    type aesCipher struct {
    	key []byte
    	enc C.GO_AES_KEY
    	dec C.GO_AES_KEY
    }
    
    type extraModes interface {
    	// Copied out of crypto/aes/modes.go.
    	NewCBCEncrypter(iv []byte) cipher.BlockMode
    	NewCBCDecrypter(iv []byte) cipher.BlockMode
    	NewCTR(iv []byte) cipher.Stream
    	NewGCM(nonceSize, tagSize int) (cipher.AEAD, error)
    }
    
    var _ extraModes = (*aesCipher)(nil)
    
    func NewAESCipher(key []byte) (cipher.Block, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 26 22:52:27 UTC 2024
    - 10.2K bytes
    - Viewed (0)
Back to top