Documentation
¶
Index ¶
- func AllocCache(flags ...Flag) (*C.randomx_cache, error)
- func AllocDataset(flags ...Flag) (*C.randomx_dataset, error)
- func CalculateHashFirst(vm *C.randomx_vm, in []byte)
- func CreateVM(cache *C.randomx_cache, dataset *C.randomx_dataset, flags ...Flag) (*C.randomx_vm, error)
- func DatasetItemCount() uint32
- func DestroyVM(vm *C.randomx_vm)
- func FastInitFullDataset(dataset *C.randomx_dataset, cache *C.randomx_cache, workerNum uint32)
- func GetCacheMemory(cache *C.randomx_cache) unsafe.Pointer
- func GetDatasetMemory(dataset *C.randomx_dataset) unsafe.Pointer
- func InitCache(cache *C.randomx_cache, seed []byte)
- func InitDataset(dataset *C.randomx_dataset, cache *C.randomx_cache, startItem uint32, ...)
- func ReleaseCache(cache *C.randomx_cache)
- func ReleaseDataset(dataset *C.randomx_dataset)
- func SetVMCache(vm *C.randomx_vm, cache *C.randomx_cache)
- func SetVMDataset(vm *C.randomx_vm, dataset *C.randomx_dataset)
- type Flag
- type RxCache
- type RxDataset
- type RxHash
- func CalculateCommitment(in []byte, hash RxHash) (out RxHash)
- func CalculateHash(vm *C.randomx_vm, in []byte) (out RxHash)
- func CalculateHashLast(vm *C.randomx_vm) (out RxHash)
- func CalculateHashNext(vm *C.randomx_vm, in []byte) (out RxHash)
- func Search(vm *C.randomx_vm, in []byte, target uint64, maxTimes uint64, jump uint32, ...) (hash RxHash, found bool, sol []byte)
- type RxVM
- func (vm *RxVM) CalcHash(in []byte) RxHash
- func (vm *RxVM) CalcHashFirst(in []byte)
- func (vm *RxVM) CalcHashLast() RxHash
- func (vm *RxVM) CalcHashNext(in []byte) RxHash
- func (vm *RxVM) Close()
- func (vm *RxVM) Search(in []byte, target uint64, maxTimes uint64, jump uint32, nonce []byte) (hash RxHash, found bool, sol []byte)
- func (vm *RxVM) UpdateDataset(rxDataset *RxDataset)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocCache ¶
func AllocCache(flags ...Flag) (*C.randomx_cache, error)
func AllocDataset ¶
func AllocDataset(flags ...Flag) (*C.randomx_dataset, error)
func CalculateHashFirst ¶
func CalculateHashFirst(vm *C.randomx_vm, in []byte)
CalculateHashFirst will begin a hash calculation.
func CreateVM ¶
func CreateVM(cache *C.randomx_cache, dataset *C.randomx_dataset, flags ...Flag) (*C.randomx_vm, error)
func DatasetItemCount ¶
func DatasetItemCount() uint32
func DestroyVM ¶
func DestroyVM(vm *C.randomx_vm)
func FastInitFullDataset ¶
func FastInitFullDataset(dataset *C.randomx_dataset, cache *C.randomx_cache, workerNum uint32)
FastInitFullDataset using c's pthread to boost the dataset init. 472s -> 466s
func GetCacheMemory ¶
func GetCacheMemory(cache *C.randomx_cache) unsafe.Pointer
GetCacheMemory Used for p2pool internal consensus hash
func GetDatasetMemory ¶
func GetDatasetMemory(dataset *C.randomx_dataset) unsafe.Pointer
func InitCache ¶
func InitCache(cache *C.randomx_cache, seed []byte)
func InitDataset ¶
func InitDataset(dataset *C.randomx_dataset, cache *C.randomx_cache, startItem uint32, itemCount uint32)
func ReleaseCache ¶
func ReleaseCache(cache *C.randomx_cache)
func ReleaseDataset ¶
func ReleaseDataset(dataset *C.randomx_dataset)
func SetVMCache ¶
func SetVMCache(vm *C.randomx_vm, cache *C.randomx_cache)
func SetVMDataset ¶
func SetVMDataset(vm *C.randomx_vm, dataset *C.randomx_dataset)
Types ¶
type Flag ¶
type Flag int
var ( FlagDefault Flag = 0 // for all default FlagLargePages Flag = 1 // for dataset & rxCache & vm FlagHardAES Flag = 2 // for vm FlagFullMEM Flag = 4 // for vm FlagJIT Flag = 8 // for vm & cache FlagSecure Flag = 16 FlagArgon2SSSE3 Flag = 32 // for cache FlagArgon2AVX2 Flag = 64 // for cache FlagArgon2 Flag = 96 // = avx2 + sse3 )
type RxDataset ¶
type RxDataset struct {
// contains filtered or unexported fields
}
func NewRxDataset ¶
type RxHash ¶
type RxHash [C.RANDOMX_HASH_SIZE]byte
func CalculateCommitment ¶
CalculateCommitment Calculate a RandomX commitment from a RandomX hash and its input.
func CalculateHash ¶
func CalculateHash(vm *C.randomx_vm, in []byte) (out RxHash)
CalculateHash Calculates a RandomX hash value.
func CalculateHashLast ¶
func CalculateHashLast(vm *C.randomx_vm) (out RxHash)
CalculateHashLast will output the hash value of the previous input.
func CalculateHashNext ¶
func CalculateHashNext(vm *C.randomx_vm, in []byte) (out RxHash)
CalculateHashNext will output the hash value of the previous input and begin the calculation of the next hash.
type RxVM ¶
type RxVM struct {
// contains filtered or unexported fields
}
func (*RxVM) CalcHashFirst ¶
func (*RxVM) CalcHashLast ¶
func (*RxVM) CalcHashNext ¶
func (*RxVM) UpdateDataset ¶
Click to show internal directories.
Click to hide internal directories.