// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        v5.29.3
// source: spark_authn.proto

package spark_authn

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// Challenge represents the core challenge data
type Challenge struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Protocol version for backward compatibility
	Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	// Timestamp when challenge was issued (UTC Unix seconds)
	Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// Random nonce to prevent replay attacks (32 bytes)
	Nonce []byte `protobuf:"bytes,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// The public key this challenge is intended for (uncompressed secp256k1 public key)
	PublicKey     []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Challenge) Reset() {
	*x = Challenge{}
	mi := &file_spark_authn_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Challenge) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Challenge) ProtoMessage() {}

func (x *Challenge) ProtoReflect() protoreflect.Message {
	mi := &file_spark_authn_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Challenge.ProtoReflect.Descriptor instead.
func (*Challenge) Descriptor() ([]byte, []int) {
	return file_spark_authn_proto_rawDescGZIP(), []int{0}
}

func (x *Challenge) GetVersion() int32 {
	if x != nil {
		return x.Version
	}
	return 0
}

func (x *Challenge) GetTimestamp() int64 {
	if x != nil {
		return x.Timestamp
	}
	return 0
}

func (x *Challenge) GetNonce() []byte {
	if x != nil {
		return x.Nonce
	}
	return nil
}

func (x *Challenge) GetPublicKey() []byte {
	if x != nil {
		return x.PublicKey
	}
	return nil
}

// ProtectedChallenge wraps a Challenge with a server HMAC
type ProtectedChallenge struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Protocol version for backward compatibility
	Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	// The core challenge data
	Challenge *Challenge `protobuf:"bytes,2,opt,name=challenge,proto3" json:"challenge,omitempty"`
	// Server's HMAC of the Challenge
	ServerHmac    []byte `protobuf:"bytes,3,opt,name=server_hmac,json=serverHmac,proto3" json:"server_hmac,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *ProtectedChallenge) Reset() {
	*x = ProtectedChallenge{}
	mi := &file_spark_authn_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *ProtectedChallenge) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*ProtectedChallenge) ProtoMessage() {}

func (x *ProtectedChallenge) ProtoReflect() protoreflect.Message {
	mi := &file_spark_authn_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use ProtectedChallenge.ProtoReflect.Descriptor instead.
func (*ProtectedChallenge) Descriptor() ([]byte, []int) {
	return file_spark_authn_proto_rawDescGZIP(), []int{1}
}

func (x *ProtectedChallenge) GetVersion() int32 {
	if x != nil {
		return x.Version
	}
	return 0
}

func (x *ProtectedChallenge) GetChallenge() *Challenge {
	if x != nil {
		return x.Challenge
	}
	return nil
}

func (x *ProtectedChallenge) GetServerHmac() []byte {
	if x != nil {
		return x.ServerHmac
	}
	return nil
}

// Request to initiate an authentication challenge
type GetChallengeRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Client's public key (uncompressed secp256k1 public key)
	PublicKey     []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *GetChallengeRequest) Reset() {
	*x = GetChallengeRequest{}
	mi := &file_spark_authn_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *GetChallengeRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*GetChallengeRequest) ProtoMessage() {}

func (x *GetChallengeRequest) ProtoReflect() protoreflect.Message {
	mi := &file_spark_authn_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use GetChallengeRequest.ProtoReflect.Descriptor instead.
func (*GetChallengeRequest) Descriptor() ([]byte, []int) {
	return file_spark_authn_proto_rawDescGZIP(), []int{2}
}

func (x *GetChallengeRequest) GetPublicKey() []byte {
	if x != nil {
		return x.PublicKey
	}
	return nil
}

// Response containing the protected challenge
type GetChallengeResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The protected challenge from the server
	ProtectedChallenge *ProtectedChallenge `protobuf:"bytes,1,opt,name=protected_challenge,json=protectedChallenge,proto3" json:"protected_challenge,omitempty"`
	unknownFields      protoimpl.UnknownFields
	sizeCache          protoimpl.SizeCache
}

func (x *GetChallengeResponse) Reset() {
	*x = GetChallengeResponse{}
	mi := &file_spark_authn_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *GetChallengeResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*GetChallengeResponse) ProtoMessage() {}

