Documentation ¶
Overview ¶
Package utils exports mostly used functions in cryptomony library
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrI2OSPIntegerTooLarge returns when integer's bit length larger than requested length ErrI2OSPIntegerTooLarge = errors.New("i2osp: integer too large") // ErrI2OSPIntegerNegative returns when given integer is negative ErrI2OSPIntegerNegative = errors.New("i2osp: negative integer") )
Functions ¶
func I2osp ¶
I2osp converts a nonnegative integer to an octet string of a specified length.
Reference: (https://datatracker.ietf.org/doc/html/rfc8017#section-4.1)
func Os2ip ¶
Os2ip converts an octet string to a nonnegative integer.
Reference: (https://datatracker.ietf.org/doc/html/rfc8017#section-4.2)
func RandomBytes ¶
RandomBytes returns random bytes of with given length (wrapper for crypto/rand).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.