unkocrypto_go

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 4 Imported by: 0

README

unkocrypto_go

unkocryptoをGoに移植したもの

Documentation

Index

Constants

View Source
const (
	MinBlockSize = 32
	MaxBlockSize = 1 << 20
	// MetaSize = unsafe.Sizeof(int32(0)) + unsafe.Sizeof(int64(0))
	MetaSize = 4 + 8
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(
	blockSize int,
	checksum hash.Hash,
	rng IntRNG,
	src io.Reader,
	dst io.Writer,
) (length uint64, err error)

func Encrypt

func Encrypt(
	blockSize int,
	checksum hash.Hash,
	rng IntRNG,
	src io.Reader,
	dst io.Writer,
) (length uint64, err error)

Types

type Cause

type Cause int
const (
	InvalidBlockSize Cause = iota
	InvalidSourceSize
	InvalidDataCount
	InvalidData
	InvalidChecksum
)

func (Cause) String

func (self Cause) String() string

type IntRNG added in v1.1.0

type IntRNG interface {
	Uint32() uint32
}

type UnkocryptoError

type UnkocryptoError struct {
	Cause
}

func (UnkocryptoError) Error

func (self UnkocryptoError) Error() string

func (UnkocryptoError) String

func (self UnkocryptoError) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL