Move internal packages to internal directory
This commit is contained in:
parent
3f70ec75be
commit
25b7fc4cc0
8
cache.go
8
cache.go
|
@ -1,9 +1,9 @@
|
|||
package randomx
|
||||
|
||||
import (
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/argon2"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/blake2"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/keys"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/argon2"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/blake2"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/keys"
|
||||
"runtime"
|
||||
"slices"
|
||||
"unsafe"
|
||||
|
@ -60,7 +60,7 @@ func (cache *Cache) Init(key []byte) {
|
|||
|
||||
kkey := slices.Clone(key)
|
||||
|
||||
argonBlocks := argon2.BuildBlocks(kkey, []byte(RANDOMX_ARGON_SALT), []byte{}, []byte{}, RANDOMX_ARGON_ITERATIONS, RANDOMX_ARGON_MEMORY, RANDOMX_ARGON_LANES, 0)
|
||||
argonBlocks := argon2.BuildBlocks(kkey, []byte(RANDOMX_ARGON_SALT), RANDOMX_ARGON_ITERATIONS, RANDOMX_ARGON_MEMORY, RANDOMX_ARGON_LANES)
|
||||
|
||||
memoryBlocks := unsafe.Slice((*MemoryBlock)(unsafe.Pointer(unsafe.SliceData(argonBlocks))), int(unsafe.Sizeof(argon2.Block{}))/int(unsafe.Sizeof(MemoryBlock{}))*len(argonBlocks))
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
package randomx
|
||||
|
||||
import "git.gammaspectra.live/P2Pool/go-randomx/v3/argon2"
|
||||
import "git.gammaspectra.live/P2Pool/go-randomx/v3/internal/argon2"
|
||||
|
||||
// see reference configuration.h
|
||||
// Cache size in KiB. Must be a power of 2.
|
||||
|
|
|
@ -30,7 +30,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
package aes
|
||||
|
||||
import (
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/keys"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/keys"
|
||||
"unsafe"
|
||||
)
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
package aes
|
||||
|
||||
import (
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/asm"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/keys"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/asm"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/keys"
|
||||
"golang.org/x/sys/cpu"
|
||||
"unsafe"
|
||||
)
|
|
@ -3,7 +3,7 @@
|
|||
package aes
|
||||
|
||||
import (
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/keys"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/keys"
|
||||
"unsafe"
|
||||
)
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
package aes
|
||||
|
||||
import (
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/asm"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/asm"
|
||||
)
|
||||
|
||||
func aesroundtrip_decenc(states *[4][4]uint32, keys *[4][4]uint32) {
|
|
@ -23,7 +23,7 @@ func initBlocks(h0 *[blake2b.Size + 8]byte, memory, threads uint32) []Block
|
|||
func processBlocks(B []Block, time, memory, threads uint32, mode int)
|
||||
|
||||
// BuildBlocks From golang.org/x/crypto/argon2.deriveKey without last deriveKey call
|
||||
func BuildBlocks(password, salt, secret, data []byte, time, memory uint32, threads uint8, keyLen uint32) []Block {
|
||||
func BuildBlocks(password, salt []byte, time, memory uint32, threads uint8) []Block {
|
||||
if time < 1 {
|
||||
panic("argon2: number of rounds too small")
|
||||
}
|
||||
|
@ -31,7 +31,8 @@ func BuildBlocks(password, salt, secret, data []byte, time, memory uint32, threa
|
|||
panic("argon2: parallelism degree too low")
|
||||
}
|
||||
const mode = 0 /* argon2d */
|
||||
h0 := initHash(password, salt, secret, data, time, memory, uint32(threads), keyLen, mode)
|
||||
const keyLen = 0
|
||||
h0 := initHash(password, salt, nil, nil, time, memory, uint32(threads), keyLen, mode)
|
||||
|
||||
memory = memory / (syncPoints * uint32(threads)) * (syncPoints * uint32(threads))
|
||||
if memory < 2*syncPoints*uint32(threads) {
|
|
@ -4,7 +4,7 @@ package randomx
|
|||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/asm"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/asm"
|
||||
)
|
||||
|
||||
/*
|
||||
|
|
|
@ -30,7 +30,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
package randomx
|
||||
|
||||
import (
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/blake2"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/blake2"
|
||||
"math/bits"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package randomx
|
||||
|
||||
import "git.gammaspectra.live/P2Pool/go-randomx/v3/blake2"
|
||||
import "git.gammaspectra.live/P2Pool/go-randomx/v3/internal/blake2"
|
||||
|
||||
// SuperScalarInstruction superscalar program is built with superscalar instructions
|
||||
type SuperScalarInstruction struct {
|
||||
|
|
2
vm.go
2
vm.go
|
@ -30,7 +30,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
package randomx
|
||||
|
||||
import (
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/aes"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/aes"
|
||||
"math"
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
package randomx
|
||||
|
||||
import (
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/asm"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/asm"
|
||||
"math"
|
||||
"math/bits"
|
||||
)
|
||||
|
|
|
@ -30,7 +30,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
package randomx
|
||||
|
||||
import (
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/aes"
|
||||
"git.gammaspectra.live/P2Pool/go-randomx/v3/internal/aes"
|
||||
"unsafe"
|
||||
)
|
||||
import "encoding/binary"
|
||||
|
|
Loading…
Reference in a new issue