Stdlib module crypto.vitl

This page is a wiki-style reference for one concrete stdlib file. It explains what the file owns, where it fits in the family, and how to decide whether this is the right surface to depend on.

Visual portrait of crypto.vitl
Wiki-style portrait for crypto.vitl.

Family: crypto

Kind: public stdlib surface

Page style: this reference follows the same “encyclopedic card + portrait + usage contract” logic as the keyword pages, but for stdlib modules.

Summary

Overview

FieldValue
Pathcrypto.vitl
Familycrypto
Kindpublic stdlib surface
Line count293
Declared procedures44
Declared forms/picks6

`crypto.vitl` is a public stdlib surface inside the `crypto` family. It should be read as one focused slice of the broader family responsibility: Hashing, HMAC, randomness, key derivation, symmetric primitives, and asymmetric primitives.

Purpose

This file should be chosen because of responsibility, not because its name “sounds close enough”. Inside the crypto family, it carries one focused part of the contract and keeps that responsibility separate from neighboring concerns.

  • A package manifest can be serialized first, then hashed, then optionally signed.
  • A token flow can derive a key in one boundary and use it in another without mixing concerns.

Taxonomy

Think of this page as a generated encyclopedia entry rather than a hand-written tutorial. The goal is to show what kind of module this is, how dense it is, and what reading strategy makes sense before depending on it.

  • Large algorithm surface: this file exposes many procedures and likely acts as a domain toolkit rather than a single thin wrapper.
  • Owns domain vocabulary: the module declares data shapes in addition to executable helpers, so its types are part of the contract.
  • Has tuning constants: part of the module behavior is controlled by named constants that document default precision, limits, or policy.
  • Minimal top-level dependencies: the module reads as mostly self-contained from its opening declarations.
  • Explicit export surface: the file ends with visible export declarations instead of relying only on implicit namespace discovery.

Implementation profile

This profile is inferred directly from the source text. It does not replace reading the file, but it tells you quickly whether the module is mostly declarative, loop-heavy, branch-heavy, or organized around many small exits.

SignalCountWhat it suggests
if0Branching density and local decision-making.
while0Loop-heavy or iterative implementation style.
for1Collection-style traversal at source level.
match0Variant-driven branching or grammar-style decoding.
let1Local state and intermediate value density.
give44Number of explicit exit points and result shaping.

Top-level API inventory

SurfaceItems
Procedurescrypto_version, crypto_name, crypto_modules, crypto_module_count, crypto_manifest, crypto_ready, crypto_health, crypto_summary, crypto_report, md5, md5_hex, sha1
FormsCryptoLibraryManifest, CryptoLibraryHealth, CryptoLibrarySummary, CryptoLibraryReport, Hash, HMAC
Picksnone declared at top level
ConstantsSHA1_DIGEST_SIZE, SHA256_DIGEST_SIZE, SHA512_DIGEST_SIZE, AES_ECB, AES_CBC, AES_CTR, AES_GCM, AES_128, AES_192, AES_256
Exports*

Imported surfaces

This file does not advertise a top-level `use` surface in its opening declarations. That often means it is either self-contained or an aggregation layer.

Position in family

This file is module 1 of 9 in the crypto family when ordered by path. By procedure count it ranks 1, and by line count it ranks 1. Those ranks are useful as rough signals of breadth, not as quality judgments.

Declaration map

The declaration map turns raw source into a scan-friendly catalog. It is useful when the file is large enough that a reader wants to orient by kinds of surfaces first.

