Example #1
0
        public TestTranscript(byte[] label)
        {
            _strobe = new Strobe128("WabiSabi_v1.0");

            var metadata = Enumerable.Concat(Encoding.UTF8.GetBytes("domain-separator"), BitConverter.GetBytes(label.Length)).ToArray();

            _strobe.AddAssociatedMetaData(metadata, false);
            _strobe.AddAssociatedData(label, false);
        }
    public TestTranscript(byte[] label)
    {
        _strobe = new Strobe128(ProtocolConstants.WabiSabiProtocolIdentifier);

        var metadata = Enumerable.Concat(
            Encoding.UTF8.GetBytes(ProtocolConstants.DomainStrobeSeparator),
            BitConverter.GetBytes(label.Length)).ToArray();

        _strobe.AddAssociatedMetaData(metadata, false);
        _strobe.AddAssociatedData(label, false);
    }
    public SyntheticSecretNonceProvider(Strobe128 strobe, IEnumerable <Scalar> secrets, WasabiRandom random)
    {
        Guard.NotNullOrEmpty(nameof(secrets), secrets);
        _strobe      = strobe;
        _secretCount = secrets.Count();

        // add secret inputs as key material
        foreach (var secret in secrets)
        {
            _strobe.Key(secret.ToBytes(), false);
        }

        _strobe.Key(random.GetBytes(32), false);
    }
Example #4
0
        public SyntheticSecretNonceProvider(Strobe128 strobe, IEnumerable <Scalar> secrets, WasabiRandom random)
        {
            Guard.NotNullOrEmpty(nameof(secrets), secrets);

            _strobe = strobe;

            // add secret inputs as key material
            foreach (var secret in secrets)
            {
                _strobe.Key(secret.ToBytes(), false);
            }

            // add randomness as key material
            _strobe.Key(random.GetBytes(32), false);

            // Set up a generator of vectors of scalars the size as secrets vector
            Sequence = VectorGenerator(secrets.Count());
        }
Example #5
0
 // Private constructor used for cloning.
 private Transcript(Strobe128 strobe)
 {
     _strobe = strobe;
 }
Example #6
0
 private StrobeHasher(string domain)
 {
     _strobe = new Strobe128(ProtocolConstants.WabiSabiProtocolIdentifier);
     Append(ProtocolConstants.DomainStrobeSeparator, domain);
 }