Debian Codegraph @

drbg/internal/aes/tools.go

raw symbols SCIP
1 // Copyright 2018 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 // +build !appengine
6
7 // Package subtle implements functions that are often useful in cryptographic
8 // code but require careful thought to use correctly.
9 //
10 // This is a mirror of golang.org/x/crypto/internal/subtle.
11 package aesscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/drbg/internal/aes`/
12
13 import "unsafescip-go gomod github.com/golang/go/src go1.12 unsafe/"
14
15 // AnyOverlap reports whether x and y share memory at any (not necessarily
16 // corresponding) index. The memory beyond the slice length is ignored.
17 func AnyOverlapscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/drbg/internal/aes`/AnyOverlap().(x, y []byte) bool {
18 return len(x) > 0 && len(y) > 0 &&
19 uintptr(unsafescip-go gomod github.com/golang/go/src go1.12 unsafe/.Pointer(&x[0])) <= uintptr(unsafescip-go gomod github.com/golang/go/src go1.12 unsafe/.Pointer(&y[len(y)-1])) &&
20 uintptr(unsafescip-go gomod github.com/golang/go/src go1.12 unsafe/.Pointer(&y[0])) <= uintptr(unsafescip-go gomod github.com/golang/go/src go1.12 unsafe/.Pointer(&x[len(x)-1]))
21 }
22
23 // InexactOverlap reports whether x and y share memory at any non-corresponding
24 // index. The memory beyond the slice length is ignored. Note that x and y can
25 // have different lengths and still not have any inexact overlap.
26 //
27 // InexactOverlap can be used to implement the requirements of the crypto/cipher
28 // AEAD, Block, BlockMode and Stream interfaces.
29 func InexactOverlapscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/drbg/internal/aes`/InexactOverlap().(x, y []byte) bool {
30 if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] {
31 return false
32 }
33 return AnyOverlapscip-go gomod github.com/henrydcase/nobs . `github.com/henrydcase/nobs/drbg/internal/aes`/AnyOverlap().(x, y)
34 }