@Test public void testSmallPlaintextWithRawKey() throws Exception { byte[] keyValue = Random.randBytes(KEY_SIZE); Keyset.Key primary = TestUtil.createKey( TestUtil.createPrfKeyData(keyValue), 5, KeyStatusType.ENABLED, OutputPrefixType.RAW); KeysetHandle keysetHandle = TestUtil.createKeysetHandle(TestUtil.createKeyset(primary)); byte[] plaintext = "blah".getBytes(UTF_8); PrfSet prfSet = new PrfSetWrapper().wrap(Registry.getPrimitives(keysetHandle, PrfSet.class)); byte[] prs = prfSet.computePrimary(plaintext, 12); byte[] prs2 = prfSet.getPrfs().get(5).compute(plaintext, 12); assertEquals(5, prfSet.getPrimaryId()); assertThat(prfSet.getPrfs()).hasSize(1); assertThat(prs).hasLength(12); assertArrayEquals(prs2, prs); }
@Override public PrfSet wrap(PrimitiveSet<PrfSet> set) throws GeneralSecurityException { return new WrappedPrfSet(set); }
PrfSetWrapper implements PrimitiveWrapper<PrfSet, PrfSet> { @Override public PrfSet wrap(PrimitiveSet<PrfSet> set) throws GeneralSecurityException { return new WrappedPrfSet(set); } }
PrfSetWrapper implements PrimitiveWrapper<PrfSet, PrfSet> { @Override public PrfSet wrap(PrimitiveSet<PrfSet> set) throws GeneralSecurityException { return new WrappedPrfSet(set); }  }
PrfSetWrapper implements PrimitiveWrapper<PrfSet, PrfSet> { @Override public PrfSet wrap(PrimitiveSet<PrfSet> set) throws GeneralSecurityException { return new WrappedPrfSet(set); }  @Override PrfSet wrap(PrimitiveSet<PrfSet> set); @Override Class<PrfSet> getPrimitiveClass(); @Override Class<PrfSet> getInputPrimitiveClass(); static void register(); }
PrfSetWrapper implements PrimitiveWrapper<PrfSet, PrfSet> { @Override public PrfSet wrap(PrimitiveSet<PrfSet> set) throws GeneralSecurityException { return new WrappedPrfSet(set); }  @Override PrfSet wrap(PrimitiveSet<PrfSet> set); @Override Class<PrfSet> getPrimitiveClass(); @Override Class<PrfSet> getInputPrimitiveClass(); static void register();  }