Skip to content

Commit

Permalink
Merge pull request #587 from wking/sha256-algo
Browse files Browse the repository at this point in the history
descriptor: Define the 'sha256' algo identifier
  • Loading branch information
stevvooe authored Mar 1, 2017
2 parents 9819eae + ed89aca commit 53831a6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions descriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ hex := /[a-f0-9]+/

Some example digest strings include the following:

digest | description |
----------------------------------------------------------------------------------|------------------------------------------------
sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b | Common sha256 based digest |
digest | algorithm |
------------------------------------------------------------------------|---------------------|
sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b | [SHA-256](#sha-256) |

Before consuming content targeted by a descriptor from untrusted sources, the byte content SHOULD be verified against the digest.
Before calculating the digest, the size of the content SHOULD be verified to reduce hash collision space.
Expand Down Expand Up @@ -109,6 +109,16 @@ D == ID(C) == '<alg>:' + EncodeHex(H(C))

The _digest_ is confirmed as the content identifier by independently calculating the _digest_.

#### Registered identifiers

The following algorithm identifiers are defined by this specification:

| identifier | algorithm |
|------------|---------------------|
| `sha256` | [SHA-256](#sha-256) |

If a useful algorithm is not included in the above table, it SHOULD be submitted to this specification for standardization.

#### SHA-256

[SHA-256](https://tools.ietf.org/html/rfc4634#page-7) is a collision-resistant hash function, chosen for ubiquity, reasonable size and secure characteristics.
Expand Down

0 comments on commit 53831a6

Please sign in to comment.