func signH1(suite abstract.Suite, H1pre abstract.Cipher, PG, PH abstract.Point) abstract.Secret { H1 := H1pre.Clone() PGb, _ := PG.MarshalBinary() H1.Write(PGb) if PH != nil { PHb, _ := PH.MarshalBinary() H1.Write(PHb) } H1.Message(nil, nil, nil) // finish message absorption return suite.Secret().Pick(H1) }
// benchmarkCipher tests the speed of a Cipher to process a size-byte message. func benchmarkCipher(b *testing.B, cipher abstract.Cipher, size int) { b.SetBytes(int64(size)) for i := 0; i < b.N; i++ { cipher.Message(buf[:size], buf[:size], buf[:size]) } }