diff --git a/client-vms/proto/nillion/compute/v1/invoke.proto b/client-vms/proto/nillion/compute/v1/invoke.proto index 1000f74e..8897c595 100644 --- a/client-vms/proto/nillion/compute/v1/invoke.proto +++ b/client-vms/proto/nillion/compute/v1/invoke.proto @@ -4,6 +4,7 @@ package nillion.compute.v1.invoke; import "nillion/payments/v1/receipt.proto"; import "nillion/auth/v1/user.proto"; +import "nillion/values/v1/value.proto"; // A request to invoke a computation. message InvokeComputeRequest { @@ -16,6 +17,8 @@ message InvokeComputeRequest { repeated bytes value_ids = 2; // The values being used as compute-time parameters, encoded in bincode format. + // + // Only one of `bincode_values` and `values` can be set. bytes bincode_values = 3; // The bindings that define which input party in the program is which user in the network. @@ -23,6 +26,11 @@ message InvokeComputeRequest { // The bindings that define which output party in the program is which users in the network. repeated OutputPartyBinding output_bindings = 5; + + // The values being used as compute-time parameters + // + // Only one of `bincode_values` and `values` can be set. + repeated nillion.values.v1.value.NamedValue values = 6; } // A response to a request to invoke a computation. diff --git a/client-vms/proto/nillion/compute/v1/retrieve.proto b/client-vms/proto/nillion/compute/v1/retrieve.proto index 9e35d2ce..68a2d5f2 100644 --- a/client-vms/proto/nillion/compute/v1/retrieve.proto +++ b/client-vms/proto/nillion/compute/v1/retrieve.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package nillion.compute.v1.retrieve; import "google/protobuf/empty.proto"; +import "nillion/values/v1/value.proto"; // A request to retrieve the results of a computation. message RetrieveResultsRequest { @@ -28,6 +29,9 @@ message RetrieveResultsResponse { // The result of a computation. message ComputationResult { - // The computation results, encoded in bincode. - bytes bincode_values = 1; + // The computation results, encoded in bincode. + bytes bincode_values = 1; + + // The computation results. + repeated nillion.values.v1.value.NamedValue values = 2; } diff --git a/client-vms/proto/nillion/leader_queries/v1/pool_status.proto b/client-vms/proto/nillion/leader_queries/v1/pool_status.proto index c298b67d..d062098e 100644 --- a/client-vms/proto/nillion/leader_queries/v1/pool_status.proto +++ b/client-vms/proto/nillion/leader_queries/v1/pool_status.proto @@ -20,6 +20,9 @@ message PoolStatusResponse { // Whether preprocessing is active (at least one element type is being generated). bool preprocessing_active = 2; + + // Whether auxiliary material has been generated. + bool auxiliary_material_available = 3; } // The offsets for a preprocessing element. diff --git a/client-vms/proto/nillion/payments/v1/balance.proto b/client-vms/proto/nillion/payments/v1/balance.proto index 6ba9d8e7..7ae2dc42 100644 --- a/client-vms/proto/nillion/payments/v1/balance.proto +++ b/client-vms/proto/nillion/payments/v1/balance.proto @@ -12,6 +12,9 @@ message AccountBalanceResponse { // The timestamp at which this balance was last updated. google.protobuf.Timestamp last_updated = 2; + + // The timestamp at which this balance will expire. + google.protobuf.Timestamp expires_at = 3; } // A request to add funds to a user's account. diff --git a/client-vms/proto/nillion/payments/v1/quote.proto b/client-vms/proto/nillion/payments/v1/quote.proto index c3593f6d..887b0ad4 100644 --- a/client-vms/proto/nillion/payments/v1/quote.proto +++ b/client-vms/proto/nillion/payments/v1/quote.proto @@ -57,7 +57,7 @@ message PriceQuote { PriceQuoteRequest request = 3; // The point in time at which this quote is no longer valid. - google.protobuf.Timestamp expires_at = 4; + google.protobuf.Timestamp expires_at = 4; // The preprocessing requirements for this operation. repeated PreprocessingRequirement preprocessing_requirements = 5; @@ -79,7 +79,7 @@ message QuoteFees { message StoreProgram { // The program's metadata. ProgramMetadata metadata = 1; - + // A sha256 hash of the compiled program. bytes contents_sha256 = 2; @@ -100,7 +100,7 @@ message ProgramMetadata { // The number of instructions per type. map instructions = 4; - + // The preprocessing requirements. repeated PreprocessingRequirement preprocessing_requirements = 5; @@ -131,13 +131,13 @@ message AuxiliaryMaterialRequirement { // A retrieve values operation. message RetrieveValues { // The identifier to be retrieved. - bytes values_id = 1; + bytes values_id = 1; } // A retrieve permissions operation. message RetrievePermissions { // The identifier of the values entity to be retrieved. - bytes values_id = 1; + bytes values_id = 1; } // An overwrite permissions operation. @@ -166,7 +166,7 @@ message StoreValues { uint64 public_values_count = 3; // The number of days to persist these secrets for. - uint32 ttl_days = 4; + optional uint32 ttl_days = 4; // The size of the payload to be stored. uint64 payload_size = 5; @@ -184,5 +184,5 @@ message InvokeCompute { string program_id = 1; // The size of the compute time values being sent as part of this operation. - uint64 values_payload_size = 2; + uint64 values_payload_size = 2; } diff --git a/client-vms/proto/nillion/values/v1/retrieve.proto b/client-vms/proto/nillion/values/v1/retrieve.proto index dafee1e9..607c6921 100644 --- a/client-vms/proto/nillion/values/v1/retrieve.proto +++ b/client-vms/proto/nillion/values/v1/retrieve.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package nillion.values.v1.retrieve; import "nillion/payments/v1/receipt.proto"; +import "nillion/values/v1/value.proto"; // A request to retrieve a set of stored values. message RetrieveValuesRequest { @@ -16,4 +17,7 @@ message RetrieveValuesRequest { message RetrieveValuesResponse { // The values encoded in bincode format. bytes bincode_values = 1; + + // The values. + repeated value.NamedValue values = 2; } diff --git a/client-vms/proto/nillion/values/v1/store.proto b/client-vms/proto/nillion/values/v1/store.proto index ea678a95..a2892f05 100644 --- a/client-vms/proto/nillion/values/v1/store.proto +++ b/client-vms/proto/nillion/values/v1/store.proto @@ -4,6 +4,7 @@ package nillion.values.v1.store; import "nillion/payments/v1/receipt.proto"; import "nillion/permissions/v1/permissions.proto"; +import "nillion/values/v1/value.proto"; // A request to store a set of values. message StoreValuesRequest { @@ -13,6 +14,8 @@ message StoreValuesRequest { nillion.payments.v1.receipt.SignedReceipt signed_receipt = 1; // The values encoded in bincode format. + // + // Only one of `bincode_values` and `values` can be set. bytes bincode_values = 2; // The permissions to set for these values. @@ -29,6 +32,11 @@ message StoreValuesRequest { // Setting this identifier will effectively turn this operation into an update for an existing set of // values. bytes update_identifier = 4; + + // The values to be stored. + // + // Only one of `bincode_values` and `values` can be set. + repeated value.NamedValue values = 5; } // A response to a request to store values the network. diff --git a/client-vms/proto/nillion/values/v1/value.proto b/client-vms/proto/nillion/values/v1/value.proto new file mode 100644 index 00000000..e44fb137 --- /dev/null +++ b/client-vms/proto/nillion/values/v1/value.proto @@ -0,0 +1,183 @@ +syntax = "proto3"; + +package nillion.values.v1.value; + +import "google/protobuf/empty.proto"; + +// A named value. +message NamedValue { + // The name of this value. + string name = 1; + + // The value itself. + Value value = 2; +} + +// A value. +message Value { + oneof value { + // A public boolean. + PublicInteger public_boolean = 1; + + // A public integer. + PublicInteger public_integer = 2; + + // A public unsigned integer. + PublicInteger public_unsigned_integer = 3; + + // A shamir share of a secret boolean value. + ShamirShare shamir_share_boolean = 4; + + // A shamir share of a secret integer value. + ShamirShare shamir_share_integer = 5; + + // A shamir share of a secret unsigned integer value. + ShamirShare shamir_share_unsigned_integer = 6; + + // An array. + Array array = 7; + + // A tuple. + Tuple tuple = 8; + + // A secret shared blob. + ShamirSharesBlob shamir_shares_blob = 9; + + // An ECDSA private key share. + EcdsaPrivateKeyShare ecdsa_private_key_share = 10; + + // An ECDSA signature share. + EcdsaSignatureShare ecdsa_signature_share = 11; + + // The digest of a message. + EcdsaMessageDigest ecdsa_message_digest = 12; + } +} + +// A public integer. +message PublicInteger { + // The integer value, encoded in little endian. + bytes value = 1; +} + +// A shamir share. +message ShamirShare { + // The value, encoded in little endian. + bytes value = 1; +} + +// An array. +message Array { + // The array values. + // + // All the values must be of the same type. + repeated Value values = 1; + + // The type of all elements in this array. + ValueType inner_type = 2; +} + +// A tuple. +message Tuple { + // The left value. + Value left = 1; + + // The right value. + Value right = 2; +} + +// An ECDSA private key share. +message EcdsaPrivateKeyShare { + // Index of local party in key generation protocol. + uint32 i = 1; + + // The secret share x. + bytes x = 2; + + // Public key corresponding to shared secret key, in compressed form. + bytes shared_public_key = 3; + + // Public shares of all signers sharing the key, in compressed form. + repeated bytes public_shares = 4; +} + +// An ECDSA signature share. +message EcdsaSignatureShare { + // r component of signature share + bytes r = 1; + + // sigma component of partial signature share. + bytes sigma = 2; +} + +// The digest of a message. +message EcdsaMessageDigest { + // The digest. + bytes digest = 1; +} + +// Shamir shares of a blob. +message ShamirSharesBlob { + // The shares. + repeated ShamirShare shares = 1; + + // The original size of the blob before secret sharing. + uint64 original_size = 2; +} + +// A type of a value. +message ValueType { + oneof value_type { + // A public integer. + google.protobuf.Empty public_integer = 1; + + // A public unsigned integer. + google.protobuf.Empty public_unsigned_integer = 2; + + // A public boolean. + google.protobuf.Empty public_boolean = 3; + + // A shamir share of an integer. + google.protobuf.Empty shamir_share_integer = 4; + + // A shamir share of an unsigned integer. + google.protobuf.Empty shamir_share_unsigned_integer = 5; + + // A shamir share of a boolean. + google.protobuf.Empty shamir_share_boolean = 6; + + // An array. + ArrayType array = 7; + + // A tuple. + TupleType tuple = 8; + + // An ECDSA private key share. + google.protobuf.Empty ecdsa_private_key_share = 9; + + // An ECDSA message digest. + google.protobuf.Empty ecdsa_message_digest = 10; + + // An ECDSA signature share. + google.protobuf.Empty ecdsa_signature_share = 11; + } +} + +// An array. +message ArrayType { + // The type of each element in the array. + ValueType inner_type = 1; + + // The array size. + uint64 size = 2; +} + +// A tuple. +message TupleType { + // The type of the left element in the tuple. + ValueType left = 1; + + // The type of the right element in the tuple. + ValueType right = 2; +} + diff --git a/client-vms/src/gen-proto/nillion/compute/v1/invoke_pb.ts b/client-vms/src/gen-proto/nillion/compute/v1/invoke_pb.ts index 32cd8f43..62a2679c 100644 --- a/client-vms/src/gen-proto/nillion/compute/v1/invoke_pb.ts +++ b/client-vms/src/gen-proto/nillion/compute/v1/invoke_pb.ts @@ -8,13 +8,15 @@ import type { SignedReceipt } from "../../payments/v1/receipt_pb"; import { file_nillion_payments_v1_receipt } from "../../payments/v1/receipt_pb"; import type { UserId } from "../../auth/v1/user_pb"; import { file_nillion_auth_v1_user } from "../../auth/v1/user_pb"; +import type { NamedValue } from "../../values/v1/value_pb"; +import { file_nillion_values_v1_value } from "../../values/v1/value_pb"; import type { Message } from "@bufbuild/protobuf"; /** * Describes the file nillion/compute/v1/invoke.proto. */ export const file_nillion_compute_v1_invoke: GenFile = /*@__PURE__*/ - fileDesc("Ch9uaWxsaW9uL2NvbXB1dGUvdjEvaW52b2tlLnByb3R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RJbnZva2VDb21wdXRlUmVxdWVzdBJCCg5zaWduZWRfcmVjZWlwdBgBIAEoCzIqLm5pbGxpb24ucGF5bWVudHMudjEucmVjZWlwdC5TaWduZWRSZWNlaXB0EhEKCXZhbHVlX2lkcxgCIAMoDBIWCg5iaW5jb2RlX3ZhbHVlcxgDIAEoDBJECg5pbnB1dF9iaW5kaW5ncxgEIAMoCzIsLm5pbGxpb24uY29tcHV0ZS52MS5pbnZva2UuSW5wdXRQYXJ0eUJpbmRpbmcSRgoPb3V0cHV0X2JpbmRpbmdzGAUgAygLMi0ubmlsbGlvbi5jb21wdXRlLnYxLmludm9rZS5PdXRwdXRQYXJ0eUJpbmRpbmcSMwoGdmFsdWVzGAYgAygLMiMubmlsbGlvbi52YWx1ZXMudjEudmFsdWUuTmFtZWRWYWx1ZSIrChVJbnZva2VDb21wdXRlUmVzcG9uc2USEgoKY29tcHV0ZV9pZBgBIAEoDCJTChFJbnB1dFBhcnR5QmluZGluZxISCgpwYXJ0eV9uYW1lGAEgASgJEioKBHVzZXIYAiABKAsyHC5uaWxsaW9uLmF1dGgudjEudXNlci5Vc2VySWQiVQoST3V0cHV0UGFydHlCaW5kaW5nEhIKCnBhcnR5X25hbWUYASABKAkSKwoFdXNlcnMYAiADKAsyHC5uaWxsaW9uLmF1dGgudjEudXNlci5Vc2VySWRCtAEKHWNvbS5uaWxsaW9uLmNvbXB1dGUudjEuaW52b2tlQgtJbnZva2VQcm90b1ABogIETkNWSaoCGU5pbGxpb24uQ29tcHV0ZS5WMS5JbnZva2XKAhlOaWxsaW9uXENvbXB1dGVcVjFcSW52b2tl4gIlTmlsbGlvblxDb21wdXRlXFYxXEludm9rZVxHUEJNZXRhZGF0YeoCHE5pbGxpb246OkNvbXB1dGU6OlYxOjpJbnZva2ViBnByb3RvMw", [file_nillion_payments_v1_receipt, file_nillion_auth_v1_user, file_nillion_values_v1_value]); /** * A request to invoke a computation. @@ -41,6 +43,8 @@ export type InvokeComputeRequest = Message<"nillion.compute.v1.invoke.InvokeComp /** * The values being used as compute-time parameters, encoded in bincode format. * + * Only one of `bincode_values` and `values` can be set. + * * @generated from field: bytes bincode_values = 3; */ bincodeValues: Uint8Array; @@ -58,6 +62,15 @@ export type InvokeComputeRequest = Message<"nillion.compute.v1.invoke.InvokeComp * @generated from field: repeated nillion.compute.v1.invoke.OutputPartyBinding output_bindings = 5; */ outputBindings: OutputPartyBinding[]; + + /** + * The values being used as compute-time parameters + * + * Only one of `bincode_values` and `values` can be set. + * + * @generated from field: repeated nillion.values.v1.value.NamedValue values = 6; + */ + values: NamedValue[]; }; /** diff --git a/client-vms/src/gen-proto/nillion/compute/v1/retrieve_pb.ts b/client-vms/src/gen-proto/nillion/compute/v1/retrieve_pb.ts index 752941ea..a6466139 100644 --- a/client-vms/src/gen-proto/nillion/compute/v1/retrieve_pb.ts +++ b/client-vms/src/gen-proto/nillion/compute/v1/retrieve_pb.ts @@ -6,13 +6,15 @@ import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; import type { Empty } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_empty } from "@bufbuild/protobuf/wkt"; +import type { NamedValue } from "../../values/v1/value_pb"; +import { file_nillion_values_v1_value } from "../../values/v1/value_pb"; import type { Message } from "@bufbuild/protobuf"; /** * Describes the file nillion/compute/v1/retrieve.proto. */ export const file_nillion_compute_v1_retrieve: GenFile = /*@__PURE__*/ - fileDesc("CiFuaWxsaW9uL2NvbXB1dGUvdjEvcmV0cmlldmUucHJvdG8SG25pbGxpb24uY29tcHV0ZS52MS5yZXRyaWV2ZSIsChZSZXRyaWV2ZVJlc3VsdHNSZXF1ZXN0EhIKCmNvbXB1dGVfaWQYASABKAwirQEKF1JldHJpZXZlUmVzdWx0c1Jlc3BvbnNlEjUKE3dhaXRpbmdfY29tcHV0YXRpb24YASABKAsyFi5nb29nbGUucHJvdG9idWYuRW1wdHlIABJBCgdzdWNjZXNzGAIgAS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5Db21wdXRlLlYxLlJldHJpZXZlygIbTmlsbGlvblxDb21wdXRlXFYxXFJldHJpZXZl4gInTmlsbGlvblxDb21wdXRlXFYxXFJldHJpZXZlXEdQQk1ldGFkYXRh6gIeTmlsbGlvbjo6Q29tcHV0ZTo6VjE6OlJldHJpZXZlYgZwcm90bzM", [file_google_protobuf_empty, file_nillion_values_v1_value]); /** * A request to retrieve the results of a computation. @@ -92,6 +94,13 @@ export type ComputationResult = Message<"nillion.compute.v1.retrieve.Computation * @generated from field: bytes bincode_values = 1; */ bincodeValues: Uint8Array; + + /** + * The computation results. + * + * @generated from field: repeated nillion.values.v1.value.NamedValue values = 2; + */ + values: NamedValue[]; }; /** diff --git a/client-vms/src/gen-proto/nillion/leader_queries/v1/pool_status_pb.ts b/client-vms/src/gen-proto/nillion/leader_queries/v1/pool_status_pb.ts index 347724c2..30ee3784 100644 --- a/client-vms/src/gen-proto/nillion/leader_queries/v1/pool_status_pb.ts +++ b/client-vms/src/gen-proto/nillion/leader_queries/v1/pool_status_pb.ts @@ -14,7 +14,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file nillion/leader_queries/v1/pool_status.proto. */ export const file_nillion_leader_queries_v1_pool_status: GenFile = /*@__PURE__*/ - fileDesc("CituaWxsaW9uL2xlYWRlcl9xdWVyaWVzL3YxL3Bvb2xfc3RhdHVzLnByb3RvEiVuaWxsaW9uLmxlYWRlcl9xdWVyaWVzLnYxLnBvb2xfc3RhdHVzIlcKEVBvb2xTdGF0dXNSZXF1ZXN0EkIKDnNpZ25lZF9yZWNlaXB0GAEgASgLMioubmlsbGlvbi5wYXltZW50cy52MS5yZWNlaXB0LlNpZ25lZFJlY2VpcHQigAEKElBvb2xTdGF0dXNSZXNwb25zZRJMCgdvZmZzZXRzGAEgAygLMjsubmlsbGlvbi5sZWFkZXJfcXVlcmllcy52MS5wb29sX3N0YXR1cy5QcmVwcm9jZXNzaW5nT2Zmc2V0cxIcChRwcmVwcm9jZXNzaW5nX2FjdGl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A4yNi5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEuZWxlbWVudC5QcmVwcm9jZXNzaW5nRWxlbWVudBINCgVzdGFydBgCIAEoBBILCgNlbmQYAyABKARC7AEKKWNvbS5uaWxsaW9uLmxlYWRlcl9xdWVyaWVzLnYxLnBvb2xfc3RhdHVzQg9Qb29sU3RhdHVzUHJvdG9QAaICBE5MVlCqAiNOaWxsaW9uLkxlYWRlclF1ZXJpZXMuVjEuUG9vbFN0YXR1c8oCI05pbGxpb25cTGVhZGVyUXVlcmllc1xWMVxQb29sU3RhdHVz4gIvTmlsbGlvblxMZWFkZXJRdWVyaWVzXFYxXFBvb2xTdGF0dXNcR1BCTWV0YWRhdGHqAiZOaWxsaW9uOjpMZWFkZXJRdWVyaWVzOjpWMTo6UG9vbFN0YXR1c2IGcHJvdG8z", [file_nillion_preprocessing_v1_element, file_nillion_payments_v1_receipt]); /** * A request to get the preprocessing pool status. @@ -58,6 +58,13 @@ export type PoolStatusResponse = Message<"nillion.leader_queries.v1.pool_status. * @generated from field: bool preprocessing_active = 2; */ preprocessingActive: boolean; + + /** + * Whether auxiliary material has been generated. + * + * @generated from field: bool auxiliary_material_available = 3; + */ + auxiliaryMaterialAvailable: boolean; }; /** diff --git a/client-vms/src/gen-proto/nillion/payments/v1/balance_pb.ts b/client-vms/src/gen-proto/nillion/payments/v1/balance_pb.ts index f439808a..1517a74c 100644 --- a/client-vms/src/gen-proto/nillion/payments/v1/balance_pb.ts +++ b/client-vms/src/gen-proto/nillion/payments/v1/balance_pb.ts @@ -14,7 +14,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file nillion/payments/v1/balance.proto. */ export const file_nillion_payments_v1_balance: GenFile = /*@__PURE__*/ - fileDesc("CiFuaWxsaW9uL3BheW1lbnRzL3YxL2JhbGFuY2UucHJvdG8SG25pbGxpb24ucGF5bWVudHMudjEuYmFsYW5jZSJbChZBY2NvdW50QmFsYW5jZVJlc3BvbnNlEg8KB2JhbGFuY2UYASAB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lUHJvdG9QAaICBE5QVkKqAhtOaWxsaW9uLlBheW1lbnRzLlYxLkJhbGFuY2XKAhtOaWxsaW9uXFBheW1lbnRzXFYxXEJhbGFuY2XiAidOaWxsaW9uXFBheW1lbnRzXFYxXEJhbGFuY2VcR1BCTWV0YWRhdGHqAh5OaWxsaW9uOjpQYXltZW50czo6VjE6OkJhbGFuY2ViBnByb3RvMw", [file_google_protobuf_timestamp, file_nillion_auth_v1_user]); /** * A response to a request to get the user account's balance. @@ -35,6 +35,13 @@ export type AccountBalanceResponse = Message<"nillion.payments.v1.balance.Accoun * @generated from field: google.protobuf.Timestamp last_updated = 2; */ lastUpdated?: Timestamp; + + /** + * The timestamp at which this balance will expire. + * + * @generated from field: google.protobuf.Timestamp expires_at = 3; + */ + expiresAt?: Timestamp; }; /** diff --git a/client-vms/src/gen-proto/nillion/payments/v1/quote_pb.ts b/client-vms/src/gen-proto/nillion/payments/v1/quote_pb.ts index 23f03c80..2a48c46b 100644 --- a/client-vms/src/gen-proto/nillion/payments/v1/quote_pb.ts +++ b/client-vms/src/gen-proto/nillion/payments/v1/quote_pb.ts @@ -16,7 +16,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file nillion/payments/v1/quote.proto. */ export const file_nillion_payments_v1_quote: GenFile = /*@__PURE__*/ - fileDesc("Ch9uaWxsaW9uL3BheW1lbnRzL3YxL3F1b3RlLnByb3RvEhluaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlIskEChFQcmljZVF1b3RlUmVxdWVzdBItCgtwb29sX3N0YXR1cxgBIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eUgAEkAKDXN0b3JlX3Byb2dyYW0YAiABKAsyJy5uaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlLlN0b3JlUHJvZ3JhbUgAEkQKD3JldHJpZXZlX3ZhbHVlcxgDIAEoCzIpLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGUuUmV0cmlldmVWYWx1ZXNIABJOChRyZXRya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gCIAEoDSIjCg5SZXRyaWV2ZVZhbHVlcxIRCgl2YWx1ZXNfaWQYASABKAwiKAoTUmV0cmlldmVQZXJtaXNzaW9ucxIRCgl2YWx1ZXNfaWQYASABKAwiKQoUT3ZlcndyaXRlUGVybWlzc2lvbnMSEQoJdmFsdWVzX2lkGAEgASgMIiYKEVVwZGF0ZVBlcm1pc3Npb25zEhEKCXZhbHVlc19pZBgBIAEoDCLDAQoLU3RvcmVWYWx1ZXMSGwoTc2VjcmV0X3NoYXJlZF9jb3VudBgCIAEoBBIbChNwdWJsaWNfdmFsdWVzX2NvdW50GAMgASgEEhAKCHR0bF9kYXlzGAQgASgNEhQKDHBheWxvYWRfc2l6ZRgFIAEoBBImCh5lY2RzYV9wcml2YXRlX2tleV9zaGFyZXNfY291bnQYBiABKAQSJAocZWNkc2Ffc2lnbmF0dXJlX3NoYXJlc19jb3VudBgHIAEoBEoECAEQAiJACg1JbnZva2VDb21wdXRlEhIKCnByb2dyYW1faWQYASABKAkSGwoTdmFsdWVzX3BheWxvYWRfc2l6ZRgCIAEoBEKzAQodY29tLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGVCClF1b3RlUHJvdG9QAaICBE5QVlGqAhlOaWxsaW9uLlBheW1lbnRzLlYxLlF1b3RlygIZTmlsbGlvblxQYXltZW50c1xWMVxRdW90ZeICJU5pbGxpb25cUGF5bWVudHNcVjFcUXVvdGVcR1BCTWV0YWRhdGHqAhxOaWxsaW9uOjpQYXltZW50czo6VjE6OlF1b3RlYgZwcm90bzM", [file_google_protobuf_empty, file_google_protobuf_timestamp, file_nillion_preprocessing_v1_element, file_nillion_preprocessing_v1_material]); + fileDesc("Ch9uaWxsaW9uL3BheW1lbnRzL3YxL3F1b3RlLnByb3RvEhluaWxsaW9uLnBheW1lbnRzLnYxLnF1b3RlIskEChFQcmljZVF1b3RlUmVxdWVzdBItCgtwb29sX3N0YXR1cxgBIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eUgAEkAKDX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dFbGVtZW50Eg0KBWNvdW50GAIgASgEIncKHEF1eGlsaWFyeU1hdGVyaWFsUmVxdWlyZW1lbnQSRgoIbWF0ZXJpYWwYASABKA4yNC5uaWxsaW9uLnByZXByb2Nlc3NpbmcudjEubWF0ZXJpYWwuQXV4aWxpYXJ5TWF0ZXJpYWwSDwoHdmVyc2lvbhgCIAEoDSIjCg5SZXRyaWV2ZVZhbHVlcxIRCgl2YWx1ZXNfaWQYASABKAwiKAoTUmV0cmlldmVQZXJtaXNzaW9ucxIRCgl2YWx1ZXNfaWQYASABKAwiKQoUT3ZlcndyaXRlUGVybWlzc2lvbnMSEQoJdmFsdWVzX2lkGAEgASgMIiYKEVVwZGF0ZVBlcm1pc3Npb25zEhEKCXZhbHVlc19pZBgBIAEoDCLVAQoLU3RvcmVWYWx1ZXMSGwoTc2VjcmV0X3NoYXJlZF9jb3VudBgCIAEoBBIbChNwdWJsaWNfdmFsdWVzX2NvdW50GAMgASgEEhUKCHR0bF9kYXlzGAQgASgNSACIAQESFAoMcGF5bG9hZF9zaXplGAUgASgEEiYKHmVjZHNhX3ByaXZhdGVfa2V5X3NoYXJlc19jb3VudBgGIAEoBBIkChxlY2RzYV9zaWduYXR1cmVfc2hhcmVzX2NvdW50GAcgASgEQgsKCV90dGxfZGF5c0oECAEQAiJACg1JbnZva2VDb21wdXRlEhIKCnByb2dyYW1faWQYASABKAkSGwoTdmFsdWVzX3BheWxvYWRfc2l6ZRgCIAEoBEKzAQodY29tLm5pbGxpb24ucGF5bWVudHMudjEucXVvdGVCClF1b3RlUHJvdG9QAaICBE5QVlGqAhlOaWxsaW9uLlBheW1lbnRzLlYxLlF1b3RlygIZTmlsbGlvblxQYXltZW50c1xWMVxRdW90ZeICJU5pbGxpb25cUGF5bWVudHNcVjFcUXVvdGVcR1BCTWV0YWRhdGHqAhxOaWxsaW9uOjpQYXltZW50czo6VjE6OlF1b3RlYgZwcm90bzM", [file_google_protobuf_empty, file_google_protobuf_timestamp, file_nillion_preprocessing_v1_element, file_nillion_preprocessing_v1_material]); /** * A price quote request. @@ -467,9 +467,9 @@ export type StoreValues = Message<"nillion.payments.v1.quote.StoreValues"> & { /** * The number of days to persist these secrets for. * - * @generated from field: uint32 ttl_days = 4; + * @generated from field: optional uint32 ttl_days = 4; */ - ttlDays: number; + ttlDays?: number; /** * The size of the payload to be stored. diff --git a/client-vms/src/gen-proto/nillion/values/v1/retrieve_pb.ts b/client-vms/src/gen-proto/nillion/values/v1/retrieve_pb.ts index 72f8e68e..91f9044d 100644 --- a/client-vms/src/gen-proto/nillion/values/v1/retrieve_pb.ts +++ b/client-vms/src/gen-proto/nillion/values/v1/retrieve_pb.ts @@ -6,13 +6,15 @@ import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; import type { SignedReceipt } from "../../payments/v1/receipt_pb"; import { file_nillion_payments_v1_receipt } from "../../payments/v1/receipt_pb"; +import type { NamedValue } from "./value_pb"; +import { file_nillion_values_v1_value } from "./value_pb"; import type { Message } from "@bufbuild/protobuf"; /** * Describes the file nillion/values/v1/retrieve.proto. */ export const file_nillion_values_v1_retrieve: GenFile = /*@__PURE__*/ - fileDesc("CiBuaWxsaW9uL3ZhbHVlcy92MS9yZXRyaWV2ZS5wcm90bxIabmlsbGlvbi52YWx1ZXMudjEucmV0cmlldmUiWwoVUmV0cmlldmVWYWx1ZXNSZXF1ZXN0EkIKDnNpZ25lZF9yZWNlaXB0GAEgASgLMioubmlsbGlvbi5wYXltZW50cy52MS5yZWNlaXB0LlNpZ25lZFJlY2VpcHQiMAoWUmV0cmlldmVWYWx1ZXNSZXNwb25zZRIWCg5iaW5jb2RlX3ZhbHVlcxgBIAEoDEK7AQoeY29tLm5pbGxpb24udmFsdWVzLnYxLnJldHJpZXZlQg1SZXRyaWV2ZVByb3RvUAGiAgROVlZSqgIaTmlsbGlvbi5WYWx1ZXMuVjEuUmV0cmlldmXKAhpOaWxsaW9uXFZhbHVlc1xWMVxSZXRyaWV2ZeICJk5pbGxpb25cVmFsdWVzXFYxXFJldHJpZXZlXEdQQk1ldGFkYXRh6gIdTmlsbGlvbjo6VmFsdWVzOjpWMTo6UmV0cmlldmViBnByb3RvMw", [file_nillion_payments_v1_receipt]); + fileDesc("CiBuaWxsaW9uL3ZhbHVlcy92MS9yZXRyaWV2ZS5wcm90bxIabmlsbGlvbi52YWx1ZXMudjEucmV0cmlldmUiWwoVUmV0cmlldmVWYWx1ZXNSZXF1ZXN0EkIKDnNpZ25lZF9yZWNlaXB0GAEgASgLMioubmlsbGlvbi5wYXltZW50cy52MS5yZWNlaXB0LlNpZ25lZFJlY2VpcHQiZQoWUmV0cmlldmVWYWx1ZXNSZXNwb25zZRIWCg5iaW5jb2RlX3ZhbHVlcxgBIAEoDBIzCgZ2YWx1ZXMYAiADKAsyIy5uaWxsaW9uLnZhbHVlcy52MS52YWx1ZS5OYW1lZFZhbHVlQrsBCh5jb20ubmlsbGlvbi52YWx1ZXMudjEucmV0cmlldmVCDVJldHJpZXZlUHJvdG9QAaICBE5WVlKqAhpOaWxsaW9uLlZhbHVlcy5WMS5SZXRyaWV2ZcoCGk5pbGxpb25cVmFsdWVzXFYxXFJldHJpZXZl4gImTmlsbGlvblxWYWx1ZXNcVjFcUmV0cmlldmVcR1BCTWV0YWRhdGHqAh1OaWxsaW9uOjpWYWx1ZXM6OlYxOjpSZXRyaWV2ZWIGcHJvdG8z", [file_nillion_payments_v1_receipt, file_nillion_values_v1_value]); /** * A request to retrieve a set of stored values. @@ -49,6 +51,13 @@ export type RetrieveValuesResponse = Message<"nillion.values.v1.retrieve.Retriev * @generated from field: bytes bincode_values = 1; */ bincodeValues: Uint8Array; + + /** + * The values. + * + * @generated from field: repeated nillion.values.v1.value.NamedValue values = 2; + */ + values: NamedValue[]; }; /** diff --git a/client-vms/src/gen-proto/nillion/values/v1/store_pb.ts b/client-vms/src/gen-proto/nillion/values/v1/store_pb.ts index 872c75c4..f43097d7 100644 --- a/client-vms/src/gen-proto/nillion/values/v1/store_pb.ts +++ b/client-vms/src/gen-proto/nillion/values/v1/store_pb.ts @@ -8,13 +8,15 @@ import type { SignedReceipt } from "../../payments/v1/receipt_pb"; import { file_nillion_payments_v1_receipt } from "../../payments/v1/receipt_pb"; import type { Permissions } from "../../permissions/v1/permissions_pb"; import { file_nillion_permissions_v1_permissions } from "../../permissions/v1/permissions_pb"; +import type { NamedValue } from "./value_pb"; +import { file_nillion_values_v1_value } from "./value_pb"; import type { Message } from "@bufbuild/protobuf"; /** * Describes the file nillion/values/v1/store.proto. */ export const file_nillion_values_v1_store: GenFile = /*@__PURE__*/ - fileDesc("Ch1uaWxsaW9uL3ZhbHVlcy92MS9zdG9yZS5wcm90bxIXbmlsbGlvbi52YWx1ZXMudjEuc3RvcmUi0QEKElN0b3JlVmFsdWVzUmVxdWVzdBJCCg5zaWduZWRfcmVjZWlwdBgBIAEoCzIqLm5pbGxpb24ucGF5bWVudHMudjEucmVjZWlwdC5TaWduZWRSZWNlaXB0EhYKDmJpbmNvZGVfdmFsdWVzGAIgASgMEkQKC3Blcm1pc3Npb25zGAMgASgLMi8ubmlsbGlvbi5wZXJtaXNzaW9ucy52MS5wZXJtaXNzaW9ucy5QZXJtaXNzaW9ucxIZChF1cGRhdGVfaWRlbnRpZmllchgEIAEoDCIoChNTdG9yZVZhbHVlc1Jlc3BvbnNlEhEKCXZhbHVlc19pZBgBIAEoDEKpAQobY29tLm5pbGxpb24udmFsdWVzLnYxLnN0b3JlQgpTdG9yZVByb3RvUAGiAgROVlZTqgIXTmlsbGlvbi5WYWx1ZXMuVjEuU3RvcmXKAhdOaWxsaW9uXFZhbHVlc1xWMVxTdG9yZeICI05pbGxpb25cVmFsdWVzXFYxXFN0b3JlXEdQQk1ldGFkYXRh6gIaTmlsbGlvbjo6VmFsdWVzOjpWMTo6U3RvcmViBnByb3RvMw", [file_nillion_payments_v1_receipt, file_nillion_permissions_v1_permissions]); + fileDesc("Ch1uaWxsaW9uL3ZhbHVlcy92MS9zdG9yZS5wcm90bxIXbmlsbGlvbi52YWx1ZXMudjEuc3RvcmUihgIKElN0b3JlVmFsdWVzUmVxdWVzdBJCCg5zaWduZWRfcmVjZWlwdBgBIAEoCzIqLm5pbGxpb24ucGF5bWVudHMudjEucmVjZWlwdC5TaWduZWRSZWNlaXB0EhYKDmJpbmNvZGVfdmFsdWVzGAIgASgMEkQKC3Blcm1pc3Npb25zGAMgASgLMi8ubmlsbGlvbi5wZXJtaXNzaW9ucy52MS5wZXJtaXNzaW9ucy5QZXJtaXNzaW9ucxIZChF1cGRhdGVfaWRlbnRpZmllchgEIAEoDBIzCgZ2YWx1ZXMYBSADKAsyIy5uaWxsaW9uLnZhbHVlcy52MS52YWx1ZS5OYW1lZFZhbHVlIigKE1N0b3JlVmFsdWVzUmVzcG9uc2USEQoJdmFsdWVzX2lkGAEgASgMQqkBChtjb20ubmlsbGlvbi52YWx1ZXMudjEuc3RvcmVCClN0b3JlUHJvdG9QAaICBE5WVlOqAhdOaWxsaW9uLlZhbHVlcy5WMS5TdG9yZcoCF05pbGxpb25cVmFsdWVzXFYxXFN0b3Jl4gIjTmlsbGlvblxWYWx1ZXNcVjFcU3RvcmVcR1BCTWV0YWRhdGHqAhpOaWxsaW9uOjpWYWx1ZXM6OlYxOjpTdG9yZWIGcHJvdG8z", [file_nillion_payments_v1_receipt, file_nillion_permissions_v1_permissions, file_nillion_values_v1_value]); /** * A request to store a set of values. @@ -34,6 +36,8 @@ export type StoreValuesRequest = Message<"nillion.values.v1.store.StoreValuesReq /** * The values encoded in bincode format. * + * Only one of `bincode_values` and `values` can be set. + * * @generated from field: bytes bincode_values = 2; */ bincodeValues: Uint8Array; @@ -60,6 +64,15 @@ export type StoreValuesRequest = Message<"nillion.values.v1.store.StoreValuesReq * @generated from field: bytes update_identifier = 4; */ updateIdentifier: Uint8Array; + + /** + * The values to be stored. + * + * Only one of `bincode_values` and `values` can be set. + * + * @generated from field: repeated nillion.values.v1.value.NamedValue values = 5; + */ + values: NamedValue[]; }; /** diff --git a/client-vms/src/gen-proto/nillion/values/v1/value_pb.ts b/client-vms/src/gen-proto/nillion/values/v1/value_pb.ts new file mode 100644 index 00000000..a4a754a1 --- /dev/null +++ b/client-vms/src/gen-proto/nillion/values/v1/value_pb.ts @@ -0,0 +1,541 @@ +// @generated by protoc-gen-es v2.2.2 with parameter "target=ts" +// @generated from file nillion/values/v1/value.proto (package nillion.values.v1.value, syntax proto3) +/* eslint-disable */ + +import type { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1"; +import { fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1"; +import type { Empty } from "@bufbuild/protobuf/wkt"; +import { file_google_protobuf_empty } from "@bufbuild/protobuf/wkt"; +import type { Message } from "@bufbuild/protobuf"; + +/** + * Describes the file nillion/values/v1/value.proto. + */ +export const file_nillion_values_v1_value: GenFile = /*@__PURE__*/ + fileDesc("Ch1uaWxsaW9uL3ZhbHVlcy92MS92YWx1ZS5wcm90bxIXbmlsbGlvbi52YWx1ZXMudjEudmFsdWUiSQoKTmFtZWRWYWx1ZRIMCgRuYW1lGAEgASgJEi0KBXZhbHVlGAIgASgLMh4ubmlsbGlvbi52YWx1ZXMudjEudmFsdWUuVmFsdWUi0wYKBVZhbHVlEkAKDnB1YmxpY19ib29sZWFuGAEgASgLMiYubmlsbGlvbi52YWx1ZXMudjEudmFsdWUuUHVibGljSW50ZWdlckgAEkAKDnB1YmxpY19pbnRlZ2VyGAIgASgLMiYubmlsbGlvbi52YWx1ZXMudjEudmFsdWUuUHVibGljSW50ZWdlckgAEkkKF3B1YmxpY191bnNpZ25lZF9pbnRlZ2VyGAMgASgLMiYubmlsbGlvbi52YWx1ZXMudjEudmFsdWUuUHVibGljSW50ZWdlckgAEkQKFHNoYW1pcl9zaGFyZV9ib29sZWFuGAQgASgLMiQubmlsbGlvbi52YWx1ZXMudjEudmFsdWUuU2hhbWlyU2hhcmVIABJEChRzaGFtaXJfc2hhcmVfaW50ZWdlchgFIA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VtcHR5SAASNgoUZWNkc2FfbWVzc2FnZV9kaWdlc3QYCiABKAsyFi5nb29nbGUucHJvdG9idWYuRW1wdHlIABI3ChVlY2RzYV9zaWduYXR1cmVfc2hhcmUYCyABKAsyFi5nb29nbGUucHJvdG9idWYuRW1wdHlIAEIMCgp2YWx1ZV90eXBlIlEKCUFycmF5VHlwZRI2Cgppbm5lcl90eXBlGAEgASgLMiIubmlsbGlvbi52YWx1ZXMudjEudmFsdWUuVmFsdWVUeXBlEgwKBHNpemUYAiABKAQicAoJVHVwbGVUeXBlEjAKBGxlZnQYASABKAsyIi5uaWxsaW9uLnZhbHVlcy52MS52YWx1ZS5WYWx1ZVR5cGUSMQoFcmlnaHQYAiABKAsyIi5uaWxsaW9uLnZhbHVlcy52MS52YWx1ZS5WYWx1ZVR5cGVCqQEKG2NvbS5uaWxsaW9uLnZhbHVlcy52MS52YWx1ZUIKVmFsdWVQcm90b1ABogIETlZWVqoCF05pbGxpb24uVmFsdWVzLlYxLlZhbHVlygIXTmlsbGlvblxWYWx1ZXNcVjFcVmFsdWXiAiNOaWxsaW9uXFZhbHVlc1xWMVxWYWx1ZVxHUEJNZXRhZGF0YeoCGk5pbGxpb246OlZhbHVlczo6VjE6OlZhbHVlYgZwcm90bzM", [file_google_protobuf_empty]); + +/** + * A named value. + * + * @generated from message nillion.values.v1.value.NamedValue + */ +export type NamedValue = Message<"nillion.values.v1.value.NamedValue"> & { + /** + * The name of this value. + * + * @generated from field: string name = 1; + */ + name: string; + + /** + * The value itself. + * + * @generated from field: nillion.values.v1.value.Value value = 2; + */ + value?: Value; +}; + +/** + * Describes the message nillion.values.v1.value.NamedValue. + * Use `create(NamedValueSchema)` to create a new message. + */ +export const NamedValueSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 0); + +/** + * A value. + * + * @generated from message nillion.values.v1.value.Value + */ +export type Value = Message<"nillion.values.v1.value.Value"> & { + /** + * @generated from oneof nillion.values.v1.value.Value.value + */ + value: { + /** + * A public boolean. + * + * @generated from field: nillion.values.v1.value.PublicInteger public_boolean = 1; + */ + value: PublicInteger; + case: "publicBoolean"; + } | { + /** + * A public integer. + * + * @generated from field: nillion.values.v1.value.PublicInteger public_integer = 2; + */ + value: PublicInteger; + case: "publicInteger"; + } | { + /** + * A public unsigned integer. + * + * @generated from field: nillion.values.v1.value.PublicInteger public_unsigned_integer = 3; + */ + value: PublicInteger; + case: "publicUnsignedInteger"; + } | { + /** + * A shamir share of a secret boolean value. + * + * @generated from field: nillion.values.v1.value.ShamirShare shamir_share_boolean = 4; + */ + value: ShamirShare; + case: "shamirShareBoolean"; + } | { + /** + * A shamir share of a secret integer value. + * + * @generated from field: nillion.values.v1.value.ShamirShare shamir_share_integer = 5; + */ + value: ShamirShare; + case: "shamirShareInteger"; + } | { + /** + * A shamir share of a secret unsigned integer value. + * + * @generated from field: nillion.values.v1.value.ShamirShare shamir_share_unsigned_integer = 6; + */ + value: ShamirShare; + case: "shamirShareUnsignedInteger"; + } | { + /** + * An array. + * + * @generated from field: nillion.values.v1.value.Array array = 7; + */ + value: Array; + case: "array"; + } | { + /** + * A tuple. + * + * @generated from field: nillion.values.v1.value.Tuple tuple = 8; + */ + value: Tuple; + case: "tuple"; + } | { + /** + * A secret shared blob. + * + * @generated from field: nillion.values.v1.value.ShamirSharesBlob shamir_shares_blob = 9; + */ + value: ShamirSharesBlob; + case: "shamirSharesBlob"; + } | { + /** + * An ECDSA private key share. + * + * @generated from field: nillion.values.v1.value.EcdsaPrivateKeyShare ecdsa_private_key_share = 10; + */ + value: EcdsaPrivateKeyShare; + case: "ecdsaPrivateKeyShare"; + } | { + /** + * An ECDSA signature share. + * + * @generated from field: nillion.values.v1.value.EcdsaSignatureShare ecdsa_signature_share = 11; + */ + value: EcdsaSignatureShare; + case: "ecdsaSignatureShare"; + } | { + /** + * The digest of a message. + * + * @generated from field: nillion.values.v1.value.EcdsaMessageDigest ecdsa_message_digest = 12; + */ + value: EcdsaMessageDigest; + case: "ecdsaMessageDigest"; + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message nillion.values.v1.value.Value. + * Use `create(ValueSchema)` to create a new message. + */ +export const ValueSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 1); + +/** + * A public integer. + * + * @generated from message nillion.values.v1.value.PublicInteger + */ +export type PublicInteger = Message<"nillion.values.v1.value.PublicInteger"> & { + /** + * The integer value, encoded in little endian. + * + * @generated from field: bytes value = 1; + */ + value: Uint8Array; +}; + +/** + * Describes the message nillion.values.v1.value.PublicInteger. + * Use `create(PublicIntegerSchema)` to create a new message. + */ +export const PublicIntegerSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 2); + +/** + * A shamir share. + * + * @generated from message nillion.values.v1.value.ShamirShare + */ +export type ShamirShare = Message<"nillion.values.v1.value.ShamirShare"> & { + /** + * The value, encoded in little endian. + * + * @generated from field: bytes value = 1; + */ + value: Uint8Array; +}; + +/** + * Describes the message nillion.values.v1.value.ShamirShare. + * Use `create(ShamirShareSchema)` to create a new message. + */ +export const ShamirShareSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 3); + +/** + * An array. + * + * @generated from message nillion.values.v1.value.Array + */ +export type Array = Message<"nillion.values.v1.value.Array"> & { + /** + * The array values. + * + * All the values must be of the same type. + * + * @generated from field: repeated nillion.values.v1.value.Value values = 1; + */ + values: Value[]; + + /** + * The type of all elements in this array. + * + * @generated from field: nillion.values.v1.value.ValueType inner_type = 2; + */ + innerType?: ValueType; +}; + +/** + * Describes the message nillion.values.v1.value.Array. + * Use `create(ArraySchema)` to create a new message. + */ +export const ArraySchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 4); + +/** + * A tuple. + * + * @generated from message nillion.values.v1.value.Tuple + */ +export type Tuple = Message<"nillion.values.v1.value.Tuple"> & { + /** + * The left value. + * + * @generated from field: nillion.values.v1.value.Value left = 1; + */ + left?: Value; + + /** + * The right value. + * + * @generated from field: nillion.values.v1.value.Value right = 2; + */ + right?: Value; +}; + +/** + * Describes the message nillion.values.v1.value.Tuple. + * Use `create(TupleSchema)` to create a new message. + */ +export const TupleSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 5); + +/** + * An ECDSA private key share. + * + * @generated from message nillion.values.v1.value.EcdsaPrivateKeyShare + */ +export type EcdsaPrivateKeyShare = Message<"nillion.values.v1.value.EcdsaPrivateKeyShare"> & { + /** + * Index of local party in key generation protocol. + * + * @generated from field: uint32 i = 1; + */ + i: number; + + /** + * The secret share x. + * + * @generated from field: bytes x = 2; + */ + x: Uint8Array; + + /** + * Public key corresponding to shared secret key, in compressed form. + * + * @generated from field: bytes shared_public_key = 3; + */ + sharedPublicKey: Uint8Array; + + /** + * Public shares of all signers sharing the key, in compressed form. + * + * @generated from field: repeated bytes public_shares = 4; + */ + publicShares: Uint8Array[]; +}; + +/** + * Describes the message nillion.values.v1.value.EcdsaPrivateKeyShare. + * Use `create(EcdsaPrivateKeyShareSchema)` to create a new message. + */ +export const EcdsaPrivateKeyShareSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 6); + +/** + * An ECDSA signature share. + * + * @generated from message nillion.values.v1.value.EcdsaSignatureShare + */ +export type EcdsaSignatureShare = Message<"nillion.values.v1.value.EcdsaSignatureShare"> & { + /** + * r component of signature share + * + * @generated from field: bytes r = 1; + */ + r: Uint8Array; + + /** + * sigma component of partial signature share. + * + * @generated from field: bytes sigma = 2; + */ + sigma: Uint8Array; +}; + +/** + * Describes the message nillion.values.v1.value.EcdsaSignatureShare. + * Use `create(EcdsaSignatureShareSchema)` to create a new message. + */ +export const EcdsaSignatureShareSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 7); + +/** + * The digest of a message. + * + * @generated from message nillion.values.v1.value.EcdsaMessageDigest + */ +export type EcdsaMessageDigest = Message<"nillion.values.v1.value.EcdsaMessageDigest"> & { + /** + * The digest. + * + * @generated from field: bytes digest = 1; + */ + digest: Uint8Array; +}; + +/** + * Describes the message nillion.values.v1.value.EcdsaMessageDigest. + * Use `create(EcdsaMessageDigestSchema)` to create a new message. + */ +export const EcdsaMessageDigestSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 8); + +/** + * Shamir shares of a blob. + * + * @generated from message nillion.values.v1.value.ShamirSharesBlob + */ +export type ShamirSharesBlob = Message<"nillion.values.v1.value.ShamirSharesBlob"> & { + /** + * The shares. + * + * @generated from field: repeated nillion.values.v1.value.ShamirShare shares = 1; + */ + shares: ShamirShare[]; + + /** + * The original size of the blob before secret sharing. + * + * @generated from field: uint64 original_size = 2; + */ + originalSize: bigint; +}; + +/** + * Describes the message nillion.values.v1.value.ShamirSharesBlob. + * Use `create(ShamirSharesBlobSchema)` to create a new message. + */ +export const ShamirSharesBlobSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 9); + +/** + * A type of a value. + * + * @generated from message nillion.values.v1.value.ValueType + */ +export type ValueType = Message<"nillion.values.v1.value.ValueType"> & { + /** + * @generated from oneof nillion.values.v1.value.ValueType.value_type + */ + valueType: { + /** + * A public integer. + * + * @generated from field: google.protobuf.Empty public_integer = 1; + */ + value: Empty; + case: "publicInteger"; + } | { + /** + * A public unsigned integer. + * + * @generated from field: google.protobuf.Empty public_unsigned_integer = 2; + */ + value: Empty; + case: "publicUnsignedInteger"; + } | { + /** + * A public boolean. + * + * @generated from field: google.protobuf.Empty public_boolean = 3; + */ + value: Empty; + case: "publicBoolean"; + } | { + /** + * A shamir share of an integer. + * + * @generated from field: google.protobuf.Empty shamir_share_integer = 4; + */ + value: Empty; + case: "shamirShareInteger"; + } | { + /** + * A shamir share of an unsigned integer. + * + * @generated from field: google.protobuf.Empty shamir_share_unsigned_integer = 5; + */ + value: Empty; + case: "shamirShareUnsignedInteger"; + } | { + /** + * A shamir share of a boolean. + * + * @generated from field: google.protobuf.Empty shamir_share_boolean = 6; + */ + value: Empty; + case: "shamirShareBoolean"; + } | { + /** + * An array. + * + * @generated from field: nillion.values.v1.value.ArrayType array = 7; + */ + value: ArrayType; + case: "array"; + } | { + /** + * A tuple. + * + * @generated from field: nillion.values.v1.value.TupleType tuple = 8; + */ + value: TupleType; + case: "tuple"; + } | { + /** + * An ECDSA private key share. + * + * @generated from field: google.protobuf.Empty ecdsa_private_key_share = 9; + */ + value: Empty; + case: "ecdsaPrivateKeyShare"; + } | { + /** + * An ECDSA message digest. + * + * @generated from field: google.protobuf.Empty ecdsa_message_digest = 10; + */ + value: Empty; + case: "ecdsaMessageDigest"; + } | { + /** + * An ECDSA signature share. + * + * @generated from field: google.protobuf.Empty ecdsa_signature_share = 11; + */ + value: Empty; + case: "ecdsaSignatureShare"; + } | { case: undefined; value?: undefined }; +}; + +/** + * Describes the message nillion.values.v1.value.ValueType. + * Use `create(ValueTypeSchema)` to create a new message. + */ +export const ValueTypeSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 10); + +/** + * An array. + * + * @generated from message nillion.values.v1.value.ArrayType + */ +export type ArrayType = Message<"nillion.values.v1.value.ArrayType"> & { + /** + * The type of each element in the array. + * + * @generated from field: nillion.values.v1.value.ValueType inner_type = 1; + */ + innerType?: ValueType; + + /** + * The array size. + * + * @generated from field: uint64 size = 2; + */ + size: bigint; +}; + +/** + * Describes the message nillion.values.v1.value.ArrayType. + * Use `create(ArrayTypeSchema)` to create a new message. + */ +export const ArrayTypeSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 11); + +/** + * A tuple. + * + * @generated from message nillion.values.v1.value.TupleType + */ +export type TupleType = Message<"nillion.values.v1.value.TupleType"> & { + /** + * The type of the left element in the tuple. + * + * @generated from field: nillion.values.v1.value.ValueType left = 1; + */ + left?: ValueType; + + /** + * The type of the right element in the tuple. + * + * @generated from field: nillion.values.v1.value.ValueType right = 2; + */ + right?: ValueType; +}; + +/** + * Describes the message nillion.values.v1.value.TupleType. + * Use `create(TupleTypeSchema)` to create a new message. + */ +export const TupleTypeSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_nillion_values_v1_value, 12); + diff --git a/client-vms/src/types/types.ts b/client-vms/src/types/types.ts index 74f8cc4b..57b198bd 100644 --- a/client-vms/src/types/types.ts +++ b/client-vms/src/types/types.ts @@ -93,3 +93,53 @@ export const NadaValuesRecord = z.record( }), ); export type NadaValuesRecord = z.infer; + +export const EncryptedNadaValueRecord = z.discriminatedUnion("type", [ + z.object({ type: z.literal("Integer"), value: z.instanceof(Uint8Array) }), + z.object({ + type: z.literal("UnsignedInteger"), + value: z.instanceof(Uint8Array), + }), + z.object({ type: z.literal("Boolean"), value: z.instanceof(Uint8Array) }), + z.object({ + type: z.literal("SecretBlob"), + shares: z.array(z.instanceof(Uint8Array)), + originalSize: z.string(), + }), + z.object({ + type: z.literal("ShamirShareInteger"), + value: z.instanceof(Uint8Array), + }), + z.object({ + type: z.literal("ShamirShareUnsignedInteger"), + value: z.instanceof(Uint8Array), + }), + z.object({ + type: z.literal("ShamirShareBoolean"), + value: z.instanceof(Uint8Array), + }), + z.object({ + type: z.literal("EcdsaDigestMessage"), + digest: z.instanceof(Uint8Array), + }), + z.object({ + type: z.literal("EcdsaPrivateKey"), + i: z.string(), + x: z.instanceof(Uint8Array), + sharedPublicKey: z.instanceof(Uint8Array), + publicShares: z.array(z.instanceof(Uint8Array)), + }), + z.object({ + type: z.literal("EcdsaSignature"), + r: z.instanceof(Uint8Array), + sigma: z.instanceof(Uint8Array), + }), +]); +export type EncryptedNadaValueRecord = z.infer; +export const EncryptedNadaValuesRecord = z.record( + z.string(), + EncryptedNadaValueRecord, +); +export type EncryptedNadaValuesRecord = z.infer< + typeof EncryptedNadaValuesRecord +>; diff --git a/client-vms/src/vm/operation/invoke-compute.ts b/client-vms/src/vm/operation/invoke-compute.ts index 5c3db91f..fc5af773 100644 --- a/client-vms/src/vm/operation/invoke-compute.ts +++ b/client-vms/src/vm/operation/invoke-compute.ts @@ -4,7 +4,6 @@ import { type NadaValue, NadaValues, compute_values_size, - encode_values, } from "@nillion/client-wasm"; import { Effect as E, pipe } from "effect"; import { UnknownException } from "effect/Cause"; @@ -32,6 +31,7 @@ import { collapse, unwrapExceptionCause } from "#/util"; import type { VmClient } from "#/vm/client"; import type { Operation } from "#/vm/operation/operation"; import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; +import { nadaValuesToProto } from "#/vm/values"; export const InvokeComputeConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first @@ -119,9 +119,9 @@ export class InvokeCompute implements Operation { request: create(InvokeComputeRequestSchema, { signedReceipt, valueIds, - bincodeValues: encode_values(share.shares), inputBindings, outputBindings, + values: nadaValuesToProto(share.shares.to_js_object()), }), }); }); diff --git a/client-vms/src/vm/operation/retrieve-compute-result.ts b/client-vms/src/vm/operation/retrieve-compute-result.ts index 8a4d8044..b8b77764 100644 --- a/client-vms/src/vm/operation/retrieve-compute-result.ts +++ b/client-vms/src/vm/operation/retrieve-compute-result.ts @@ -1,6 +1,6 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; -import { PartyShares, decode_values } from "@nillion/client-wasm"; +import { EncryptedNadaValues, PartyShares } from "@nillion/client-wasm"; import { Effect as E, pipe } from "effect"; import type { UnknownException } from "effect/Cause"; import { parse } from "uuid"; @@ -16,6 +16,7 @@ import { unwrapExceptionCause } from "#/util"; import type { VmClient } from "#/vm/client"; import type { Operation } from "#/vm/operation/operation"; import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; +import { nadaValuesFromProto } from "#/vm/values"; export const RetrieveComputeResultConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first @@ -101,7 +102,10 @@ export class RetrieveComputeResult implements Operation { if (response.state.case === "success") { return new PartyShares( nodeId.toWasm(), - decode_values(response.state.value.bincodeValues), + EncryptedNadaValues.from_js_object( + nadaValuesFromProto(response.state.value.values), + this.config.vm.masker.modulo(), + ), ); } diff --git a/client-vms/src/vm/operation/retrieve-values.ts b/client-vms/src/vm/operation/retrieve-values.ts index 3dc16238..f0f3e493 100644 --- a/client-vms/src/vm/operation/retrieve-values.ts +++ b/client-vms/src/vm/operation/retrieve-values.ts @@ -1,6 +1,6 @@ import { create } from "@bufbuild/protobuf"; import { type Client, createClient } from "@connectrpc/connect"; -import { PartyShares, decode_values } from "@nillion/client-wasm"; +import { EncryptedNadaValues, PartyShares } from "@nillion/client-wasm"; import { Effect as E, pipe } from "effect"; import type { UnknownException } from "effect/Cause"; import { parse as parseUuid } from "uuid"; @@ -18,6 +18,7 @@ import { unwrapExceptionCause } from "#/util"; import type { VmClient } from "#/vm/client"; import type { Operation } from "#/vm/operation/operation"; import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; +import { nadaValuesFromProto } from "#/vm/values"; export const RetrieveValuesConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first @@ -89,7 +90,10 @@ export class RetrieveValues implements Operation { (response) => new PartyShares( nodeId.toWasm(), - decode_values(response.bincodeValues), + EncryptedNadaValues.from_js_object( + nadaValuesFromProto(response.values), + this.config.vm.masker.modulo(), + ), ), ), E.tap((id) => diff --git a/client-vms/src/vm/operation/store-values.ts b/client-vms/src/vm/operation/store-values.ts index b1d3c2ab..1fff0d57 100644 --- a/client-vms/src/vm/operation/store-values.ts +++ b/client-vms/src/vm/operation/store-values.ts @@ -4,7 +4,6 @@ import { type NadaValue, NadaValues, compute_values_size, - encode_values, } from "@nillion/client-wasm"; import { Effect as E, pipe } from "effect"; import { UnknownException } from "effect/Cause"; @@ -27,6 +26,7 @@ import { collapse, unwrapExceptionCause } from "#/util"; import type { VmClient } from "#/vm/client"; import type { Operation } from "#/vm/operation/operation"; import { retryGrpcRequestIfRecoverable } from "#/vm/operation/retry-client"; +import { nadaValuesToProto } from "#/vm/values"; export const StoreValuesConfig = z.object({ // due to import resolution order we cannot use instanceof because VmClient isn't defined first @@ -96,15 +96,14 @@ export class StoreValues implements Operation { ), ); } - return E.succeed({ nodeId, client: createClient(Values, node.transport), request: create(StoreValuesRequestSchema, { signedReceipt, - bincodeValues: encode_values(share.shares), permissions, updateIdentifier, + values: nadaValuesToProto(share.shares.to_js_object()), }), }); }); diff --git a/client-vms/src/vm/values.ts b/client-vms/src/vm/values.ts new file mode 100644 index 00000000..265270a1 --- /dev/null +++ b/client-vms/src/vm/values.ts @@ -0,0 +1,173 @@ +import { create } from "@bufbuild/protobuf"; +import { + EcdsaMessageDigestSchema, + EcdsaPrivateKeyShareSchema, + EcdsaSignatureShareSchema, + type NamedValue, + NamedValueSchema, + PublicIntegerSchema, + ShamirShareSchema, + ShamirSharesBlobSchema, + type Value, + ValueSchema, +} from "#/gen-proto/nillion/values/v1/value_pb"; +import type { + EncryptedNadaValueRecord, + EncryptedNadaValuesRecord, +} from "#/types"; + +export function nadaValuesToProto( + shares: EncryptedNadaValuesRecord, +): NamedValue[] { + const namedValues: NamedValue[] = []; + for (const [name, share] of Object.entries(shares)) { + const namedValue = create(NamedValueSchema, { + name, + value: nadaValueToProto(share), + }); + namedValues.push(namedValue); + } + return namedValues; +} + +function nadaValueToProto(nadaValue: EncryptedNadaValueRecord): Value { + switch (nadaValue.type) { + case "Integer": + return create(ValueSchema, { + value: { + case: "publicInteger", + value: create(PublicIntegerSchema, { value: nadaValue.value }), + }, + }); + case "UnsignedInteger": + return create(ValueSchema, { + value: { + case: "publicUnsignedInteger", + value: create(PublicIntegerSchema, { value: nadaValue.value }), + }, + }); + case "Boolean": + return create(ValueSchema, { + value: { + case: "publicBoolean", + value: create(PublicIntegerSchema, { value: nadaValue.value }), + }, + }); + case "EcdsaDigestMessage": + return create(ValueSchema, { + value: { + case: "ecdsaMessageDigest", + value: create(EcdsaMessageDigestSchema, { digest: nadaValue.digest }), + }, + }); + case "SecretBlob": + return create(ValueSchema, { + value: { + case: "shamirSharesBlob", + value: create(ShamirSharesBlobSchema, { + shares: nadaValue.shares.map((share) => + create(ShamirShareSchema, { value: share }), + ), + originalSize: BigInt(nadaValue.originalSize), + }), + }, + }); + case "ShamirShareInteger": + return create(ValueSchema, { + value: { + case: "shamirShareInteger", + value: create(ShamirShareSchema, { value: nadaValue.value }), + }, + }); + case "ShamirShareUnsignedInteger": + return create(ValueSchema, { + value: { + case: "shamirShareUnsignedInteger", + value: create(ShamirShareSchema, { value: nadaValue.value }), + }, + }); + case "ShamirShareBoolean": + return create(ValueSchema, { + value: { + case: "shamirShareBoolean", + value: create(ShamirShareSchema, { value: nadaValue.value }), + }, + }); + case "EcdsaPrivateKey": + return create(ValueSchema, { + value: { + case: "ecdsaPrivateKeyShare", + value: create(EcdsaPrivateKeyShareSchema, { + i: Number.parseInt(nadaValue.i), + x: nadaValue.x, + sharedPublicKey: nadaValue.sharedPublicKey, + publicShares: nadaValue.publicShares, + }), + }, + }); + case "EcdsaSignature": + return create(ValueSchema, { + value: { + case: "ecdsaSignatureShare", + value: create(EcdsaSignatureShareSchema, { + r: nadaValue.r, + sigma: nadaValue.sigma, + }), + }, + }); + } +} + +export function nadaValuesFromProto( + values: NamedValue[], +): EncryptedNadaValuesRecord { + const shares: EncryptedNadaValuesRecord = {}; + for (const namedValue of values) { + shares[namedValue.name] = nadaValueFromProto(namedValue.value!)!; + } + return shares; +} + +function nadaValueFromProto( + value: Value, +): EncryptedNadaValueRecord | undefined { + switch (value.value.case) { + case "publicInteger": + return { type: "Integer", value: value.value.value.value }; + case "publicUnsignedInteger": + return { type: "UnsignedInteger", value: value.value.value.value }; + case "publicBoolean": + return { type: "Boolean", value: value.value.value.value }; + case "ecdsaMessageDigest": + return { type: "EcdsaDigestMessage", digest: value.value.value.digest }; + case "shamirSharesBlob": + return { + type: "SecretBlob", + shares: value.value.value.shares.map((share) => share.value), + originalSize: value.value.value.originalSize.toString(), + }; + case "shamirShareInteger": + return { type: "ShamirShareInteger", value: value.value.value.value }; + case "shamirShareUnsignedInteger": + return { + type: "ShamirShareUnsignedInteger", + value: value.value.value.value, + }; + case "shamirShareBoolean": + return { type: "ShamirShareBoolean", value: value.value.value.value }; + case "ecdsaPrivateKeyShare": + return { + type: "EcdsaPrivateKey", + i: value.value.value.i.toString(), + x: value.value.value.x, + sharedPublicKey: value.value.value.sharedPublicKey, + publicShares: value.value.value.publicShares, + }; + case "ecdsaSignatureShare": + return { + type: "EcdsaSignature", + r: value.value.value.r, + sigma: value.value.value.sigma, + }; + } +} diff --git a/client-vms/tests/client.test.ts b/client-vms/tests/client.test.ts index 7a77491f..e94e1206 100644 --- a/client-vms/tests/client.test.ts +++ b/client-vms/tests/client.test.ts @@ -38,9 +38,11 @@ describe("Client", () => { }); describe.sequential("values", () => { - const expectedName = "foo"; - const expectedValue = "42"; - const expectedUpdatedValue = "39"; + const fooExpectedName = "foo"; + const fooExpectedValue = "42"; + const fooExpectedUpdatedValue = "39"; + const barExpectedName = "bar"; + const barExpectedValue = Uint8Array.from([45, 18, 122]); let expectedPermissions: ValuesPermissions; let expectedId: string; @@ -48,7 +50,8 @@ describe("Client", () => { expectedId = await client .storeValues() .ttl(1) - .value(expectedName, NadaValue.new_secret_integer(expectedValue)) + .value(fooExpectedName, NadaValue.new_secret_integer(fooExpectedValue)) + .value(barExpectedName, NadaValue.new_secret_blob(barExpectedValue)) .build() .invoke(); expect(expectedId).toHaveLength(36); @@ -61,10 +64,15 @@ describe("Client", () => { .build() .invoke(); - const values = data[expectedName]!; - expect(values).toBeDefined(); - expect(values.type).toBe("SecretInteger"); - expect(values.value).toBe(expectedValue); + const foo = data[fooExpectedName]!; + expect(foo).toBeDefined(); + expect(foo.type).toBe("SecretInteger"); + expect(foo.value).toBe(fooExpectedValue); + + const bar = data[barExpectedName]!; + expect(bar).toBeDefined(); + expect(bar.type).toBe("SecretBlob"); + expect(bar.value).toStrictEqual(barExpectedValue); }); it("can update", async () => { @@ -72,7 +80,10 @@ describe("Client", () => { .storeValues() .ttl(1) .id(expectedId) - .value(expectedName, NadaValue.new_secret_integer(expectedUpdatedValue)) + .value( + fooExpectedName, + NadaValue.new_secret_integer(fooExpectedUpdatedValue), + ) .build() .invoke(); @@ -82,9 +93,9 @@ describe("Client", () => { .build() .invoke(); - const values = data[expectedName]!; + const values = data[fooExpectedName]!; expect(values.type).toBe("SecretInteger"); - expect(values.value).toBe(expectedUpdatedValue); + expect(values.value).toBe(fooExpectedUpdatedValue); }); it("can retrieve permissions", async () => { diff --git a/client-wasm/dist/index.d.ts b/client-wasm/dist/index.d.ts index c258c9e4..1374110e 100644 --- a/client-wasm/dist/index.d.ts +++ b/client-wasm/dist/index.d.ts @@ -1,18 +1,6 @@ /* tslint:disable */ /* eslint-disable */ /** -* Encode a set of values. -* @param {EncryptedNadaValues} values -* @returns {Uint8Array} -*/ -export function encode_values(values: EncryptedNadaValues): Uint8Array; -/** -* Decode a set of values. -* @param {Uint8Array} bincode_bytes -* @returns {EncryptedNadaValues} -*/ -export function decode_values(bincode_bytes: Uint8Array): EncryptedNadaValues; -/** * Compute the size of the given values. * @param {NadaValues} values * @returns {bigint} @@ -49,10 +37,27 @@ export class EcdsaSignature { s(): Uint8Array; } /** +*/ +export class EncodedModulo { + free(): void; +} +/** * A set of encrypted nada values. */ export class EncryptedNadaValues { free(): void; +/** +* Convert EncryptedNadaValues into a JS object +* @returns {any} +*/ + to_js_object(): any; +/** +* Convert a JS object into a EncryptedNadaValues +* @param {any} js_object +* @param {EncodedModulo} modulo +* @returns {EncryptedNadaValues} +*/ + static from_js_object(js_object: any, modulo: EncodedModulo): EncryptedNadaValues; } /** * NadaValue @@ -392,4 +397,8 @@ export class SecretMasker { * @returns {NadaValuesClassification} */ classify_values(values: NadaValues): NadaValuesClassification; +/** +* @returns {EncodedModulo} +*/ + modulo(): EncodedModulo; } diff --git a/client-wasm/dist/index_bg.js b/client-wasm/dist/index_bg.js index e7e2530a..bd424f94 100644 --- a/client-wasm/dist/index_bg.js +++ b/client-wasm/dist/index_bg.js @@ -4,6 +4,26 @@ export function __wbg_set_wasm(val) { } +const heap = new Array(128).fill(undefined); + +heap.push(undefined, null, true, false); + +function getObject(idx) { return heap[idx]; } + +let heap_next = heap.length; + +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); @@ -24,12 +44,6 @@ function getStringFromWasm0(ptr, len) { return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); } -const heap = new Array(128).fill(undefined); - -heap.push(undefined, null, true, false); - -let heap_next = heap.length; - function addHeapObject(obj) { if (heap_next === heap.length) heap.push(heap.length + 1); const idx = heap_next; @@ -39,18 +53,75 @@ function addHeapObject(obj) { return idx; } -function getObject(idx) { return heap[idx]; } +let WASM_VECTOR_LEN = 0; -function dropObject(idx) { - if (idx < 132) return; - heap[idx] = heap_next; - heap_next = idx; +const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder; + +let cachedTextEncoder = new lTextEncoder('utf-8'); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); } + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8Memory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8Memory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +let cachedInt32Memory0 = null; + +function getInt32Memory0() { + if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { + cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); + } + return cachedInt32Memory0; } function debugString(val) { @@ -118,73 +189,6 @@ function debugString(val) { return className; } -let WASM_VECTOR_LEN = 0; - -const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder; - -let cachedTextEncoder = new lTextEncoder('utf-8'); - -const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' - ? function (arg, view) { - return cachedTextEncoder.encodeInto(arg, view); -} - : function (arg, view) { - const buf = cachedTextEncoder.encode(arg); - view.set(buf); - return { - read: arg.length, - written: buf.length - }; -}); - -function passStringToWasm0(arg, malloc, realloc) { - - if (realloc === undefined) { - const buf = cachedTextEncoder.encode(arg); - const ptr = malloc(buf.length, 1) >>> 0; - getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); - WASM_VECTOR_LEN = buf.length; - return ptr; - } - - let len = arg.length; - let ptr = malloc(len, 1) >>> 0; - - const mem = getUint8Memory0(); - - let offset = 0; - - for (; offset < len; offset++) { - const code = arg.charCodeAt(offset); - if (code > 0x7F) break; - mem[ptr + offset] = code; - } - - if (offset !== len) { - if (offset !== 0) { - arg = arg.slice(offset); - } - ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; - const view = getUint8Memory0().subarray(ptr + offset, ptr + len); - const ret = encodeString(arg, view); - - offset += ret.written; - ptr = realloc(ptr, len, offset, 1) >>> 0; - } - - WASM_VECTOR_LEN = offset; - return ptr; -} - -let cachedInt32Memory0 = null; - -function getInt32Memory0() { - if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { - cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); - } - return cachedInt32Memory0; -} - function passArray8ToWasm0(arg, malloc) { const ptr = malloc(arg.length * 1, 1) >>> 0; getUint8Memory0().set(arg, ptr / 1); @@ -233,53 +237,6 @@ function getArrayJsValueFromWasm0(ptr, len) { } return result; } -/** -* Encode a set of values. -* @param {EncryptedNadaValues} values -* @returns {Uint8Array} -*/ -export function encode_values(values) { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - _assertClass(values, EncryptedNadaValues); - wasm.encode_values(retptr, values.__wbg_ptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var r2 = getInt32Memory0()[retptr / 4 + 2]; - var r3 = getInt32Memory0()[retptr / 4 + 3]; - if (r3) { - throw takeObject(r2); - } - var v1 = getArrayU8FromWasm0(r0, r1).slice(); - wasm.__wbindgen_free(r0, r1 * 1, 1); - return v1; - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } -} - -/** -* Decode a set of values. -* @param {Uint8Array} bincode_bytes -* @returns {EncryptedNadaValues} -*/ -export function decode_values(bincode_bytes) { - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passArray8ToWasm0(bincode_bytes, wasm.__wbindgen_malloc); - const len0 = WASM_VECTOR_LEN; - wasm.decode_values(retptr, ptr0, len0); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - var r2 = getInt32Memory0()[retptr / 4 + 2]; - if (r2) { - throw takeObject(r1); - } - return EncryptedNadaValues.__wrap(r0); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - } -} let cachedBigInt64Memory0 = null; @@ -311,6 +268,14 @@ export function compute_values_size(values) { } } +let stack_pointer = 128; + +function addBorrowedObject(obj) { + if (stack_pointer == 1) throw new Error('out of js stack'); + heap[--stack_pointer] = obj; + return stack_pointer; +} + function handleError(f, args) { try { return f.apply(this, args); @@ -387,6 +352,34 @@ export class EcdsaSignature { } } +const EncodedModuloFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_encodedmodulo_free(ptr >>> 0)); +/** +*/ +export class EncodedModulo { + + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(EncodedModulo.prototype); + obj.__wbg_ptr = ptr; + EncodedModuloFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + EncodedModuloFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_encodedmodulo_free(ptr); + } +} + const EncryptedNadaValuesFinalization = (typeof FinalizationRegistry === 'undefined') ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry(ptr => wasm.__wbg_encryptednadavalues_free(ptr >>> 0)); @@ -414,6 +407,49 @@ export class EncryptedNadaValues { const ptr = this.__destroy_into_raw(); wasm.__wbg_encryptednadavalues_free(ptr); } + /** + * Convert EncryptedNadaValues into a JS object + * @returns {any} + */ + to_js_object() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.encryptednadavalues_to_js_object(retptr, this.__wbg_ptr); + var r0 = getInt32Memory0()[retptr / 4 + 0]; + var r1 = getInt32Memory0()[retptr / 4 + 1]; + var r2 = getInt32Memory0()[retptr / 4 + 2]; + if (r2) { + throw takeObject(r1); + } + return takeObject(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * Convert a JS object into a EncryptedNadaValues + * @param {any} js_object + * @param {EncodedModulo} modulo + * @returns {EncryptedNadaValues} + */ + static from_js_object(js_object, modulo) { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertClass(modulo, EncodedModulo); + var ptr0 = modulo.__destroy_into_raw(); + wasm.encryptednadavalues_from_js_object(retptr, addBorrowedObject(js_object), ptr0); + var r0 = getInt32Memory0()[retptr / 4 + 0]; + var r1 = getInt32Memory0()[retptr / 4 + 1]; + var r2 = getInt32Memory0()[retptr / 4 + 2]; + if (r2) { + throw takeObject(r1); + } + return EncryptedNadaValues.__wrap(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + heap[stack_pointer++] = undefined; + } + } } const NadaValueFinalization = (typeof FinalizationRegistry === 'undefined') @@ -1376,8 +1412,19 @@ export class SecretMasker { const ret = wasm.secretmasker_classify_values(this.__wbg_ptr, values.__wbg_ptr); return NadaValuesClassification.__wrap(ret); } + /** + * @returns {EncodedModulo} + */ + modulo() { + const ret = wasm.secretmasker_modulo(this.__wbg_ptr); + return EncodedModulo.__wrap(ret); + } } +export function __wbindgen_object_drop_ref(arg0) { + takeObject(arg0); +}; + export function __wbindgen_error_new(arg0, arg1) { const ret = new Error(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); @@ -1398,10 +1445,6 @@ export function __wbg_set_1f9b04f170055d33() { return handleError(function (arg0 return ret; }, arguments) }; -export function __wbindgen_object_drop_ref(arg0) { - takeObject(arg0); -}; - export function __wbg_newwithlength_e9b4878cebadb3d3(arg0) { const ret = new Uint8Array(arg0 >>> 0); return addHeapObject(ret); @@ -1422,6 +1465,46 @@ export function __wbg_partyshares_unwrap(arg0) { return ret; }; +export function __wbg_new_16b304a2cfa7ff4a() { + const ret = new Array(); + return addHeapObject(ret); +}; + +export function __wbg_push_a5b05aedc7234f9f(arg0, arg1) { + const ret = getObject(arg0).push(getObject(arg1)); + return ret; +}; + +export function __wbindgen_is_object(arg0) { + const val = getObject(arg0); + const ret = typeof(val) === 'object' && val !== null; + return ret; +}; + +export function __wbg_ownKeys_658942b7f28d1fe9() { return handleError(function (arg0) { + const ret = Reflect.ownKeys(getObject(arg0)); + return addHeapObject(ret); +}, arguments) }; + +export function __wbindgen_string_get(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; + +export function __wbg_get_e3c254076557e348() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(getObject(arg0), getObject(arg1)); + return addHeapObject(ret); +}, arguments) }; + +export function __wbg_from_89e3fc3ba5e6fb48(arg0) { + const ret = Array.from(getObject(arg0)); + return addHeapObject(ret); +}; + export function __wbindgen_memory() { const ret = wasm.memory; return addHeapObject(ret); @@ -1450,15 +1533,6 @@ export function __wbg_getRandomValues_3aa56aa6edec874c() { return handleError(fu getObject(arg0).getRandomValues(getObject(arg1)); }, arguments) }; -export function __wbg_new_63b92bc8671ed464(arg0) { - const ret = new Uint8Array(getObject(arg0)); - return addHeapObject(ret); -}; - -export function __wbg_set_a47bac70306a19a7(arg0, arg1, arg2) { - getObject(arg0).set(getObject(arg1), arg2 >>> 0); -}; - export function __wbindgen_object_clone_ref(arg0) { const ret = getObject(arg0); return addHeapObject(ret); @@ -1469,12 +1543,6 @@ export function __wbg_crypto_1d1f22824a6a080c(arg0) { return addHeapObject(ret); }; -export function __wbindgen_is_object(arg0) { - const val = getObject(arg0); - const ret = typeof(val) === 'object' && val !== null; - return ret; -}; - export function __wbg_process_4a72847cc503995b(arg0) { const ret = getObject(arg0).process; return addHeapObject(ret); @@ -1515,6 +1583,25 @@ export function __wbg_msCrypto_eb05e62b530a1508(arg0) { return addHeapObject(ret); }; +export function __wbg_length_cd7af8117672b8b8(arg0) { + const ret = getObject(arg0).length; + return ret; +}; + +export function __wbg_get_bd8e338fbd5f5cc8(arg0, arg1) { + const ret = getObject(arg0)[arg1 >>> 0]; + return addHeapObject(ret); +}; + +export function __wbg_new_63b92bc8671ed464(arg0) { + const ret = new Uint8Array(getObject(arg0)); + return addHeapObject(ret); +}; + +export function __wbg_set_a47bac70306a19a7(arg0, arg1, arg2) { + getObject(arg0).set(getObject(arg1), arg2 >>> 0); +}; + export function __wbg_length_c20a40f15020d68a(arg0) { const ret = getObject(arg0).length; return ret; diff --git a/client-wasm/dist/index_bg.wasm b/client-wasm/dist/index_bg.wasm index 196977ed..6cf8a706 100644 Binary files a/client-wasm/dist/index_bg.wasm and b/client-wasm/dist/index_bg.wasm differ diff --git a/client-wasm/dist/index_bg.wasm.d.ts b/client-wasm/dist/index_bg.wasm.d.ts index d22a1d67..ce332624 100644 --- a/client-wasm/dist/index_bg.wasm.d.ts +++ b/client-wasm/dist/index_bg.wasm.d.ts @@ -25,6 +25,7 @@ export function ecdsasignature_r(a: number): number; export function ecdsasignature_s(a: number): number; export function __wbg_partyid_free(a: number): void; export function partyid_new(a: number, b: number): number; +export function __wbg_encodedmodulo_free(a: number): void; export function __wbg_secretmasker_free(a: number): void; export function secretmasker_new_64_bit_safe_prime(a: number, b: number, c: number, d: number): void; export function secretmasker_new_128_bit_safe_prime(a: number, b: number, c: number, d: number): void; @@ -32,6 +33,7 @@ export function secretmasker_new_256_bit_safe_prime(a: number, b: number, c: num export function secretmasker_mask(a: number, b: number, c: number): void; export function secretmasker_unmask(a: number, b: number, c: number, d: number): void; export function secretmasker_classify_values(a: number, b: number): number; +export function secretmasker_modulo(a: number): number; export function __wbg_nadavaluesclassification_free(a: number): void; export function __wbg_get_nadavaluesclassification_shares(a: number): number; export function __wbg_set_nadavaluesclassification_shares(a: number, b: number): void; @@ -45,10 +47,10 @@ export function __wbg_partyshares_free(a: number): void; export function partyshares_new(a: number, b: number, c: number): void; export function partyshares_party(a: number): number; export function partyshares_shares(a: number): number; -export function encode_values(a: number, b: number): void; -export function decode_values(a: number, b: number, c: number): void; export function compute_values_size(a: number, b: number): void; export function __wbg_encryptednadavalues_free(a: number): void; +export function encryptednadavalues_to_js_object(a: number, b: number): void; +export function encryptednadavalues_from_js_object(a: number, b: number, c: number): void; export function __wbg_programmetadata_free(a: number): void; export function programmetadata_new(a: number, b: number, c: number): void; export function programmetadata_memory_size(a: number): number;