kcdsattak

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package kcdsattak implements functions what generate the KCDSA parameters as defined in TTAK.KO-12.0001/R4

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUseAnotherSeed = errors.New("krypto/kcdsa/kcdsattak: use another seed")
	ErrUseAnotherH    = errors.New("krypto/kcdsa/kcdsattak: use another H")
	ErrWrongSeed      = errors.New("krypto/kcdsa/kcdsattak: wrong seed length")
	ErrShortXKey      = errors.New("krypto/kcdsa/kcdsattak: XKEY is too short")
)

Functions

func GenerateG

func GenerateG(P, J *big.Int, H []byte) (G *big.Int, err error)

Generate P, defined in TTAK.KO-12.0001/R4 1 < H < (p-1)

func GenerateHG

func GenerateHG(rand io.Reader, P, J *big.Int) (H []byte, G *big.Int, err error)

Generate H, G, defined in TTAK.KO-12.0001/R4

func GenerateJ

func GenerateJ(seed []byte, domain Domain) (J *big.Int, err error)

Generate J, defined in TTAK.KO-12.0001/R4 bits of seed > domain.B

func GeneratePQ

func GeneratePQ(J *big.Int, seed []byte, domain Domain) (p, q *big.Int, count int, err error)

Generate P, Q, defined in TTAK.KO-12.0001/R4

func GenerateXYZ

func GenerateXYZ(P, Q, G *big.Int, userProvidedRandomInput []byte, xkey []byte, domain Domain) (X, Y, Z *big.Int, xkeyNext []byte, err error)

Generate X, Y, Z, defined in TTAK.KO-12.0001/R4 bits of xkey > B

func PPGF

func PPGF(seed []byte, nBits int, domain Domain) []byte

Pre-prime generating function

Types

type Domain

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

	NewHash func() hash.Hash
}

Jump to

Keyboard shortcuts

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