File tree 3 files changed +27
-4
lines changed
golang.org/x/crypto/internal
3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 4
4
package subtle
5
5
6
6
// This file duplicated is these two locations:
7
- // - src/crypto/internal/subtle/
8
- // - src/golang.org/x/crypto/internal/subtle/
7
+ // - src/crypto/internal/subtle/aliasing.go
8
+ // - src/golang.org/x/crypto/internal/subtle/aliasing.go
9
+ // - src/golang.org/x/crypto/internal/alias/alias.go
9
10
10
11
import "github.com/gopherjs/gopherjs/js"
11
12
Original file line number Diff line number Diff line change
1
+ //go:build js
2
+ // +build js
3
+
4
+ package alias
5
+
6
+ // This file duplicated is these two locations:
7
+ // - src/crypto/internal/subtle/aliasing.go
8
+ // - src/golang.org/x/crypto/internal/subtle/aliasing.go
9
+ // - src/golang.org/x/crypto/internal/alias/alias.go
10
+
11
+ import "github.com/gopherjs/gopherjs/js"
12
+
13
+ // AnyOverlap reports whether x and y share memory at any (not necessarily
14
+ // corresponding) index. The memory beyond the slice length is ignored.
15
+ func AnyOverlap (x , y []byte ) bool {
16
+ // GopherJS: We can't rely on pointer arithmetic, so use GopherJS slice internals.
17
+ return len (x ) > 0 && len (y ) > 0 &&
18
+ js .InternalObject (x ).Get ("$array" ) == js .InternalObject (y ).Get ("$array" ) &&
19
+ js .InternalObject (x ).Get ("$offset" ).Int () <= js .InternalObject (y ).Get ("$offset" ).Int ()+ len (y )- 1 &&
20
+ js .InternalObject (y ).Get ("$offset" ).Int () <= js .InternalObject (x ).Get ("$offset" ).Int ()+ len (x )- 1
21
+ }
Original file line number Diff line number Diff line change 4
4
package subtle
5
5
6
6
// This file duplicated is these two locations:
7
- // - src/crypto/internal/subtle/
8
- // - src/golang.org/x/crypto/internal/subtle/
7
+ // - src/crypto/internal/subtle/aliasing.go
8
+ // - src/golang.org/x/crypto/internal/subtle/aliasing.go
9
+ // - src/golang.org/x/crypto/internal/alias/alias.go
9
10
10
11
import "github.com/gopherjs/gopherjs/js"
11
12
You can’t perform that action at this time.
0 commit comments