aboutsummaryrefslogtreecommitdiff
path: root/java_src/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'java_src/src/main/java/com')
-rw-r--r--java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java8
-rw-r--r--java_src/src/main/java/com/google/crypto/tink/prf/BUILD.bazel6
2 files changed, 14 insertions, 0 deletions
diff --git a/java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java b/java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java
index 12a4e5c5d..dc1439dac 100644
--- a/java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java
+++ b/java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java
@@ -19,6 +19,8 @@ package com.google.crypto.tink.prf;
import com.google.crypto.tink.KeyTemplate;
import com.google.crypto.tink.Registry;
import com.google.crypto.tink.internal.KeyTypeManager;
+import com.google.crypto.tink.internal.MutablePrimitiveRegistry;
+import com.google.crypto.tink.internal.PrimitiveConstructor;
import com.google.crypto.tink.internal.PrimitiveFactory;
import com.google.crypto.tink.proto.AesCmacPrfKey;
import com.google.crypto.tink.proto.AesCmacPrfKeyFormat;
@@ -52,6 +54,10 @@ public final class AesCmacPrfKeyManager extends KeyTypeManager<AesCmacPrfKey> {
private static final int VERSION = 0;
private static final int KEY_SIZE_IN_BYTES = 32;
+ private static final PrimitiveConstructor<com.google.crypto.tink.prf.AesCmacPrfKey, Prf>
+ PRF_PRIMITIVE_CONSTRUCTOR =
+ PrimitiveConstructor.create(
+ PrfAesCmac::create, com.google.crypto.tink.prf.AesCmacPrfKey.class, Prf.class);
@Override
public String getKeyType() {
@@ -131,6 +137,8 @@ public final class AesCmacPrfKeyManager extends KeyTypeManager<AesCmacPrfKey> {
public static void register(boolean newKeyAllowed) throws GeneralSecurityException {
Registry.registerKeyManager(new AesCmacPrfKeyManager(), newKeyAllowed);
AesCmacPrfProtoSerialization.register();
+ MutablePrimitiveRegistry.globalInstance()
+ .registerPrimitiveConstructor(PRF_PRIMITIVE_CONSTRUCTOR);
}
/**
diff --git a/java_src/src/main/java/com/google/crypto/tink/prf/BUILD.bazel b/java_src/src/main/java/com/google/crypto/tink/prf/BUILD.bazel
index 4ba33985f..0bdb2f7b9 100644
--- a/java_src/src/main/java/com/google/crypto/tink/prf/BUILD.bazel
+++ b/java_src/src/main/java/com/google/crypto/tink/prf/BUILD.bazel
@@ -85,6 +85,7 @@ java_library(
name = "aes_cmac_prf_key_manager",
srcs = ["AesCmacPrfKeyManager.java"],
deps = [
+ ":aes_cmac_prf_key",
":aes_cmac_prf_proto_serialization",
":prf_set",
"//proto:aes_cmac_prf_java_proto",
@@ -92,6 +93,8 @@ java_library(
"//src/main/java/com/google/crypto/tink:key_template",
"//src/main/java/com/google/crypto/tink:registry",
"//src/main/java/com/google/crypto/tink/internal:key_type_manager",
+ "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry",
+ "//src/main/java/com/google/crypto/tink/internal:primitive_constructor",
"//src/main/java/com/google/crypto/tink/internal:primitive_factory",
"//src/main/java/com/google/crypto/tink/subtle:prf_aes_cmac",
"//src/main/java/com/google/crypto/tink/subtle:random",
@@ -374,6 +377,7 @@ android_library(
name = "aes_cmac_prf_key_manager-android",
srcs = ["AesCmacPrfKeyManager.java"],
deps = [
+ ":aes_cmac_prf_key-android",
":aes_cmac_prf_proto_serialization-android",
":prf_set-android",
"//proto:aes_cmac_prf_java_proto_lite",
@@ -381,6 +385,8 @@ android_library(
"//src/main/java/com/google/crypto/tink:key_template-android",
"//src/main/java/com/google/crypto/tink:registry-android",
"//src/main/java/com/google/crypto/tink/internal:key_type_manager-android",
+ "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry-android",
+ "//src/main/java/com/google/crypto/tink/internal:primitive_constructor-android",
"//src/main/java/com/google/crypto/tink/internal:primitive_factory-android",
"//src/main/java/com/google/crypto/tink/subtle:prf_aes_cmac-android",
"//src/main/java/com/google/crypto/tink/subtle:random-android",