LineNameKindRole
1vitte/cryptospaceDeclares the namespace that anchors this file in the stdlib tree.
9CryptoLibraryManifestformIntroduces a structured data shape that other procedures can exchange.
15CryptoLibraryHealthformIntroduces a structured data shape that other procedures can exchange.
25CryptoLibrarySummaryformIntroduces a structured data shape that other procedures can exchange.
30CryptoLibraryReportformIntroduces a structured data shape that other procedures can exchange.
36SHA1_DIGEST_SIZEconstDefines a named constant reused across the module.
37SHA256_DIGEST_SIZEconstDefines a named constant reused across the module.
38SHA512_DIGEST_SIZEconstDefines a named constant reused across the module.
41AES_ECBconstDefines a named constant reused across the module.
42AES_CBCconstDefines a named constant reused across the module.
43AES_CTRconstDefines a named constant reused across the module.
44AES_GCMconstDefines a named constant reused across the module.
47AES_128constDefines a named constant reused across the module.
48AES_192constDefines a named constant reused across the module.
49AES_256constDefines a named constant reused across the module.
51HashformIntroduces a structured data shape that other procedures can exchange.
58HMACformIntroduces a structured data shape that other procedures can exchange.
65crypto_versionprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
69crypto_nameprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
73crypto_modulesprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
83crypto_module_countprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
87crypto_manifestprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
95crypto_readyprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
99crypto_healthprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
111crypto_summaryprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
118crypto_reportprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
127md5procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
131md5_hexprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
136sha1procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
140sha1_hexprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
145sha256procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
149sha256_hexprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
154sha512procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
158sha512_hexprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
163sha3_256procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
167sha3_256_hexprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
172sha3_512procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
176sha3_512_hexprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
181blake2bprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
185blake2b_hexprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
190hash_newprocImplements a security-sensitive transformation in the crypto boundary.
199hash_updateprocImplements a security-sensitive transformation in the crypto boundary.
203hash_finalprocImplements a security-sensitive transformation in the crypto boundary.
207hash_final_hexprocImplements a security-sensitive transformation in the crypto boundary.
212hmac_newprocImplements a security-sensitive transformation in the crypto boundary.
221hmac_updateprocImplements a security-sensitive transformation in the crypto boundary.
225hmac_finalprocImplements a security-sensitive transformation in the crypto boundary.
229hmac_final_hexprocImplements a security-sensitive transformation in the crypto boundary.
234hash_compareprocImplements a security-sensitive transformation in the crypto boundary.
238hash_fileprocImplements a security-sensitive transformation in the crypto boundary.
242hash_file_hexprocImplements a security-sensitive transformation in the crypto boundary.
247random_bytesprocImplements a security-sensitive transformation in the crypto boundary.
251random_bytes_hexprocImplements a security-sensitive transformation in the crypto boundary.
256pbkdf2procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
260bcrypt_hashprocImplements a security-sensitive transformation in the crypto boundary.
264bcrypt_verifyprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
269crypt_encode_base64procTurns internal values into a transport or textual representation.
273crypt_decode_base64procTransforms an input representation into a structured internal value.
277crypt_encode_hexprocTurns internal values into a transport or textual representation.
281crypt_decode_hexprocTransforms an input representation into a structured internal value.
285crypto_selftestprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.

The table is exhaustive for top-level declarations of the selected kinds. This file declares 61 matching surfaces.

Representative signatures

