Skip to content

Commit 5b16c5b

Browse files
Merge pull request #557 from ProvableHQ/alex/minor-cryptography-fix
Fixing minor issues
2 parents 2ac0939 + 6fc133d commit 5b16c5b

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

documentation/language/04_operators.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,3 @@ let result = (a + 1u8) * 2u8;
5757

5858
`(a + 1u8)` will be evaluated before multiplying by two `* 2u8`.
5959

60-
## Hashing vs. Committing
61-
62-
Many of the cryptographic operators have both `hash` and `commit` variants.
63-
64-
The `hash` variant is a one-way function that takes an input produces a fixed-size output called a "hash" or "digest." It has a unique property that if even one bit of the input changes, the output hash will change completely, making it easy to see if data has been tampered with.
65-
66-
The `commit` variant is a wrapper around the `hash` variant that takes an additional parameter called a blinding factor, otherwise known as a **salt**. The **salt** is appended to the input value before hashing it, ensuring the output will be unique from just the simple hash of the raw input. So long as a different salt is used each time, this allows a user to commit to the same value multiple times without revealing that they've done so.

documentation/language/08_cheatsheet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,11 @@ var = none;
382382
```
383383
### Storage Vectors
384384
```leo
385-
storage vec: [u8]
385+
storage vec: [u8];
386386
387387
// Querying
388388
let len_vec: u32 = vec.len();
389-
let val: u8 = vec.get(idx)
389+
let val: u8 = vec.get(idx);
390390
391391
// Modifying
392392
vec.set(idx, value);

documentation/language/operators/cryptographic_operators.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ toc_max_heading_level: 3
77
---
88
[general tags]: # (operators, cryptographic_operators, assert, hash, commit, random, address, block)
99

10+
## Hashing vs. Committing
11+
12+
Many of the cryptographic operators have both `hash` and `commit` variants.
13+
14+
The `hash` variant is a one-way function that takes an input and produces a fixed-size output called a "hash" or "digest." It has a unique property that if even one bit of the input changes, the output hash will change completely, making it easy to see if data has been tampered with.
15+
16+
The `commit` variant is a wrapper around the `hash` variant that takes an additional parameter called a blinding factor, otherwise known as a **salt**. The **salt** is appended to the input value before hashing it, ensuring the output will be unique from just the simple hash of the raw input. So long as a different salt is used each time, this allows a user to commit to the same value multiple times without revealing that they've done so.
17+
18+
1019
## Table of Contents
1120

1221
| Name | Description |

0 commit comments

Comments
 (0)