Beispiel #1
0
// Unmarshal []byte into BlindingParamClient
func (blindingParamClient BlindingParamClient) Unmarshal(b []byte) (genericblinding.BlindingData, error) {
	n := new(BlindingParamClient)
	_, err := asn1.Unmarshal(b, n)
	if err != nil {
		return nil, err
	}
	if n.SchemeName != blindingParamClient.SchemeName {
		return nil, genericblinding.ErrBadScheme
	}
	if n.DataType != blindingParamClient.DataType {
		return nil, genericblinding.ErrBadType
	}
	if !eccutil.PointEqual(&blindingParamClient.PubKey, &n.PubKey) {
		return nil, genericblinding.ErrBadSigner
	}
	return *n, nil
}
Beispiel #2
0
// Unmarshal []byte into BlindingParamClient
func (clearSignature ClearSignature) Unmarshal(b []byte) (genericblinding.BlindingData, error) {
	n := new(ClearSignature)
	_, err := asn1.Unmarshal(b, n)
	if err != nil {
		return nil, err
	}
	if n.SchemeName != clearSignature.SchemeName {
		return nil, genericblinding.ErrBadScheme
	}
	if n.DataType != clearSignature.DataType {
		return nil, genericblinding.ErrBadType
	}
	if !eccutil.PointEqual(&clearSignature.PubKey, &n.PubKey) {
		return nil, genericblinding.ErrBadSigner
	}
	return *n, nil
}