These signatures are shown in source order so the page keeps the feel of a reference manual, not just a keyword cloud.

  • form CryptoLibraryManifest { (line 9)
  • form CryptoLibraryHealth { (line 15)
  • form CryptoLibrarySummary { (line 25)
  • form CryptoLibraryReport { (line 30)
  • const SHA1_DIGEST_SIZE: i32 = 20 (line 36)
  • const SHA256_DIGEST_SIZE: i32 = 32 (line 37)
  • const SHA512_DIGEST_SIZE: i32 = 64 (line 38)
  • const AES_ECB: i32 = 1 (line 41)
  • const AES_CBC: i32 = 2 (line 42)
  • const AES_CTR: i32 = 3 (line 43)
  • const AES_GCM: i32 = 4 (line 44)
  • const AES_128: i32 = 16 (line 47)
  • const AES_192: i32 = 24 (line 48)
  • const AES_256: i32 = 32 (line 49)
  • form Hash { (line 51)
  • form HMAC { (line 58)
  • proc crypto_version() -> string { (line 65)
  • proc crypto_name() -> string { (line 69)

The list is intentionally capped here; the source file declares 60 matching signatures in total.

How to use this module

Start by reading the file as an ownership boundary. Ask three questions: what enters this module, what stable types or procedures it exports, and what adjacent module should stay outside of it.

  1. Read space and top-level imports first so the ownership boundary of crypto.vitl is explicit.
  2. Scan constants before procedures; they often encode precision, limits, or policy assumptions that explain later behavior.
  3. Read declared forms and picks before algorithms so the data vocabulary is stable in your head.
  4. Traverse procedures in source order; the early helpers usually explain the naming and numeric conventions used later.
  5. Use the source landmarks section below as a table of contents when the file is large.

User example

This example is generated from the actual stdlib module surface. Its job is not to be the smallest snippet possible; its job is to show a realistic consumer-shaped file that exercises the module and mirrors the language keywords the module itself relies on.

space demo/crypto
const SAMPLE_LABEL: string = "demo"
form UserReport {
  label: string,
  ready: bool
}
proc run_example() -> UserReport {
  let entries = crypto_modules()
  let ready: bool = crypto_ready()
  let stable: bool = ready and true
  for sample in [1] {
    let seen: int = sample
  }
    give UserReport { label: "ok", ready: true }
}
export run_example

Keyword coverage

This table makes the “all keywords of the module” requirement auditable. It compares the detected Vitte keywords in the source file with the generated consumer example above.

KeywordPresent in module sourceUsed in generated user example
spaceyesyes
constyesyes
formyesyes
procyesyes
letyesyes
foryesyes
giveyesyes
exportyesyes
trueyesyes
andyesyes

The generated snippet exercises every detected Vitte keyword used by this module.

Source shape

space vitte/crypto
form CryptoLibraryManifest {
    name: string,
    version: string,
    modules: [string]
}
form CryptoLibraryHealth {
    ready: bool,
    module_count: i32,
    hash_ready: bool,

The excerpt is not meant to replace the file. It exists to make the module recognizable at first glance, the same way a Wikipedia infobox helps the reader orient before reading the whole article.

Source landmarks

Large files are easier to retain when they have visible landmarks. When the source contains explicit section banners, they are surfaced here; otherwise the first major declarations are used as anchors.

  • Cryptography and Hashing Library / MD5, SHA variants, encryption basics

Source organization

When a file carries its own internal chaptering, those chapters usually reveal the intended reading order better than a flat symbol list. This section reconstructs that organization from the source itself.

Opening declarations

Top-level items: 1. Procedures: 0. Data surfaces: 0. Constants: 0.

First visible names: vitte/crypto

Cryptography and Hashing Library / MD5, SHA variants, encryption basics

Top-level items: 61. Procedures: 44. Data surfaces: 6. Constants: 10.

First visible names: CryptoLibraryManifest, CryptoLibraryHealth, CryptoLibrarySummary, CryptoLibraryReport, SHA1_DIGEST_SIZE, SHA256_DIGEST_SIZE, SHA512_DIGEST_SIZE, AES_ECB, AES_CBC, AES_CTR

Complete API catalog

This catalog is the exhaustive file-level index for the module. It is intentionally closer to a generated encyclopedia appendix than to a tutorial summary.

Constants

LineNameSignatureRole
36SHA1_DIGEST_SIZEconst SHA1_DIGEST_SIZE: i32 = 20Defines a named constant reused across the module.
37SHA256_DIGEST_SIZEconst SHA256_DIGEST_SIZE: i32 = 32Defines a named constant reused across the module.
38SHA512_DIGEST_SIZEconst SHA512_DIGEST_SIZE: i32 = 64Defines a named constant reused across the module.
41AES_ECBconst AES_ECB: i32 = 1Defines a named constant reused across the module.
42AES_CBCconst AES_CBC: i32 = 2Defines a named constant reused across the module.
43AES_CTRconst AES_CTR: i32 = 3Defines a named constant reused across the module.
44AES_GCMconst AES_GCM: i32 = 4Defines a named constant reused across the module.
47AES_128const AES_128: i32 = 16Defines a named constant reused across the module.
48AES_192const AES_192: i32 = 24Defines a named constant reused across the module.
49AES_256const AES_256: i32 = 32Defines a named constant reused across the module.

Data surfaces

LineNameSignatureRole
9CryptoLibraryManifestform CryptoLibraryManifest {Introduces a structured data shape that other procedures can exchange.
15CryptoLibraryHealthform CryptoLibraryHealth {Introduces a structured data shape that other procedures can exchange.
25CryptoLibrarySummaryform CryptoLibrarySummary {Introduces a structured data shape that other procedures can exchange.
30CryptoLibraryReportform CryptoLibraryReport {Introduces a structured data shape that other procedures can exchange.
51Hashform Hash {Introduces a structured data shape that other procedures can exchange.
58HMACform HMAC {Introduces a structured data shape that other procedures can exchange.

Procedures

LineNameSignatureRole
65crypto_versionproc crypto_version() -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
69crypto_nameproc crypto_name() -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
73crypto_modulesproc crypto_modules() -> [string] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
83crypto_module_countproc crypto_module_count() -> i32 {Represents one top-level surface in the file contract and should be read as part of the module boundary.
87crypto_manifestproc crypto_manifest() -> CryptoLibraryManifest {Represents one top-level surface in the file contract and should be read as part of the module boundary.
95crypto_readyproc crypto_ready() -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
99crypto_healthproc crypto_health() -> CryptoLibraryHealth {Represents one top-level surface in the file contract and should be read as part of the module boundary.
111crypto_summaryproc crypto_summary() -> CryptoLibrarySummary {Represents one top-level surface in the file contract and should be read as part of the module boundary.
118crypto_reportproc crypto_report() -> CryptoLibraryReport {Represents one top-level surface in the file contract and should be read as part of the module boundary.
127md5proc md5(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
131md5_hexproc md5_hex(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
136sha1proc sha1(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
140sha1_hexproc sha1_hex(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
145sha256proc sha256(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
149sha256_hexproc sha256_hex(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
154sha512proc sha512(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
158sha512_hexproc sha512_hex(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
163sha3_256proc sha3_256(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
167sha3_256_hexproc sha3_256_hex(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
172sha3_512proc sha3_512(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
176sha3_512_hexproc sha3_512_hex(data: string) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
181blake2bproc blake2b(data: string, size: i32) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
185blake2b_hexproc blake2b_hex(data: string, size: i32) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
190hash_newproc hash_new(algorithm: i32) -> Hash {Implements a security-sensitive transformation in the crypto boundary.
199hash_updateproc hash_update(h: Hash, data: string) -> int {Implements a security-sensitive transformation in the crypto boundary.
203hash_finalproc hash_final(h: Hash) -> string {Implements a security-sensitive transformation in the crypto boundary.
207hash_final_hexproc hash_final_hex(h: Hash) -> string {Implements a security-sensitive transformation in the crypto boundary.
212hmac_newproc hmac_new(algorithm: i32, key: string) -> HMAC {Implements a security-sensitive transformation in the crypto boundary.
221hmac_updateproc hmac_update(h: HMAC, data: string) -> int {Implements a security-sensitive transformation in the crypto boundary.
225hmac_finalproc hmac_final(h: HMAC) -> string {Implements a security-sensitive transformation in the crypto boundary.
229hmac_final_hexproc hmac_final_hex(h: HMAC) -> string {Implements a security-sensitive transformation in the crypto boundary.
234hash_compareproc hash_compare(hash1: string, hash2: string) -> int {Implements a security-sensitive transformation in the crypto boundary.
238hash_fileproc hash_file(filepath: string, algorithm: i32) -> string {Implements a security-sensitive transformation in the crypto boundary.
242hash_file_hexproc hash_file_hex(filepath: string, algorithm: i32) -> string {Implements a security-sensitive transformation in the crypto boundary.
247random_bytesproc random_bytes(size: i32) -> string {Implements a security-sensitive transformation in the crypto boundary.
251random_bytes_hexproc random_bytes_hex(size: i32) -> string {Implements a security-sensitive transformation in the crypto boundary.
256pbkdf2proc pbkdf2(password: string, salt: string, iterations: i32, length: i32) -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
260bcrypt_hashproc bcrypt_hash(password: string, rounds: i32) -> string {Implements a security-sensitive transformation in the crypto boundary.
264bcrypt_verifyproc bcrypt_verify(password: string, hash: string) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
269crypt_encode_base64proc crypt_encode_base64(data: string) -> string {Turns internal values into a transport or textual representation.
273crypt_decode_base64proc crypt_decode_base64(data: string) -> string {Transforms an input representation into a structured internal value.
277crypt_encode_hexproc crypt_encode_hex(data: string) -> string {Turns internal values into a transport or textual representation.
281crypt_decode_hexproc crypt_decode_hex(data: string) -> string {Transforms an input representation into a structured internal value.
285crypto_selftestproc crypto_selftest() -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.

Exports

LineNameSignatureRole
293*export *Re-exports surfaces that the module wants to expose as part of its public boundary.

Integration boundaries

Within crypto, this file should remain focused. If a future helper changes the host boundary, scheduling boundary, or data-shape boundary, it probably belongs in a neighbor module instead of being added here by convenience.

  • Family responsibility: Hashing, HMAC, randomness, key derivation, symmetric primitives, and asymmetric primitives.
  • Family architecture role: Use `crypto` when integrity, secrecy, or key management is the feature. This family should never be presented as generic formatting or utility code.

Composition guidance

Choose this module when

  • Choose crypto.vitl when the main question is owned by this module rather than by transport, storage, orchestration, or user-interface code.
  • A package manifest can be serialized first, then hashed, then optionally signed.
  • A token flow can derive a key in one boundary and use it in another without mixing concerns.

Pause before extending it when

  • Avoid extending this file when the new helper mostly changes the boundary to host I/O, runtime coordination, or foreign integration instead of staying inside crypto.
  • Check nearby modules such as crypto/asymmetric.vitl, crypto/hash.vitl, crypto/hashing.vitl before adding convenience wrappers here.

Relationship table

This table keeps the page closer to a real encyclopedia entry: a module is easier to understand when compared with its nearest alternatives in the same family.

NeighborProceduresData surfacesWhy compare it
crypto/asymmetric.vitl100Shares the same family boundary but carries a distinct slice of responsibility.
crypto/hash.vitl222Shares the same family boundary but carries a distinct slice of responsibility.
crypto/hashing.vitl100Shares the same family boundary but carries a distinct slice of responsibility.
crypto/hmac.vitl82Shares the same family boundary but carries a distinct slice of responsibility.
crypto/keyderivation.vitl71Shares the same family boundary but carries a distinct slice of responsibility.
crypto/random.vitl131Shares the same family boundary but carries a distinct slice of responsibility.
crypto/symmetric.vitl100Shares the same family boundary but carries a distinct slice of responsibility.
crypto/utils.vitl111Shares the same family boundary but carries a distinct slice of responsibility.

Neighbor modules