From a55e10e2abdc2c37fbbe43276d8af8027adc785d Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 26 Dec 2024 23:25:36 +0300 Subject: [PATCH] object: specify hash types, fix #276 While technically we could use Streebog or something here, practically it'd be incompatible with current networks, so specific hash types are important. Signed-off-by: Roman Khimov --- object/types.proto | 8 ++++---- proto-docs/object.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/object/types.proto b/object/types.proto index 98d3eba..bfb0353 100644 --- a/object/types.proto +++ b/object/types.proto @@ -154,10 +154,10 @@ message ShortHeader { // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown uint64 payload_length = 5 [json_name = "payloadLength"]; - // Hash of payload bytes + // SHA256 hash of payload bytes. neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; - // Homomorphic hash of the object payload + // Homomorphic hash of the object payload (Tillich-Zemor). neo.fs.v2.refs.Checksum homomorphic_hash = 7 [json_name = "homomorphicHash"]; } @@ -180,13 +180,13 @@ message Header { // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. uint64 payload_length = 5 [json_name = "payloadLength"]; - // Hash of payload bytes + // SHA256 hash of payload bytes neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; // Type of the object payload content ObjectType object_type = 7 [json_name = "objectType"]; - // Homomorphic hash of the object payload + // Homomorphic hash of the object payload (Tillich-Zemor). neo.fs.v2.refs.Checksum homomorphic_hash = 8 [json_name = "homomorphicHash"]; // Session token, if it was used during Object creation. Need it to verify diff --git a/proto-docs/object.md b/proto-docs/object.md index 15480ce..2398571 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -904,9 +904,9 @@ Object Header | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | creation_epoch | [uint64](#uint64) | | Object creation Epoch | | payload_length | [uint64](#uint64) | | Size of payload in bytes. `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. | -| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Hash of payload bytes | +| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | SHA256 hash of payload bytes | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | -| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload | +| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload (Tillich-Zemor). | | session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. | | attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | User-defined object attributes. Attributes vary in length from object to object, so keep an eye on the entire Header limit depending on the context. | | split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy | @@ -1088,8 +1088,8 @@ Short header fields | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | | payload_length | [uint64](#uint64) | | Size of payload in bytes. `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown | -| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Hash of payload bytes | -| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload | +| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | SHA256 hash of payload bytes. | +| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload (Tillich-Zemor). |