MCPcopy Create free account
hub / github.com/DOSNetwork/core / SetBytes

Method SetBytes

group/mod/int.go:379–386  ·  view source on GitHub ↗

SetBytes set the value value to a number represented by a byte string. Endianness depends on the endianess set in i.

(a []byte)

Source from the content-addressed store, hash-verified

377// by a byte string.
378// Endianness depends on the endianess set in i.
379func (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.

Callers 15

InitBytesMethod · 0.95
TestIntEndianBytesFunction · 0.45
TestIntCloneFunction · 0.45
UnmarshalBinaryMethod · 0.45
HideDecodeMethod · 0.45
EmbedMethod · 0.45
EmbedMethod · 0.45
UnmarshalBinaryMethod · 0.45
QuadraticResidueGroupMethod · 0.45
TestSetBytesBEFunction · 0.45
decodePubKeyFunction · 0.45
ToBigIntMethod · 0.45

Calls 1

reverseFunction · 0.85

Tested by 3

TestIntEndianBytesFunction · 0.36
TestIntCloneFunction · 0.36
TestSetBytesBEFunction · 0.36