diff --git a/object/types.proto b/object/types.proto index 9121d6d..5741dec 100644 --- a/object/types.proto +++ b/object/types.proto @@ -67,13 +67,13 @@ message Header { uint64 payload_length = 5; // Hash of payload bytes - Checksum payload_hash = 6; + neo.fs.v2.refs.Checksum payload_hash = 6; // Special object type ObjectType object_type = 7; // Homomorphic hash of the object payload. - Checksum homomorphic_hash = 8; + neo.fs.v2.refs.Checksum homomorphic_hash = 8; // Session token, if it was used during Object creation. // Need it to verify integrity and authenticity out of Request scope. diff --git a/proto-docs/object.md b/proto-docs/object.md index 2ec1b6c..729b3ea 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -219,6 +219,7 @@ Request body | address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Carries address of the object that contains the requested payload range. | | ranges | [Range](#neo.fs.v2.object.Range) | repeated | Carries the list of object payload range to calculate homomorphic hash. | | salt | [bytes](#bytes) | | Carries binary salt to XOR object payload ranges before hash calculation. | +| type | [neo.fs.v2.refs.ChecksumType](#neo.fs.v2.refs.ChecksumType) | | Checksum algorithm type | @@ -242,7 +243,8 @@ Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| hash_list | [bytes](#bytes) | repeated | Carries list of homomorphic hashes in a binary format. | +| type | [neo.fs.v2.refs.ChecksumType](#neo.fs.v2.refs.ChecksumType) | | Checksum algorithm type | +| hash_list | [bytes](#bytes) | repeated | List of range hashes in a binary format. | @@ -573,9 +575,9 @@ Object Headers | 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 | [bytes](#bytes) | | Hash of payload bytes | +| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Hash of payload bytes | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Special object type | -| homomorphic_hash | [bytes](#bytes) | | Homomorphic hash of the object payload. | +| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload. | | 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 | | split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy. | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index c892388..57d5157 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -7,6 +7,7 @@ - Messages - [Address](#neo.fs.v2.refs.Address) + - [Checksum](#neo.fs.v2.refs.Checksum) - [ContainerID](#neo.fs.v2.refs.ContainerID) - [ObjectID](#neo.fs.v2.refs.ObjectID) - [OwnerID](#neo.fs.v2.refs.OwnerID) @@ -39,6 +40,18 @@ Address of object (container id + object id) | object_id | [ObjectID](#neo.fs.v2.refs.ObjectID) | | object_id carries object identifier. | + + +### Message Checksum +Checksum message + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [ChecksumType](#neo.fs.v2.refs.ChecksumType) | | Checksum algorithm type | +| sum | [bytes](#bytes) | | Checksum itself | + + ### Message ContainerID @@ -97,6 +110,19 @@ Represents API version used by node. + + + +### ChecksumType +Checksum algorithm type + +| Name | Number | Description | +| ---- | ------ | ----------- | +| CHECKSUM_TYPE_UNSPECIFIED | 0 | Unknown. Not used | +| TZ | 1 | Tillich-Zemor homomorphic hash funciton | +| SHA256 | 2 | SHA-256 | + + diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index b15925a..46dafdc 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -32,7 +32,7 @@ The storage group consists of objects from single container. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | validation_data_size | [uint64](#uint64) | | validation_data_size carries the total size of the payloads of the storage group members. | -| validation_hash | [bytes](#bytes) | | validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members The order of concatenation is the same as the order of the members in the Members field. | +| validation_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members The order of concatenation is the same as the order of the members in the Members field. | | expiration_epoch | [uint64](#uint64) | | expiration_epoch carries last NeoFS epoch number of the storage group lifetime. | | members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | diff --git a/refs/types.proto b/refs/types.proto index 29ddd2a..8debfae 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -62,6 +62,9 @@ enum ChecksumType { // Checksum message message Checksum { + // Checksum algorithm type ChecksumType type = 1; + + // Checksum itself bytes sum = 2; } diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 305f2dd..5f17662 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -18,7 +18,7 @@ message StorageGroup { // payloads of the storage group members // The order of concatenation is the same as the order of the members in the // Members field. - Checksum validation_hash = 2; + neo.fs.v2.refs.Checksum validation_hash = 2; // expiration_epoch carries last NeoFS epoch number of the storage group // lifetime.