// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v5.29.3
// source: dkg.proto

package dkg

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	DKGService_StartDkg_FullMethodName        = "/dkg.DKGService/start_dkg"
	DKGService_InitiateDkg_FullMethodName     = "/dkg.DKGService/initiate_dkg"
	DKGService_Round1Packages_FullMethodName  = "/dkg.DKGService/round1_packages"
	DKGService_Round1Signature_FullMethodName = "/dkg.DKGService/round1_signature"
	DKGService_Round2Packages_FullMethodName  = "/dkg.DKGService/round2_packages"
)

// DKGServiceClient is the client API for DKGService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// # Distributed Key Generation Service
//
// This service is used to coordinate the Distributed Key Generation protocol for each participant
// signing operator in a batch.
type DKGServiceClient interface {
	// Start the Distributed Key Generation protocol for a participant.
	//
	// This call will be made by a signing operator to the DKG coordinator to start the DKG
	// protocol.
	StartDkg(ctx context.Context, in *StartDkgRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Initiate the Distributed Key Generation protocol for a participant.
	//
	// This will be called by the coordinator to initiate the DKG protocol. The call will be made
	// to each participant in the signing group.
	//
	// This will return the round1 package for the participant.
	InitiateDkg(ctx context.Context, in *InitiateDkgRequest, opts ...grpc.CallOption) (*InitiateDkgResponse, error)
	// Deliver round 1 packages to participants
	//
	// This will be called by the coordinator to deliver the round1 packages to the participants,
	// after the coordinator has received the round1 packages from all participants.
	//
	// This will return the signature on the hash of the round1 packages by the participant to
	// ensure integrity of the packages.
	Round1Packages(ctx context.Context, in *Round1PackagesRequest, opts ...grpc.CallOption) (*Round1PackagesResponse, error)
	// Deliver all round 1 package siganture to participants
	//
	// This will be called by the coordinator to deliver the round1 package signatures to the
	// participants, after the coordinator has received the round1 package signatures from all
	// participants.
	//
	// This will return the result of the validation of the round1 package signatures by the
	// participants.
	Round1Signature(ctx context.Context, in *Round1SignatureRequest, opts ...grpc.CallOption) (*Round1SignatureResponse, error)
	// Deliver round 2 packages to participants
	//
	// This will be called by each participant to deliver the round2 packages to the other
	// participants. After received all round2 packages from all participants, the participant will
	// be able to generate the shared secret by calling round3.
	//
	// This will return the acknowledgement of the round2 packages by the participant.
	Round2Packages(ctx context.Context, in *Round2PackagesRequest, opts ...grpc.CallOption) (*Round2PackagesResponse, error)
}

type dKGServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewDKGServiceClient(cc grpc.ClientConnInterface) DKGServiceClient {
	return &dKGServiceClient{cc}
}

func (c *dKGServiceClient) StartDkg(ctx context.Context, in *StartDkgRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, DKGService_StartDkg_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dKGServiceClient) InitiateDkg(ctx context.Context, in *InitiateDkgRequest, opts ...grpc.CallOption) (*InitiateDkgResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(InitiateDkgResponse)
	err := c.cc.Invoke(ctx, DKGService_InitiateDkg_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dKGServiceClient) Round1Packages(ctx context.Context, in *Round1PackagesRequest, opts ...grpc.CallOption) (*Round1PackagesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Round1PackagesResponse)
	err := c.cc.Invoke(ctx, DKGService_Round1Packages_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dKGServiceClient) Round1Signature(ctx context.Context, in *Round1SignatureRequest, opts ...grpc.CallOption) (*Round1SignatureResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Round1SignatureResponse)
	err := c.cc.Invoke(ctx, DKGService_Round1Signature_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *dKGServiceClient) Round2Packages(ctx context.Context, in *Round2PackagesRequest, opts ...grpc.CallOption) (*Round2PackagesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Round2PackagesResponse)
	err := c.cc.Invoke(ctx, DKGService_Round2Packages_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// DKGServiceServer is the server API for DKGService service.
// All implementations must embed UnimplementedDKGServiceServer
// for forward compatibility.
//
// # Distributed Key Generation Service
//
// This service is used to coordinate the Distributed Key Generation protocol for each participant
// signing operator in a batch.
type DKGServiceServer interface {
	// Start the Distributed Key Generation protocol for a participant.
	//
	// This call will be made by a signing operator to the DKG coordinator to start the DKG
	// protocol.
	StartDkg(context.Context, *StartDkgRequest) (*emptypb.Empty, error)
	// Initiate the Distributed Key Generation protocol for a participant.
	//
	// This will be called by the coordinator to initiate the DKG protocol. The call will be made
	// to each participant in the signing group.
	//
	// This will return the round1 package for the participant.
	InitiateDkg(context.Context, *InitiateDkgRequest) (*InitiateDkgResponse, error)
	// Deliver round 1 packages to participants
	//
	// This will be called by the coordinator to deliver the round1 packages to the participants,
	// after the coordinator has received the round1 packages from all participants.
	//
	// This will return the signature on the hash of the round1 packages by the participant to
	// ensure integrity of the packages.
	Round1Packages(context.Context, *Round1PackagesRequest) (*Round1PackagesResponse, error)
	// Deliver all round 1 package siganture to participants
	//
	// This will be called by the coordinator to deliver the round1 package signatures to the
	// participants, after the coordinator has received the round1 package signatures from all
	// participants.
	//
	// This will return the result of the validation of the round1 package signatures by the
	// participants.
	Round1Signature(context.Context, *Round1SignatureRequest) (*Round1SignatureResponse, error)
	// Deliver round 2 packages to participants
	//
	// This will be called by each participant to deliver the round2 packages to the other
	// participants. After received all round2 packages from all participants, the participant will
	// be able to generate the shared secret by calling round3.
	//
	// This will return the acknowledgement of the round2 packages by the participant.
	Round2Packages(context.Context, *Round2PackagesRequest) (*Round2PackagesResponse, error)
	mustEmbedUnimplementedDKGServiceServer()
}

// UnimplementedDKGServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedDKGServiceServer struct{}

func (UnimplementedDKGServiceServer) StartDkg(context.Context, *StartDkgRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StartDkg not implemented")
}
func (UnimplementedDKGServiceServer) InitiateDkg(context.Context, *InitiateDkgRequest) (*InitiateDkgResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method InitiateDkg not implemented")
}
func (UnimplementedDKGServiceServer) Round1Packages(context.Context, *Round1PackagesRequest) (*Round1PackagesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Round1Packages not implemented")
}
func (UnimplementedDKGServiceServer) Round1Signature(context.Context, *Round1SignatureRequest) (*Round1SignatureResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Round1Signature not implemented")
}
func (UnimplementedDKGServiceServer) Round2Packages(context.Context, *Round2PackagesRequest) (*Round2PackagesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Round2Packages not implemented")
}
func (UnimplementedDKGServiceServer) mustEmbedUnimplementedDKGServiceServer() {}
func (UnimplementedDKGServiceServer) testEmbeddedByValue()                    {}

// UnsafeDKGServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DKGServiceServer will
// result in compilation errors.
type UnsafeDKGServiceServer interface {
	mustEmbedUnimplementedDKGServiceServer()
}

func RegisterDKGServiceServer(s grpc.ServiceRegistrar, srv DKGServiceServer) {
	// If the following call pancis, it indicates UnimplementedDKGServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&DKGService_ServiceDesc, srv)
}

func _DKGService_StartDkg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StartDkgRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DKGServiceServer).StartDkg(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DKGService_StartDkg_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DKGServiceServer).StartDkg(ctx, req.(*StartDkgRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DKGService_InitiateDkg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(InitiateDkgRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DKGServiceServer).InitiateDkg(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DKGService_InitiateDkg_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DKGServiceServer).InitiateDkg(ctx, req.(*InitiateDkgRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DKGService_Round1Packages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Round1PackagesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DKGServiceServer).Round1Packages(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DKGService_Round1Packages_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DKGServiceServer).Round1Packages(ctx, req.(*Round1PackagesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DKGService_Round1Signature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Round1SignatureRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DKGServiceServer).Round1Signature(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DKGService_Round1Signature_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DKGServiceServer).Round1Signature(ctx, req.(*Round1SignatureRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DKGService_Round2Packages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Round2PackagesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DKGServiceServer).Round2Packages(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DKGService_Round2Packages_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DKGServiceServer).Round2Packages(ctx, req.(*Round2PackagesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// DKGService_ServiceDesc is the grpc.ServiceDesc for DKGService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DKGService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dkg.DKGService",
	HandlerType: (*DKGServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "start_dkg",
			Handler:    _DKGService_StartDkg_Handler,
		},
		{
			MethodName: "initiate_dkg",
			Handler:    _DKGService_InitiateDkg_Handler,
		},
		{
			MethodName: "round1_packages",
			Handler:    _DKGService_Round1Packages_Handler,
		},
		{
			MethodName: "round1_signature",
			Handler:    _DKGService_Round1Signature_Handler,
		},
		{
			MethodName: "round2_packages",
			Handler:    _DKGService_Round2Packages_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "dkg.proto",
}
