From 3302a530f215646f03a1a7b11ff39502bff254d7 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 7 Feb 2022 15:46:39 +0300 Subject: [PATCH] [#55] refs: add signature scheme description Signed-off-by: Evgenii Stratonikov --- proto-docs/refs.md | 14 ++++++++++++++ refs/types.proto | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/proto-docs/refs.md b/proto-docs/refs.md index e9e46d9..3ce5f0e 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -148,6 +148,7 @@ Signature of something in NeoFS. | ----- | ---- | ----- | ----------- | | key | [bytes](#bytes) | | Public key used for signing | | sign | [bytes](#bytes) | | Signature | +| scheme | [SignatureScheme](#neo.fs.v2.refs.SignatureScheme) | | Scheme contains digital signature scheme identifier. | @@ -194,6 +195,19 @@ Checksum algorithm type. | SHA256 | 2 | SHA-256 | + + + +### SignatureScheme +Signature scheme describes digital signing scheme used for (key, signature) pair. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| UNSPECIFIED | 0 | Unknown. The default interpretation depends on a particular structure type. | +| ECDSA_SHA512 | 1 | ECDSA with SHA-512 hashing (FIPS 186-3). | +| ECDSA_RFC6979_SHA256 | 2 | Deterministic ECDSA with SHA-256 hashing (RFC 6979) | + + diff --git a/refs/types.proto b/refs/types.proto index 9675026..908a76c 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -105,6 +105,18 @@ message Signature { bytes key = 1 [json_name = "key"]; // Signature bytes sign = 2 [json_name = "signature"]; + // Scheme contains digital signature scheme identifier. + SignatureScheme scheme = 3 [json_name = "scheme"]; +} + +// Signature scheme describes digital signing scheme used for (key, signature) pair. +enum SignatureScheme { + // Unknown. The default interpretation depends on a particular structure type. + UNSPECIFIED = 0; + // ECDSA with SHA-512 hashing (FIPS 186-3). + ECDSA_SHA512 = 1; + // Deterministic ECDSA with SHA-256 hashing (RFC 6979) + ECDSA_RFC6979_SHA256 = 2; } // Checksum algorithm type.