...

Source file src/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go

Documentation: golang.org/x/crypto/salsa20/salsa

     1  // Copyright 2012 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build amd64 && !purego && gc
     6  
     7  package salsa
     8  
     9  //go:noescape
    10  
    11  // salsa2020XORKeyStream is implemented in salsa20_amd64.s.
    12  func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte)
    13  
    14  // XORKeyStream crypts bytes from in to out using the given key and counters.
    15  // In and out must overlap entirely or not at all. Counter
    16  // contains the raw salsa20 counter bytes (both nonce and block counter).
    17  func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) {
    18  	if len(in) == 0 {
    19  		return
    20  	}
    21  	_ = out[len(in)-1]
    22  	salsa2020XORKeyStream(&out[0], &in[0], uint64(len(in)), &counter[0], &key[0])
    23  }
    24  

View as plain text