Changeset 32e1c96
- Timestamp:
- Sep 22, 2016 5:10:50 PM (4 years ago)
- Branches:
- master
- Children:
- 4ab727a
- Parents:
- fb323ce
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
core/java/src/net/i2p/crypto/eddsa/math/bigint/BigIntegerLittleEndianEncoding.java
rfb323ce r32e1c96 30 30 * 31 31 * @return array of length b/8 32 * @throws IllegalStateException if field not set 32 33 */ 33 34 public byte[] encode(BigInteger x) { 35 if (f == null) 36 throw new IllegalStateException("field not set"); 34 37 byte[] in = x.toByteArray(); 35 38 byte[] out = new byte[f.getb()/8]; … … 43 46 } 44 47 48 /** 49 * Decode a FieldElement from its (b-1)-bit encoding. 50 * The highest bit is masked out. 51 * 52 * @param in the (b-1)-bit encoding of a FieldElement. 53 * @return the FieldElement represented by 'val'. 54 * @throws IllegalStateException if field not set 55 * @throws IllegalArgumentException if encoding is invalid 56 */ 45 57 public FieldElement decode(byte[] in) { 58 if (f == null) 59 throw new IllegalStateException("field not set"); 46 60 if (in.length != f.getb()/8) 47 61 throw new IllegalArgumentException("Not a valid encoding");
Note: See TracChangeset
for help on using the changeset viewer.