From ed89aca3431d382c07e41076a1cd44744d320c8d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 28 Feb 2017 15:33:10 -0800 Subject: [PATCH] descriptor: Define the 'sha256' algo identifier Before this commit, there wasn't something obvious to point to if you wanted to explain the sha256 identifier. The "SHOULD be submitted" wording follows runtime-spec's example [1]. [1]: https://github.com/opencontainers/runtime-spec/blob/v1.0.0-rc4/config.md#platform Signed-off-by: W. Trevor King --- descriptor.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/descriptor.md b/descriptor.md index 4bc5e0414..b40bcefad 100644 --- a/descriptor.md +++ b/descriptor.md @@ -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. @@ -109,6 +109,16 @@ D == ID(C) == ':' + 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.