Skip to content

Commit

Permalink
Modify Algo name to global parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen00991 committed Oct 11, 2024
1 parent e8f7fcb commit 9b59859
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 39 deletions.
12 changes: 6 additions & 6 deletions security/encr/encr.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ func init() {
// ENCR Types
encrTypes = make(map[string]ENCRType)

encrTypes[string_ENCR_AES_CBC_128] = &ENCR_AES_CBC{
encrTypes[String_ENCR_AES_CBC_128] = &ENCR_AES_CBC{
keyLength: 16,
}
encrTypes[string_ENCR_AES_CBC_192] = &ENCR_AES_CBC{
encrTypes[String_ENCR_AES_CBC_192] = &ENCR_AES_CBC{
keyLength: 24,
}
encrTypes[string_ENCR_AES_CBC_256] = &ENCR_AES_CBC{
encrTypes[String_ENCR_AES_CBC_256] = &ENCR_AES_CBC{
keyLength: 32,
}

// ENCR Kernel Types
encrKTypes = make(map[string]ENCRKType)

encrKTypes[string_ENCR_AES_CBC_128] = &ENCR_AES_CBC{
encrKTypes[String_ENCR_AES_CBC_128] = &ENCR_AES_CBC{
keyLength: 16,
}
encrKTypes[string_ENCR_AES_CBC_192] = &ENCR_AES_CBC{
encrKTypes[String_ENCR_AES_CBC_192] = &ENCR_AES_CBC{
keyLength: 24,
}
encrKTypes[string_ENCR_AES_CBC_256] = &ENCR_AES_CBC{
encrKTypes[String_ENCR_AES_CBC_256] = &ENCR_AES_CBC{
keyLength: 32,
}
}
Expand Down
12 changes: 6 additions & 6 deletions security/encr/encr_aes_cbc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ import (
)

const (
string_ENCR_AES_CBC_128 string = "ENCR_AES_CBC_128"
string_ENCR_AES_CBC_192 string = "ENCR_AES_CBC_192"
string_ENCR_AES_CBC_256 string = "ENCR_AES_CBC_256"
String_ENCR_AES_CBC_128 string = "ENCR_AES_CBC_128"
String_ENCR_AES_CBC_192 string = "ENCR_AES_CBC_192"
String_ENCR_AES_CBC_256 string = "ENCR_AES_CBC_256"
)

func toString_ENCR_AES_CBC(attrType uint16, intValue uint16, bytesValue []byte) string {
if attrType == message.AttributeTypeKeyLength {
switch intValue {
case 128:
return string_ENCR_AES_CBC_128
return String_ENCR_AES_CBC_128
case 192:
return string_ENCR_AES_CBC_192
return String_ENCR_AES_CBC_192
case 256:
return string_ENCR_AES_CBC_256
return String_ENCR_AES_CBC_256
default:
return ""
}
Expand Down
12 changes: 6 additions & 6 deletions security/esn/esn.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ var (
)

const (
string_ESN_ENABLE string = "ESN_ENABLE"
string_ESN_DISABLE string = "ESN_DISABLE"
String_ESN_ENABLE string = "ESN_ENABLE"
String_ESN_DISABLE string = "ESN_DISABLE"
)

func toString_ESN_ENABLE(attrType uint16, intValue uint16, bytesValue []byte) string {
return string_ESN_ENABLE
return String_ESN_ENABLE
}

func toString_ESN_DISABLE(attrType uint16, intValue uint16, bytesValue []byte) string {
return string_ESN_DISABLE
return String_ESN_DISABLE
}

func init() {
Expand All @@ -33,10 +33,10 @@ func init() {
// ESN Types
esnTypes = make(map[string]ESN)

esnTypes[string_ESN_ENABLE] = ESN{
esnTypes[String_ESN_ENABLE] = ESN{
needESN: true,
}
esnTypes[string_ESN_DISABLE] = ESN{
esnTypes[String_ESN_DISABLE] = ESN{
needESN: false,
}
}
Expand Down
4 changes: 2 additions & 2 deletions security/integ/auth_hmac_md5_96.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/free5gc/ike/message"
)

const string_AUTH_HMAC_MD5_96 string = "AUTH_HMAC_MD5_96"
const String_AUTH_HMAC_MD5_96 string = "AUTH_HMAC_MD5_96"

func toString_AUTH_HMAC_MD5_96(attrType uint16, intValue uint16, bytesValue []byte) string {
return string_AUTH_HMAC_MD5_96
return String_AUTH_HMAC_MD5_96
}

var (
Expand Down
4 changes: 2 additions & 2 deletions security/integ/auth_hmac_sha1_96.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/free5gc/ike/message"
)

const string_AUTH_HMAC_SHA1_96 string = "AUTH_HMAC_SHA1_96"
const String_AUTH_HMAC_SHA1_96 string = "AUTH_HMAC_SHA1_96"

func toString_AUTH_HMAC_SHA1_96(attrType uint16, intValue uint16, bytesValue []byte) string {
return string_AUTH_HMAC_SHA1_96
return String_AUTH_HMAC_SHA1_96
}

var (
Expand Down
4 changes: 2 additions & 2 deletions security/integ/auth_hmac_sha2_256_128.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/free5gc/ike/message"
)

const string_AUTH_HMAC_SHA2_256_128 string = "AUTH_HMAC_SHA2_256_128"
const String_AUTH_HMAC_SHA2_256_128 string = "AUTH_HMAC_SHA2_256_128"

func toString_AUTH_HMAC_SHA2_256_128(attrType uint16, intValue uint16, bytesValue []byte) string {
return string_AUTH_HMAC_SHA2_256_128
return String_AUTH_HMAC_SHA2_256_128
}

var (
Expand Down
12 changes: 6 additions & 6 deletions security/integ/integ.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,31 @@ func init() {
// INTEG Types
integTypes = make(map[string]INTEGType)

integTypes[string_AUTH_HMAC_MD5_96] = &AUTH_HMAC_MD5_96{
integTypes[String_AUTH_HMAC_MD5_96] = &AUTH_HMAC_MD5_96{
keyLength: 16,
outputLength: 12,
}
integTypes[string_AUTH_HMAC_SHA1_96] = &AUTH_HMAC_SHA1_96{
integTypes[String_AUTH_HMAC_SHA1_96] = &AUTH_HMAC_SHA1_96{
keyLength: 20,
outputLength: 12,
}
integTypes[string_AUTH_HMAC_SHA2_256_128] = &AUTH_HMAC_SHA2_256_128{
integTypes[String_AUTH_HMAC_SHA2_256_128] = &AUTH_HMAC_SHA2_256_128{
keyLength: 32,
outputLength: 16,
}

// INTEG Kernel Types
integKTypes = make(map[string]INTEGKType)

integKTypes[string_AUTH_HMAC_MD5_96] = &AUTH_HMAC_MD5_96{
integKTypes[String_AUTH_HMAC_MD5_96] = &AUTH_HMAC_MD5_96{
keyLength: 16,
outputLength: 12,
}
integKTypes[string_AUTH_HMAC_SHA1_96] = &AUTH_HMAC_SHA1_96{
integKTypes[String_AUTH_HMAC_SHA1_96] = &AUTH_HMAC_SHA1_96{
keyLength: 20,
outputLength: 12,
}
integKTypes[string_AUTH_HMAC_SHA2_256_128] = &AUTH_HMAC_SHA2_256_128{
integKTypes[String_AUTH_HMAC_SHA2_256_128] = &AUTH_HMAC_SHA2_256_128{
keyLength: 32,
outputLength: 16,
}
Expand Down
6 changes: 3 additions & 3 deletions security/prf/prf.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ func init() {
// PRF Types
prfTypes = make(map[string]PRFType)

prfTypes[string_PRF_HMAC_MD5] = &PRF_HMAC_MD5{
prfTypes[String_PRF_HMAC_MD5] = &PRF_HMAC_MD5{
keyLength: 16,
outputLength: 16,
}
prfTypes[string_PRF_HMAC_SHA1] = &PRF_HMAC_SHA1{
prfTypes[String_PRF_HMAC_SHA1] = &PRF_HMAC_SHA1{
keyLength: 20,
outputLength: 20,
}
prfTypes[string_PRF_HMAC_SHA2_256] = &PRF_HMAC_SHA2_256{
prfTypes[String_PRF_HMAC_SHA2_256] = &PRF_HMAC_SHA2_256{
keyLength: 32,
outputLength: 32,
}
Expand Down
4 changes: 2 additions & 2 deletions security/prf/prf_hmac_md5.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/free5gc/ike/message"
)

const string_PRF_HMAC_MD5 string = "PRF_HMAC_MD5"
const String_PRF_HMAC_MD5 string = "PRF_HMAC_MD5"

func toString_PRF_HMAC_MD5(attrType uint16, intValue uint16, bytesValue []byte) string {
return string_PRF_HMAC_MD5
return String_PRF_HMAC_MD5
}

var _ PRFType = &PRF_HMAC_MD5{}
Expand Down
4 changes: 2 additions & 2 deletions security/prf/prf_hmac_sha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/free5gc/ike/message"
)

const string_PRF_HMAC_SHA1 string = "PRF_HMAC_SHA1"
const String_PRF_HMAC_SHA1 string = "PRF_HMAC_SHA1"

func toString_PRF_HMAC_SHA1(attrType uint16, intValue uint16, bytesValue []byte) string {
return string_PRF_HMAC_SHA1
return String_PRF_HMAC_SHA1
}

var _ PRFType = &PRF_HMAC_SHA1{}
Expand Down
4 changes: 2 additions & 2 deletions security/prf/prf_hmac_sha2_256.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/free5gc/ike/message"
)

const string_PRF_HMAC_SHA2_256 string = "PRF_HMAC_SHA2_256"
const String_PRF_HMAC_SHA2_256 string = "PRF_HMAC_SHA2_256"

func toString_PRF_HMAC_SHA2_256(attrType uint16, intValue uint16, bytesValue []byte) string {
return string_PRF_HMAC_SHA2_256
return String_PRF_HMAC_SHA2_256
}

var _ PRFType = &PRF_HMAC_SHA2_256{}
Expand Down

0 comments on commit 9b59859

Please sign in to comment.