certichain

Blockchain built from scratch for verifying document's legitimacy.
Log | Files | Refs | README | LICENSE

commit 733ebfb88b16991f42f276aba3caef952b157ad2
parent edb65855078641af75e37c06d31b9c5d8e14f064
Author: Shivakumar <[email protected]>
Date:   Fri, 10 Jul 2026 13:44:31 +0530

chore: fix typos

Signed-off-by: Shivakumar <[email protected]>

Diffstat:
Minternal/crypto/hash.go | 6+++---
Minternal/crypto/keys.go | 8++++----
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/internal/crypto/hash.go b/internal/crypto/hash.go @@ -31,12 +31,12 @@ const ( type Hash [HashSize]byte -// CanonicalBytes function encodes the fields into a determinstic +// CanonicalBytes function encodes the fields into a deterministic // byte sequence: // // |[len(field_1)][field_1][len(field_2)][field_2]...| // -// Each lenght is encoded as an uint64 BigEndian. +// Each length is encoded as an uint64 BigEndian. func CanonicalBytes(fields ...[]byte) ([]byte, error) { bufSize := 0 for _, field := range fields { @@ -69,7 +69,7 @@ func HashBytes(data []byte) Hash { return sha256.Sum256(data) } -// HashCanonical function canonicalises the fields and hashes them +// HashCanonical function canonicalizes the fields and hashes them // to get a SHA-256 32 byte digest. func HashCanonical(fields ...[]byte) (Hash, error) { canonical, err := CanonicalBytes(fields...) diff --git a/internal/crypto/keys.go b/internal/crypto/keys.go @@ -29,7 +29,7 @@ func GenerateKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error) { return ed25519.GenerateKey(rand.Reader) } -// PrivateKeyToPEM serilizes a Ed25519 private key into PEM-encoded +// PrivateKeyToPEM serializes a Ed25519 private key into PEM-encoded // PKCS#8 format. // // Output format: @@ -55,7 +55,7 @@ func PrivateKeyToPEM(key ed25519.PrivateKey) ([]byte, error) { return pem.EncodeToMemory(block), nil } -// PublicKeyToPEM serilizes a Ed25519 public key into PEM-encoded +// PublicKeyToPEM serializes a Ed25519 public key into PEM-encoded // PKIX format. // // Output format: @@ -103,7 +103,7 @@ func PrivateKeyFromPEM(pemBytes []byte) (ed25519.PrivateKey, error) { key, err := x509.ParsePKCS8PrivateKey(block.Bytes) if err != nil { - return nil, fmt.Errorf("parseing private key: %w", err) + return nil, fmt.Errorf("parsing private key: %w", err) } privateKey, ok := key.(ed25519.PrivateKey) @@ -140,7 +140,7 @@ func PublicKeyFromPEM(pemBytes []byte) (ed25519.PublicKey, error) { key, err := x509.ParsePKIXPublicKey(block.Bytes) if err != nil { - return nil, fmt.Errorf("parseing public key: %w", err) + return nil, fmt.Errorf("parsing public key: %w", err) } publicKey, ok := key.(ed25519.PublicKey)