krypto

package module
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: 2 Imported by: 3

README

krypto

PkgGoDev

  • Golang implementation of cryptographic algorithms designed in Republic of Korea

  • It is intended for compatibility with the crypto package.

  • krypto does not required any other C/C++ compiler to use SIMD :)

    • But, may have not been optimized in compiler level.

LICNESE

Supported

  • A : Not tested.

  • ^ : Deprecated algorithm.

  • Block cipher

    Algorithm Package Document 128 192 256 SIMD Supports
    SEED 128 krypto/seed TTAS.KO-12.0004/R1 O
    SEED 256 krypto/seed Unknown A
    HIGHT krypto/hight TTAS.KO-12.0040/R1 O
    ARIA krypto/aria KS X 1213-1 O O O
    LEA krypto/lea TTAK.KO-12.0223 O O O x86: SSE2 AVX2
  • Digital Signature

    Algorithm Package Document
    KCDSA krypto/kcdsa TTAK.KO-12.0001/R4
    EC-KCDSA krypto/eckcdsa TTAK.KO-12.0015/R3
  • Hash

    Algorithm Package Document 160 224 256 384 512 SIMD Supports
    HAS-160^ krypto/has160 TTAS.KO-12.0011/R2 O
    LSH-256 krypto/lsh256 KS X 3262 O O x86: SSE2 SSSE3 AVX2
    LSH-512 krypto/lsh512 KS X 3262 O O O O x86: SSE2 SSSE3 AVX2
SIMD Support
  • It was based on the below.

    Algorithm x86 SIMD Supports Reference
    LEA SSE2 AVX2* KISA
    LSH-256 SSE2 SSSE3 AVX2** KISA
    LSH-512 SSE2 SSSE3 AVX2 KISA
    • *: LEA AVX2 was Disabled in default.

      • SSSE3 is more faster then AVX2 in benchmarks. It seems like a different algorithm is needed.

      • you can enable LEA AVX2 manually by build from krypto_lea_avx2 tags.

        $ go build -tags=krypto_lea_avx2 .
        
    • **: LSH-256 AVX2 with Disabled in default.

      • SSSE3 is more faster then AVX2 in benchmarks. It seems like a different algorithm is needed.

      • but you can enable LSH-256 AVX2 manually by build from krypto_lsh256_avx2 tags.

        $ go build -tags=krypto_lsh256_avx2 .
        

Performance

Installation

go get -v "github.com/RyuaNerin/go-krypto"
package main

import (
    ...
    krypto "github.com/RyuaNerin/go-krypto"
    ...
)

Usage

Todo

TODO

Documentation

Overview

Package krypto collects cryptographic algorithms designed in Republic of Korea

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHash

func RegisterHash(h KryptoHash, f func() hash.Hash)

RegisterHash registers a function that returns a new instance of the given hash function. This is intended to be called from the init function in packages that implement hash functions.

Types

type KryptoHash

type KryptoHash uint

Hash identifies a cryptographic hash function that is implemented in another package.

const (
	HAS160     KryptoHash // import github.com/RyuaNerin/go-krypto/has160
	LSH256_224            // import github.com/RyuaNerin/go-krypto/lsh256
	LSH256                // import github.com/RyuaNerin/go-krypto/lsh256
	LSH512_224            // import github.com/RyuaNerin/go-krypto/lsh512
	LSH512_256            // import github.com/RyuaNerin/go-krypto/lsh512
	LSH512_384            // import github.com/RyuaNerin/go-krypto/lsh512
	LSH512                // import github.com/RyuaNerin/go-krypto/lsh512

)

func (KryptoHash) Available

func (h KryptoHash) Available() bool

Available reports whether the given hash function is linked into the binary.

func (KryptoHash) New

func (h KryptoHash) New() hash.Hash

New returns a new hash.Hash calculating the given hash function. New panics if the hash function is not linked into the binary.

func (KryptoHash) Size

func (h KryptoHash) Size() int

func (KryptoHash) String

func (h KryptoHash) String() string

Directories

Path Synopsis
Package aria implements ARIA encryption, as defined in KS X 1213-1
Package aria implements ARIA encryption, as defined in KS X 1213-1
Package eckcdsa implements the EC-KCDSA(Korean Certificate-based Digital Signature Algorithm using Elliptic Curves) as defined in TTAK.KO-12.0015/R3
Package eckcdsa implements the EC-KCDSA(Korean Certificate-based Digital Signature Algorithm using Elliptic Curves) as defined in TTAK.KO-12.0015/R3
Package has160 implements HAS-160 encryption, as defined in TTAS.KO-12.0011/R2
Package has160 implements HAS-160 encryption, as defined in TTAS.KO-12.0011/R2
Package hight implements HIGHT encryption, as defined in TTAS.KO-12.0040/R1
Package hight implements HIGHT encryption, as defined in TTAS.KO-12.0040/R1
randutil
crypto/internal/randutil/randutil.go
crypto/internal/randutil/randutil.go
subtle
Package subtle implements functions that are often useful in cryptographic code but require careful thought to use correctly.
Package subtle implements functions that are often useful in cryptographic code but require careful thought to use correctly.
Package kcdsa implements the KCDSA(Korean Certificate-based Digital Signature Algorithm) as defined in TTAK.KO-12.0001/R4
Package kcdsa implements the KCDSA(Korean Certificate-based Digital Signature Algorithm) as defined in TTAK.KO-12.0001/R4
kcdsattak
Package kcdsattak implements functions what generate the KCDSA parameters as defined in TTAK.KO-12.0001/R4
Package kcdsattak implements functions what generate the KCDSA parameters as defined in TTAK.KO-12.0001/R4
Package lea implements LEA encryption, as defined in TTAK.KO-12.0223
Package lea implements LEA encryption, as defined in TTAK.KO-12.0223
Package lsh256 implements the LSH-256, LSH-256-224 hash algorithms as defined in KS X 3262
Package lsh256 implements the LSH-256, LSH-256-224 hash algorithms as defined in KS X 3262
Package lsh512 implements the LSH-512, LSH-384, LSH-512-256, LSH-512-224 hash algorithms as defined in KS X 3262
Package lsh512 implements the LSH-512, LSH-384, LSH-512-256, LSH-512-224 hash algorithms as defined in KS X 3262
Package seed implements SEED encryption, as defined in TTAS.KO-12.0004/R1
Package seed implements SEED encryption, as defined in TTAS.KO-12.0004/R1

Jump to

Keyboard shortcuts

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