Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for CryptBlocks (0.15 sec)

  1. src/crypto/cipher/cipher_test.go

    	mustPanic(t, "crypto/cipher: output smaller than input", func() { mode.CryptBlocks(buf[:3], buf) })
    
    	mode = cipher.NewCBCEncrypter(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)
  2. src/crypto/cipher/cipher.go

    	// BlockSize returns the mode's block size.
    	BlockSize() int
    
    	// CryptBlocks encrypts or decrypts a number of blocks. The length of
    	// src must be a multiple of the block size. Dst and src must overlap
    	// entirely or not at all.
    	//
    	// If len(dst) < len(src), CryptBlocks should panic. It is acceptable
    	// to pass a dst bigger than src, and in that case, CryptBlocks will
    	// only update dst[:len(src)] and will not touch the rest of dst.
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 28 03:55:33 UTC 2022
    - 2.4K bytes
    - Viewed (0)
  3. src/crypto/aes/cipher_s390x.go

    	key      []byte   // key (128, 192 or 256 bits)
    	storage  [32]byte // array backing key slice
    }
    
    // cryptBlocks invokes the cipher message (KM) instruction with
    // the given function code. This is equivalent to AES in ECB
    // mode. The length must be a multiple of BlockSize (16).
    //
    //go:noescape
    func cryptBlocks(c code, key, dst, src *byte, length int)
    
    func newCipher(key []byte) (cipher.Block, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:29:44 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  4. src/crypto/cipher/fuzz_test.go

    		outdata := make([]byte, datalen)
    
    	fuzzencrypt:
    		for {
    			select {
    			case <-timeout.C:
    				break fuzzencrypt
    			default:
    			}
    
    			rand.Read(indata[:])
    
    			cbcGeneric.CryptBlocks(indata, outgeneric)
    			cbcAsm.CryptBlocks(indata, outdata)
    
    			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)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 03 13:39:12 UTC 2022
    - 2K bytes
    - Viewed (0)
  5. src/crypto/cipher/cbc.go

    		panic("cipher.NewCBCEncrypter: IV length must equal block size")
    	}
    	return (*cbcEncrypter)(newCBC(b, iv))
    }
    
    func (x *cbcEncrypter) BlockSize() int { return x.blockSize }
    
    func (x *cbcEncrypter) CryptBlocks(dst, src []byte) {
    	if len(src)%x.blockSize != 0 {
    		panic("crypto/cipher: input not full blocks")
    	}
    	if len(dst) < len(src) {
    		panic("crypto/cipher: output smaller than input")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 28 03:55:33 UTC 2022
    - 5.4K bytes
    - Viewed (0)
  6. src/crypto/cipher/cbc_aes_test.go

    			continue
    		}
    
    		encrypter := cipher.NewCBCEncrypter(c, test.iv)
    
    		data := make([]byte, len(test.in))
    		copy(data, test.in)
    
    		encrypter.CryptBlocks(data, data)
    		if !bytes.Equal(test.out, data) {
    			t.Errorf("%s: CBCEncrypter\nhave %x\nwant %x", test.name, data, test.out)
    		}
    	}
    }
    
    func TestCBCDecrypterAES(t *testing.T) {
    	for _, test := range cbcAESTests {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 2.9K bytes
    - Viewed (0)
  7. src/crypto/cipher/benchmark_test.go

    	for i := 0; i < b.N; i++ {
    		cbc.CryptBlocks(buf, buf)
    	}
    }
    
    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)
  8. src/crypto/aes/cbc_s390x.go

    // with the given function code. The length must be a multiple of BlockSize (16).
    //
    //go:noescape
    func cryptBlocksChain(c code, iv, key, dst, src *byte, length int)
    
    func (x *cbc) CryptBlocks(dst, src []byte) {
    	if len(src)%BlockSize != 0 {
    		panic("crypto/cipher: input not full blocks")
    	}
    	if len(dst) < len(src) {
    		panic("crypto/cipher: output smaller than input")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:29:44 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  9. src/crypto/cipher/example_test.go

    	if len(ciphertext)%aes.BlockSize != 0 {
    		panic("ciphertext is not a multiple of the block size")
    	}
    
    	mode := cipher.NewCBCDecrypter(block, iv)
    
    	// CryptBlocks can work in-place if the two arguments are the same.
    	mode.CryptBlocks(ciphertext, ciphertext)
    
    	// If the original plaintext lengths are not a multiple of the block
    	// size, padding would have to be added when encrypting, which would be
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 30 16:23:44 UTC 2018
    - 11.8K bytes
    - Viewed (0)
  10. src/crypto/aes/cbc_ppc64x.go

    // cryptBlocksChain invokes the cipher message identifying encrypt or decrypt.
    //
    //go:noescape
    func cryptBlocksChain(src, dst *byte, length int, key *uint32, iv *byte, enc int, nr int)
    
    func (x *cbc) CryptBlocks(dst, src []byte) {
    	if len(src)%BlockSize != 0 {
    		panic("crypto/cipher: input not full blocks")
    	}
    	if len(dst) < len(src) {
    		panic("crypto/cipher: output smaller than input")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:31 UTC 2024
    - 1.7K bytes
    - Viewed (0)
Back to top