Skip to content

Commit c282bd2

Browse files
Modified values.OID (ECC)
1 parent 991de26 commit c282bd2

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

packet/values/ecc.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ import (
1313
type OID []byte
1414

1515
var oidList = map[string][]byte{
16-
"NIST curve P-256": {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07},
17-
"NIST curve P-384": {0x2b, 0x81, 0x04, 0x00, 0x22},
18-
"NIST curve P-521": {0x2b, 0x81, 0x04, 0x00, 0x23},
16+
"NIST P-256": {0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07},
17+
"NIST P-384": {0x2b, 0x81, 0x04, 0x00, 0x22},
18+
"NIST P-521": {0x2b, 0x81, 0x04, 0x00, 0x23},
19+
"brainpoolP256r1": {0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x07},
20+
"brainpoolP512r1": {0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0D},
21+
"Ed25519": {0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA, 0x47, 0x0F, 0x01},
22+
"Curve25519": {0x2B, 0x06, 0x01, 0x04, 0x01, 0x97, 0x55, 0x01, 0x05, 0x01},
1923
}
2024

2125
//NewOID returns OID instance
@@ -81,7 +85,7 @@ func (ep ECParm) ToItem(name string, dumpFlag bool) *info.Item {
8185
)
8286
}
8387

84-
/* Copyright 2016 Spiegel
88+
/* Copyright 2016,2017 Spiegel
8589
*
8690
* Licensed under the Apache License, Version 2.0 (the "License");
8791
* you may not use this file except in compliance with the License.

packet/values/ecc_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
func TestEccNITSP256(t *testing.T) {
1212
data := []byte{0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07}
1313
dump := "2a 86 48 ce 3d 03 01 07"
14-
note := "NIST curve P-256"
14+
note := "NIST P-256"
1515
reader := reader.New(data)
1616
oid, err := NewOID(reader)
1717
if err != nil {
@@ -35,7 +35,7 @@ func TestEccNITSP256(t *testing.T) {
3535
func TestEccNITSP384(t *testing.T) {
3636
data := []byte{0x05, 0x2b, 0x81, 0x04, 0x00, 0x22}
3737
dump := "2b 81 04 00 22"
38-
note := "NIST curve P-384"
38+
note := "NIST P-384"
3939
reader := reader.New(data)
4040
oid, err := NewOID(reader)
4141
if err != nil {
@@ -59,7 +59,7 @@ func TestEccNITSP384(t *testing.T) {
5959
func TestEccNITSP521(t *testing.T) {
6060
data := []byte{0x05, 0x2b, 0x81, 0x04, 0x00, 0x23}
6161
dump := "2b 81 04 00 23"
62-
note := "NIST curve P-521"
62+
note := "NIST P-521"
6363
reader := reader.New(data)
6464
oid, err := NewOID(reader)
6565
if err != nil {

0 commit comments

Comments
 (0)