Exemple #1
0
            /// <summary>
            /// Take an array of strings and fill in the private key from that
            /// Fields in order are:  LMS type, LMOTS type, Seed, Q, Identifier
            /// </summary>
            /// <param name="input"></param>
            /// <param name="offset"></param>
            public LmsKey(string[] input, int offset)
            {
                _lmsType   = (LmsAlgorithmType)Int32.Parse(input[offset]);
                _lmotsType = (LmotsAlgorithmType)Int32.Parse(input[offset + 1]);
                _seed      = StringToByteArray(input[offset + 2]);
                LeafNumber = Int32.Parse(input[offset + 3]);
                Identifier = StringToByteArray(input[offset + 4]);

                BuildFromSeed(_seed);
            }
Exemple #2
0
            public LmsKey(LmsAlgorithmType lmsTypeIn, LmotsAlgorithmType lmotsTypeIn)
            {
                _lmsType   = lmsTypeIn;
                _lmotsType = lmotsTypeIn;
                Identifier = new byte[16];

                SecureRandom rng = Message.GetPRNG();

                rng.NextBytes(Identifier, 0, 16);

                _seed = new byte[M];
                rng.NextBytes(_seed, 0, _seed.Length);
                BuildFromSeed(_seed);
            }
Exemple #3
0
 public HssNode(LmsAlgorithmType lmsType, LmotsAlgorithmType lmotsType)
 {
     privateKey = new LmsKey(lmsType, lmotsType);
 }