Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for permuteInitialBlock (0.15 sec)

  1. src/crypto/des/block.go

    				f = (f << 1) | (f >> 31)
    
    				feistelBox[s][t] = uint32(f)
    			}
    		}
    	}
    }
    
    // permuteInitialBlock is equivalent to the permutation defined
    // by initialPermutation.
    func permuteInitialBlock(block uint64) uint64 {
    	// block = b7 b6 b5 b4 b3 b2 b1 b0 (8 bytes)
    	b1 := block >> 48
    	b2 := block << 48
    	block ^= b1 ^ b2 ^ b1<<48 ^ b2>>48
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  2. src/crypto/des/internal_test.go

    // license that can be found in the LICENSE file.
    
    package des
    
    import "testing"
    
    func TestInitialPermute(t *testing.T) {
    	for i := uint(0); i < 64; i++ {
    		bit := uint64(1) << i
    		got := permuteInitialBlock(bit)
    		want := uint64(1) << finalPermutation[63-i]
    		if got != want {
    			t.Errorf("permute(%x) = %x, want %x", bit, got, want)
    		}
    	}
    }
    
    func TestFinalPermute(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 29 16:49:56 UTC 2023
    - 714 bytes
    - Viewed (0)
  3. src/crypto/des/cipher.go

    		panic("crypto/des: output not full block")
    	}
    	if alias.InexactOverlap(dst[:BlockSize], src[:BlockSize]) {
    		panic("crypto/des: invalid buffer overlap")
    	}
    
    	b := byteorder.BeUint64(src)
    	b = permuteInitialBlock(b)
    	left, right := uint32(b>>32), uint32(b)
    
    	left = (left << 1) | (left >> 31)
    	right = (right << 1) | (right >> 31)
    
    	for i := 0; i < 8; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 4K bytes
    - Viewed (0)
Back to top