github.com/decred/dcrlnd@v0.7.6/internal/zero/array.go (about)

     1  // Copyright (c) 2015 The btcsuite developers
     2  // Copyright (c) 2015 The Decred developers
     3  // Use of this source code is governed by an ISC
     4  // license that can be found in the LICENSE file.
     5  
     6  package zero
     7  
     8  // Bytea32 clears the 32-byte array by filling it with the zero value.
     9  // This is used to explicitly clear private key material from memory.
    10  func Bytea32(b *[32]byte) {
    11  	*b = [32]byte{}
    12  }
    13  
    14  // Bytea64 clears the 64-byte array by filling it with the zero value.
    15  // This is used to explicitly clear sensitive material from memory.
    16  func Bytea64(b *[64]byte) {
    17  	*b = [64]byte{}
    18  }