modus
Menu
On this page

The entry cryptography_vectors

The source src/modules/demonstrations/cryptography_vectors built with the setting DRAWING_THROUGH_MODULE=true. The text after this paragraph is the comment of that source.

The module cryptography as it ships, at work on known vectors. The design: Cryptography.

This process imports the module through its import slots, as agenda imports calendar: each call is a direct call of an export. It runs the published vectors of each primitive through the exports, checks that a changed byte, or a point of small order, gives its error record and no byte of output, measures the speed of each primitive and the cost of one call of an export, and shows the hash of the module in the boot image: the hash names the code that ran.

What it is for. A reader trusts a primitive of cryptography only when it gives the published answers. This process checks the cryptography module that the system ships, through the same exports that the QUIC of the remote service calls, and names it by its hash, so the check is of that exact code.

What a reader sees. Start it from the start menu, or with start("cryptography_vectors") in the console. The window has one row for each primitive and its standard, passed or failed, then the speeds. The log gets one line for each primitive (cryptography_vectors: <name> (<standard>): passed; a bad input is refused), one line for each speed, the cost of one call of an export, and the summary with the BLAKE3 hash of the module.

Its grant: Image: it reads the hash of the module cryptography in the boot image. The module itself comes through its imports, as for any process.

What it does not prove. Vectors show that the code gives the right answers on those inputs. They do not show that it runs in constant time, or that it has no fault on other inputs. The speeds are measures of the host of the run.

cryptography_vectors module with an entry

Hash
a7b381b666573680fd4d824408c87a298ef7a6e9e040c7a1cd8e5e85edb05666
Size
178787 bytes
Exports
0
Imports
2
Imported by
0
License
MIT

The module cryptography as it ships, at work on known vectors

FactValue
KindModules with an entry
Sourcesrc/modules/demonstrations/cryptography_vectors
Boot imageyes: in the boot image, 178787 bytes in this build
Build settings
  • DRAWING_THROUGH_MODULE=true
Imports
Imported bynone

Neighbours

What it imports, at its left, and what imports it, at its right: the part of the module graph that touches it.

cryptography_vectors cryptography drawing

Exports

ExportWhat it does
entry()runs the vectors of each primitive, the refused inputs, the measures of speed and of one call, reads the hash of the module, writes the lines on the log, then keeps the window open until the process is stopped

entry

entry()

entry runs the vectors of each primitive, the refused inputs, the measures of speed and of one call, reads the hash of the module, writes the lines on the log, then keeps the window open until the process is stopped. With no window, it stops with Failed.

Form
The entry of the module: one parameter, an address, fixed by the contract.
Source
src/modules/demonstrations/cryptography_vectors/main.odin:395

Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).

What the root service gives it

WhatValueAs the root service says
GrantsIt reads the hash of the module cryptography in the boot image.
Other terms of its start grant setnone
Budget that it asks for
  • working memory pages 848
  • pages of its threads 72
  • pages of the pictures of its window 4800
  • pages of the module and its imports from the files of the build
  • processes the least
  • threads the least
The least budget of 2048 pages, in which it ran before it stated its window, less that window at the scale 1 (1200 pages): its module, its stack, its tables and its glyph memory. The tool counts the window at the largest scale. See: Module contract: The budget that a module asks for

The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module (its line); the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).