-
Notifications
You must be signed in to change notification settings - Fork 22
/
ed448.go
72 lines (57 loc) · 1001 Bytes
/
ed448.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package ed448
import (
"crypto"
"github.com/deatil/go-cryptobin/ed448"
)
type (
// 设置
Options = ed448.Options
)
const (
SchemeED448 = ed448.ED448
SchemeED448Ph = ed448.ED448Ph
)
/**
* ED448
*
* @create 2023-10-25
* @author deatil
*/
type ED448 struct {
// 私钥
privateKey ed448.PrivateKey
// 公钥
publicKey ed448.PublicKey
// 设置
options *Options
// [私钥/公钥]数据
keyData []byte
// 传入数据
data []byte
// 解析后的数据
parsedData []byte
// 验证结果
verify bool
// 错误
Errors []error
}
// 构造函数
func NewED448() ED448 {
return ED448{
options: &Options{
Hash: crypto.Hash(0),
Context: "",
Scheme: SchemeED448,
},
verify: false,
Errors: make([]error, 0),
}
}
// 构造函数
func New() ED448 {
return NewED448()
}
var (
// 默认
defaultED448 = NewED448()
)