func (x *GetChallengeResponse) ProtoReflect() protoreflect.Message {
	mi := &file_spark_authn_proto_msgTypes[3]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use GetChallengeResponse.ProtoReflect.Descriptor instead.
func (*GetChallengeResponse) Descriptor() ([]byte, []int) {
	return file_spark_authn_proto_rawDescGZIP(), []int{3}
}

func (x *GetChallengeResponse) GetProtectedChallenge() *ProtectedChallenge {
	if x != nil {
		return x.ProtectedChallenge
	}
	return nil
}

// Request to verify a signed challenge
type VerifyChallengeRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The protected challenge from the server
	ProtectedChallenge *ProtectedChallenge `protobuf:"bytes,1,opt,name=protected_challenge,json=protectedChallenge,proto3" json:"protected_challenge,omitempty"`
	// Client's secp256k1 signature of the Challenge
	Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// Client's public key (uncompressed secp256k1 public key)
	PublicKey     []byte `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *VerifyChallengeRequest) Reset() {
	*x = VerifyChallengeRequest{}
	mi := &file_spark_authn_proto_msgTypes[4]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *VerifyChallengeRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*VerifyChallengeRequest) ProtoMessage() {}

func (x *VerifyChallengeRequest) ProtoReflect() protoreflect.Message {
	mi := &file_spark_authn_proto_msgTypes[4]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use VerifyChallengeRequest.ProtoReflect.Descriptor instead.
func (*VerifyChallengeRequest) Descriptor() ([]byte, []int) {
	return file_spark_authn_proto_rawDescGZIP(), []int{4}
}

func (x *VerifyChallengeRequest) GetProtectedChallenge() *ProtectedChallenge {
	if x != nil {
		return x.ProtectedChallenge
	}
	return nil
}

func (x *VerifyChallengeRequest) GetSignature() []byte {
	if x != nil {
		return x.Signature
	}
	return nil
}

func (x *VerifyChallengeRequest) GetPublicKey() []byte {
	if x != nil {
		return x.PublicKey
	}
	return nil
}

// Response after successful authentication
type VerifyChallengeResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Session token for subsequent API calls
	SessionToken string `protobuf:"bytes,1,opt,name=session_token,json=sessionToken,proto3" json:"session_token,omitempty"`
	// Token expiration timestamp (UTC Unix seconds)
	ExpirationTimestamp int64 `protobuf:"varint,2,opt,name=expiration_timestamp,json=expirationTimestamp,proto3" json:"expiration_timestamp,omitempty"`
	unknownFields       protoimpl.UnknownFields
	sizeCache           protoimpl.SizeCache
}

func (x *VerifyChallengeResponse) Reset() {
	*x = VerifyChallengeResponse{}
	mi := &file_spark_authn_proto_msgTypes[5]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *VerifyChallengeResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*VerifyChallengeResponse) ProtoMessage() {}

func (x *VerifyChallengeResponse) ProtoReflect() protoreflect.Message {
	mi := &file_spark_authn_proto_msgTypes[5]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use VerifyChallengeResponse.ProtoReflect.Descriptor instead.
func (*VerifyChallengeResponse) Descriptor() ([]byte, []int) {
	return file_spark_authn_proto_rawDescGZIP(), []int{5}
}

func (x *VerifyChallengeResponse) GetSessionToken() string {
	if x != nil {
		return x.SessionToken
	}
	return ""
}

func (x *VerifyChallengeResponse) GetExpirationTimestamp() int64 {
	if x != nil {
		return x.ExpirationTimestamp
	}
	return 0
}

var File_spark_authn_proto protoreflect.FileDescriptor

const file_spark_authn_proto_rawDesc = "" +
	"\n" +
	"\x11spark_authn.proto\x12\vspark_authn\"x\n" +
	"\tChallenge\x12\x18\n" +
	"\aversion\x18\x01 \x01(\x05R\aversion\x12\x1c\n" +
	"\ttimestamp\x18\x02 \x01(\x03R\ttimestamp\x12\x14\n" +
	"\x05nonce\x18\x03 \x01(\fR\x05nonce\x12\x1d\n" +
	"\n" +
	"public_key\x18\x04 \x01(\fR\tpublicKey\"\x85\x01\n" +
	"\x12ProtectedChallenge\x12\x18\n" +
	"\aversion\x18\x01 \x01(\x05R\aversion\x124\n" +
	"\tchallenge\x18\x02 \x01(\v2\x16.spark_authn.ChallengeR\tchallenge\x12\x1f\n" +
	"\vserver_hmac\x18\x03 \x01(\fR\n" +
	"serverHmac\"4\n" +
	"\x13GetChallengeRequest\x12\x1d\n" +
	"\n" +
	"public_key\x18\x01 \x01(\fR\tpublicKey\"h\n" +
	"\x14GetChallengeResponse\x12P\n" +
	"\x13protected_challenge\x18\x01 \x01(\v2\x1f.spark_authn.ProtectedChallengeR\x12protectedChallenge\"\xa7\x01\n" +
	"\x16VerifyChallengeRequest\x12P\n" +
	"\x13protected_challenge\x18\x01 \x01(\v2\x1f.spark_authn.ProtectedChallengeR\x12protectedChallenge\x12\x1c\n" +
	"\tsignature\x18\x02 \x01(\fR\tsignature\x12\x1d\n" +
	"\n" +
	"public_key\x18\x03 \x01(\fR\tpublicKey\"q\n" +
	"\x17VerifyChallengeResponse\x12#\n" +
	"\rsession_token\x18\x01 \x01(\tR\fsessionToken\x121\n" +
	"\x14expiration_timestamp\x18\x02 \x01(\x03R\x13expirationTimestamp2\xcc\x01\n" +
	"\x11SparkAuthnService\x12V\n" +
	"\rget_challenge\x12 .spark_authn.GetChallengeRequest\x1a!.spark_authn.GetChallengeResponse\"\x00\x12_\n" +
	"\x10verify_challenge\x12#.spark_authn.VerifyChallengeRequest\x1a$.spark_authn.VerifyChallengeResponse\"\x00B2Z0github.com/lightsparkdev/spark/proto/spark_authnb\x06proto3"

var (
	file_spark_authn_proto_rawDescOnce sync.Once
	file_spark_authn_proto_rawDescData []byte
)

func file_spark_authn_proto_rawDescGZIP() []byte {
	file_spark_authn_proto_rawDescOnce.Do(func() {
		file_spark_authn_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_spark_authn_proto_rawDesc), len(file_spark_authn_proto_rawDesc)))
	})
	return file_spark_authn_proto_rawDescData
}

var file_spark_authn_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_spark_authn_proto_goTypes = []any{
	(*Challenge)(nil),               // 0: spark_authn.Challenge
	(*ProtectedChallenge)(nil),      // 1: spark_authn.ProtectedChallenge
	(*GetChallengeRequest)(nil),     // 2: spark_authn.GetChallengeRequest
	(*GetChallengeResponse)(nil),    // 3: spark_authn.GetChallengeResponse
	(*VerifyChallengeRequest)(nil),  // 4: spark_authn.VerifyChallengeRequest
	(*VerifyChallengeResponse)(nil), // 5: spark_authn.VerifyChallengeResponse
}
var file_spark_authn_proto_depIdxs = []int32{
	0, // 0: spark_authn.ProtectedChallenge.challenge:type_name -> spark_authn.Challenge
	1, // 1: spark_authn.GetChallengeResponse.protected_challenge:type_name -> spark_authn.ProtectedChallenge
	1, // 2: spark_authn.VerifyChallengeRequest.protected_challenge:type_name -> spark_authn.ProtectedChallenge
	2, // 3: spark_authn.SparkAuthnService.get_challenge:input_type -> spark_authn.GetChallengeRequest
	4, // 4: spark_authn.SparkAuthnService.verify_challenge:input_type -> spark_authn.VerifyChallengeRequest
	3, // 5: spark_authn.SparkAuthnService.get_challenge:output_type -> spark_authn.GetChallengeResponse
	5, // 6: spark_authn.SparkAuthnService.verify_challenge:output_type -> spark_authn.VerifyChallengeResponse
	5, // [5:7] is the sub-list for method output_type
	3, // [3:5] is the sub-list for method input_type
	3, // [3:3] is the sub-list for extension type_name
	3, // [3:3] is the sub-list for extension extendee
	0, // [0:3] is the sub-list for field type_name
}

func init() { file_spark_authn_proto_init() }
func file_spark_authn_proto_init() {
	if File_spark_authn_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_spark_authn_proto_rawDesc), len(file_spark_authn_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   6,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_spark_authn_proto_goTypes,
		DependencyIndexes: file_spark_authn_proto_depIdxs,
		MessageInfos:      file_spark_authn_proto_msgTypes,
	}.Build()
	File_spark_authn_proto = out.File
	file_spark_authn_proto_goTypes = nil
	file_spark_authn_proto_depIdxs = nil
}
