-
Notifications
You must be signed in to change notification settings - Fork 22
/
curve_with.go
47 lines (34 loc) · 894 Bytes
/
curve_with.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
package curve25519
import (
"github.com/deatil/go-cryptobin/dhd/curve25519"
)
// 设置 PrivateKey
func (this Curve25519) WithPrivateKey(data *curve25519.PrivateKey) Curve25519 {
this.privateKey = data
return this
}
// 设置 PublicKey
func (this Curve25519) WithPublicKey(data *curve25519.PublicKey) Curve25519 {
this.publicKey = data
return this
}
// 设置 keyData
func (this Curve25519) WithKeyData(data []byte) Curve25519 {
this.keyData = data
return this
}
// 设置 secretData
func (this Curve25519) WithSecretData(data []byte) Curve25519 {
this.secretData = data
return this
}
// 设置错误
func (this Curve25519) WithErrors(errs []error) Curve25519 {
this.Errors = errs
return this
}
// 添加错误
func (this Curve25519) AppendError(err ...error) Curve25519 {
this.Errors = append(this.Errors, err...)
return this
}