from .base import CurveInfo, PublicKey
from pyasn1.codec.der import encoder

A = "0000000000000000000000000000000000000000000000000000000000000000"
B = "0000000000000000000000000000000000000000000000000000000000000007"
SEED = None
P = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"
GENERATOR = "0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8"
N = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"
H = "01"


class KoblitzPublicKey(PublicKey):
    def __init__(self, public_key):
        super().__init__(public_key, CurveInfo(P, A, B, SEED, GENERATOR, N, H))

    def encode(self):
        return encoder.encode(self.spki)
