2021-05-09 21:11:27 -07:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import sys; assert sys.version_info[0] >= 3, "Python 3 required."
|
|
|
|
|
2022-01-07 06:52:55 -08:00
|
|
|
from .pallas import Fp, Scalar
|
|
|
|
from ..utils import leos2ip
|
2021-05-09 21:11:27 -07:00
|
|
|
|
|
|
|
#
|
|
|
|
# Utilities
|
|
|
|
#
|
|
|
|
|
|
|
|
def to_scalar(buf):
|
|
|
|
return Scalar(leos2ip(buf))
|
|
|
|
|
|
|
|
def to_base(buf):
|
|
|
|
return Fp(leos2ip(buf))
|