Skip to content

Releases: rekurt/gost-crypto

v0.3.0

Choose a tag to compare

@rekurt rekurt released this 08 Apr 15:10
80da2c5

51 files changed, +4475 lines, -187 lines since v0.2.0.
New Packages

pkg/gostx509 — X.509 certificate operations with GOST R 34.10-2012
    CreateSelfSigned — self-signed certificates
    CreateCSR — certificate signing requests (PKCS#10)
    ParseDER / ParsePEM — certificate parsing
    Certificate.Verify / VerifySelfSigned — signature verification

pkg/cms — CMS/PKCS#7 SignedData for electronic document management (ЭДО)
    Sign — attached and detached signatures
    Verify — signature verification
    ParseDER — parse existing CMS structures
    DER and PEM serialization

New Cryptographic Primitives

Magma block cipher (GOST R 34.12-2015, 64-bit block) — cipher.Block
Magma-MGM AEAD — cipher.AEAD with 8-byte nonce/tag
All GOST R 34.13-2015 cipher modes: CTR, CBC, CFB, OFB for both Kuznechik and Magma
CMAC/OMAC1 — message authentication for both ciphers
PBKDF2 with HMAC-Streebog-256/512 (RFC 8018)
Stateful io.ReadCloser streaming encryption for CTR/CFB/OFB

Go Ecosystem Integration

crypto.Signer interface on PrivKey — enables Go TLS/X.509 integration
encoding.BinaryMarshaler/BinaryUnmarshaler for key serialization
PubKey.Bytes() — public key extraction
NID() / Key() getters on cipher mode types for streaming API
HashStreebog256/HashStreebog512 constants for crypto.SignerOpts

Security Hardening

mlock() on all symmetric cipher key buffers — prevents swap to disk
Eliminated Streebog temp file spill — removed /tmp/gost3411-* filesystem side-channel
Zeroize all KDF/HKDF/PBKDF2/HD intermediate buffers with OPENSSL_cleanse
Fixed PBKDF2 double-HMAC — was HMAC(HMAC(Streebog)) instead of HMAC(Streebog), violating RFC 8018
Fixed crypto.RegisterHash panic — hash IDs 100/101 exceeded Go's maxHash
Fixed stream readers — old code created new cipher context per Read(), resetting CTR counter
Cipher constructor cleanup — error paths now wipe and munlock key material
UTF-8 validation in X.509 distinguished name fields
ASN1_TIME error checking in certificate creation
OPENSSL_free for OpenSSL-allocated buffers (was using libc free)
PBKDF2 iteration validation — panics on iterations < 1

CI/CD

CI now installs gost-engine via git clone --recurse-submodules and runs full crypto test suite
Added .golangci.yml with errcheck exclusions for hash.Hash.Write
openssl engine gost -t verification step (fail-fast on broken setup)

Test Improvements

Normative test vectors: GOST R 34.12-2015 A.1 (Kuznechik), A.2 (Magma), RFC 6986 M2 (Streebog)
Fuzz tests for ParsePath, LoadPrivKey, VerifyDigest, MGM.Open
X.509 roundtrip tests (DER/PEM, self-signed, wrong-key rejection)
CMS tests (detached/attached, tampered data, 256/512-bit curves)
Key encoding roundtrip tests

API Changes

NewMGMFromKey renamed to NewKuznechikMGMFromKey (old name kept as deprecated alias)
Consistent error messages across all AEAD Seal/Open methods

Breaking Changes
None — fully backward compatible with v0.2.0

Full Changelog: v0.2.1...v0.3.0

v0.2.0

Choose a tag to compare

@rekurt rekurt released this 08 Apr 00:33

What's Changed

Documentation & SEO

  • Rich package documentation for all packages (pkg.go.dev)
  • Example tests: ExampleSign, ExampleVerify, ExampleAgree, ExampleHash, ExampleGenerateKey, ExampleAllCurves
  • README: "Why gost-crypto?" section, feature table with Go interfaces, standards compliance
  • Russian README with GOST-specific keywords
  • GitHub repository metadata: topics, description, homepage

Community

  • Issue templates (bug report, feature request)
  • Pull request template
  • Code of Conduct (Contributor Covenant)
  • CITATION.cff for academic citations

CI

  • Codecov coverage upload

Version 0.1.0

Choose a tag to compare

@rekurt rekurt released this 07 Apr 23:41

New Features

  • v1.0 rewrite — OpenSSL gost-engine backend #3
  • gostcrypto facade: Sign, Verify, Hash, Agree
  • HD key derivation with HKDF-Streebog
  • Kuznechik cipher.Block + MGM AEAD (GOST R 34.12/13)
  • GOST R 34.10-2012 signatures + VKO, all 8 TC26 curves
  • KDF_GOSTR3411 (P 50.1.113-2016) + HKDF-Streebog
  • Streebog-256/512 hash.Hash + HMAC-Streebog
  • CGO bindings for gost-engine
  • crypto.Signer interface for PrivKey

Improvements

  • Restructure docs, rewrite README #13
  • GitHub Actions CI (Go 1.22/1.23/stable)
  • Dockerfiles + gost-engine install script

Bug Fixes

  • Validate cipher key/IV lengths before EVP init #9
  • Fix Streebog Write with disk spill buffering #10
  • Cap incremental hash buffer growth
  • Private key range validation (0 < d < q)

Other

  • Verify gost-engine source, disable auto activation #6
  • Remove gogost (GPL v3), consolidate on OpenSSL #5

v0.0.3 total improvements

Choose a tag to compare

@rekurt rekurt released this 03 Mar 21:40
355f9e2

Pure Go implementation of Russian GOST cryptographic standards: digital signatures (GOST R 34.10-2012), cryptographic hashing (GOST R 34.11-2012 Streebog), and key management for TC26 elliptic curves.

What's Changed

Full Changelog: v0.0.1...v0.0.3

Gost validation tests (https://github.com/rekurt/gost-crypto/pull/1)

Choose a tag to compare

@rekurt rekurt released this 03 Mar 21:28
fb08823
  • feat: fix bugs in NewPrivKey, padToSize, HashID inference, and benchmarks
  • feat: add RFC 6986 Streebog test vectors, long message and incremental tests
  • feat: expand gost3410 test coverage to 81.5% with comprehensive validation tests
  • feat: expand gostcrypto and kdf/hd test coverage with roundtrip, corruption, and fuzz tests
  • feat: verify acceptance criteria - all tests pass, coverage >= 80% across all packages
  • documentation fixes

What's Changed

New Contributors

  • @rekurt made their first contribution in #1

Full Changelog: https://github.com/rekurt/gost-crypto/commits/v0.0.2

v0.0.1

Choose a tag to compare

@rekurt rekurt released this 03 Mar 07:06
fb08823
Gost validation tests (#1)

* feat: fix bugs in NewPrivKey, padToSize, HashID inference, and benchmarks
* feat: add RFC 6986 Streebog test vectors, long message and incremental tests
* feat: expand gost3410 test coverage to 81.5% with comprehensive validation tests
* feat: expand gostcrypto and kdf/hd test coverage with roundtrip, corruption, and fuzz tests
* feat: verify acceptance criteria - all tests pass, coverage >= 80% across all packages
* documentation fixes