SetBytes set the value value to a number represented by a byte string. Endianness depends on the endianess set in i.
(a []byte)
| 377 | // by a byte string. |
| 378 | // Endianness depends on the endianess set in i. |
| 379 | func (i *Int) SetBytes(a []byte) kyber.Scalar { |
| 380 | var buff = a |
| 381 | if i.BO == LittleEndian { |
| 382 | buff = reverse(nil, a) |
| 383 | } |
| 384 | i.V.SetBytes(buff).Mod(&i.V, i.M) |
| 385 | return i |
| 386 | } |
| 387 | |
| 388 | // LittleEndian encodes the value of this Int into a little-endian byte-slice |
| 389 | // at least min bytes but no more than max bytes long. |