kcdsa

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	A2048B224SHA224 = iota // 권고
	A2048B224SHA256        // A2048B224SHA224 와 강도 동일
	A2048B256SHA256        // 효율성이 떨어지지만, 필요에 따라 이용 가능하다.
	A3072B256SHA256        // 권고
	A1024B160HAS160        // 레거시
)

Variables

This section is empty.

Functions

func GenerateG

func GenerateG(
	G *big.Int,

	P, J, H *big.Int,
) (ok bool)

func GenerateHG

func GenerateHG(
	H, G *big.Int,

	buf []byte,
	rand io.Reader,
	P, J *big.Int,
) (bufOut []byte, err error)

func GenerateJ

func GenerateJ(
	J *big.Int, buf []byte,

	seed []byte,
	h hash.Hash,
	d Domain,
) (bufNew []byte, ok bool)

func GeneratePQ

func GeneratePQ(
	P, Q *big.Int, buf []byte,

	J *big.Int,
	seed []byte,
	h hash.Hash,
	d Domain,
) (bufNew []byte, count int, ok bool)

func GenerateX

func GenerateX(
	X *big.Int,
	Q *big.Int, upri, xkey []byte, h hash.Hash, d Domain,
)

func GenerateY

func GenerateY(
	Y *big.Int,
	P, Q, G, X *big.Int,
)

func RegeneratePQ

func RegeneratePQ(
	domain Domain,
	J *big.Int,
	seed []byte,
	count int,
) (
	P, Q *big.Int,
	ok bool,
)

func Sign

func Sign(
	R, S *big.Int,
	P, Q, G, Y, X *big.Int,
	domain Domain,
	K *big.Int,
	data []byte,
	tmpInt *big.Int,
	tmpBuf []byte,
) (tmpBufOut []byte, ok bool)

func Verify

func Verify(
	P, Q, G, Y *big.Int,
	domain Domain,
	data []byte,
	R, S *big.Int,
) bool

Types

type Domain

type Domain struct {
	A, B int // 소수 p와 q의 비트 길이를 각각 α와 β라 할 때, 두 값의 순서 쌍
	LH   int // 해시 코드의 비트 길이
	L    int // ℓ 해시 함수의 입력 블록 비트 길이

	NewHash func() hash.Hash
}

func GetDomain

func GetDomain(sizes int) (Domain, bool)

type GeneratedParameter

type GeneratedParameter struct {
	P     *big.Int
	Q     *big.Int
	G     *big.Int
	J     *big.Int
	Seed  []byte
	Count int
	H     *big.Int
}

func GenerateParametersFast

func GenerateParametersFast(rand io.Reader, d Domain) (generated GeneratedParameter, err error)

func GenerateParametersTTAK

func GenerateParametersTTAK(rand io.Reader, domain Domain) (generated GeneratedParameter, err error)

Jump to

Keyboard shortcuts

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