/packages/modules/AdServices/adservices/tests/unittest/service-core/src/jni/java/com/android/adservices/ohttp/ |
D | ObliviousHttpKeyConfigTest.java | 50 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in create_configuresKeyCorrectly() local 52 Assert.assertEquals(keyConfig.keyId(), 0X01); in create_configuresKeyCorrectly() 53 Assert.assertEquals(keyConfig.kemId(), 0X0020); in create_configuresKeyCorrectly() 54 String publicKeyHex = BaseEncoding.base16().lowerCase().encode(keyConfig.getPublicKey()); in create_configuresKeyCorrectly() 57 Assert.assertEquals(keyConfig.kdfId(), 0X0001); in create_configuresKeyCorrectly() 58 Assert.assertEquals(keyConfig.aeadId(), 0X0001); in create_configuresKeyCorrectly() 132 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in serializeOhttpPayloadHeader_returnsCorrectHeader() local 133 byte[] ohttpPayloadHeader = keyConfig.serializeOhttpPayloadHeader(); in serializeOhttpPayloadHeader_returnsCorrectHeader() 148 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in createRecipientKeyInfoBytes_returnsCorrectInfo() local 149 RecipientKeyInfo response = keyConfig.createRecipientKeyInfo(hasMediaTypeChanged); in createRecipientKeyInfoBytes_returnsCorrectInfo() [all …]
|
D | ObliviousHttpClientTest.java | 55 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in create_unsupportedAlgorithms_throwsError() local 59 () -> ObliviousHttpClient.create(keyConfig)); in create_unsupportedAlgorithms_throwsError() 66 ObliviousHttpClient actualClient = ObliviousHttpClient.create(testVector.keyConfig); in create_supportedAlgorithms_clientCreatedSuccessfully() 74 ObliviousHttpClient actualClient = ObliviousHttpClient.create(testVector.keyConfig); in create_supportedAlgorithms_kemIdSetCorrectly() 77 testVector.keyConfig.kemId()); in create_supportedAlgorithms_kemIdSetCorrectly() 84 ObliviousHttpClient actualClient = ObliviousHttpClient.create(testVector.keyConfig); in create_supportedAlgorithms_kdfIdSetCorrectly() 87 testVector.keyConfig.kdfId()); in create_supportedAlgorithms_kdfIdSetCorrectly() 94 ObliviousHttpClient actualClient = ObliviousHttpClient.create(testVector.keyConfig); in create_supportedAlgorithms_aeadIdSetCorrectly() 97 testVector.keyConfig.aeadId()); in create_supportedAlgorithms_aeadIdSetCorrectly() 107 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in createObliviousHttpRequest_testAllTestVectors() [all …]
|
D | ObliviousHttpGatewayTest.java | 56 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in decrypt_canDecryptPayloadsEncryptedByOhttpClient() 82 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in decrypt_canDecryptPayloadsEncryptedByOhttpClient_withServerAuctionMediaTypeChange() 107 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in encrypt_canBeDecryptedByOhttpClient() 139 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in encrypt_canBeDecryptedByOhttpClient_withServerAuctionMediaTypeChange() 168 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in encrypt_missingInfo_throwsError() 191 ObliviousHttpClient client = ObliviousHttpClient.create(testVector.keyConfig); in encrypt_missingInfo_throwsError_withServerAuctionMediaTypeChange()
|
D | ObliviousHttpRequestTest.java | 52 ObliviousHttpKeyConfig keyConfig = in serialize_serializesCorrectly() local 60 keyConfig, in serialize_serializesCorrectly()
|
/packages/modules/AdServices/adservices/service-core/jni/java/com/android/adservices/ohttp/ |
D | ObliviousHttpKeyConfig.java | 123 public static ObliviousHttpKeyConfig fromSerializedKeyConfig(byte[] keyConfig) in fromSerializedKeyConfig() argument 129 int keyId = writeUptoTwoBytesIntoInteger(keyConfig, currentIndex, sKeyIdSizeInBytes); in fromSerializedKeyConfig() 132 int kemId = writeUptoTwoBytesIntoInteger(keyConfig, currentIndex, sKemIdSizeInBytes); in fromSerializedKeyConfig() 137 Arrays.copyOfRange(keyConfig, currentIndex, currentIndex + publicKeyLength); in fromSerializedKeyConfig() 142 keyConfig, currentIndex, sSymmetricAlgorithmsLengthInBytes); in fromSerializedKeyConfig() 145 if (currentIndex + algorithmsLength != keyConfig.length) { in fromSerializedKeyConfig() 151 int kdfId = writeUptoTwoBytesIntoInteger(keyConfig, currentIndex, sKdfIdSizeInBytes); in fromSerializedKeyConfig() 154 int aeadId = writeUptoTwoBytesIntoInteger(keyConfig, currentIndex, sAeadIdSizeInBytes); in fromSerializedKeyConfig() 299 byte[] keyConfig, int startingIndex, int numberOfBytes) throws InvalidKeySpecException { in writeUptoTwoBytesIntoInteger() argument 303 if (startingIndex + numberOfBytes > keyConfig.length) { in writeUptoTwoBytesIntoInteger() [all …]
|
D | ObliviousHttpRequestContext.java | 32 public abstract ObliviousHttpKeyConfig keyConfig(); in keyConfig() method in ObliviousHttpRequestContext 45 ObliviousHttpKeyConfig keyConfig, in create() argument 49 return new AutoValue_ObliviousHttpRequestContext(keyConfig, enc, seed, hasMediaTypeChanged); in create()
|
D | ObliviousHttpClient.java | 52 private ObliviousHttpClient(ObliviousHttpKeyConfig keyConfig, HpkeAlgorithmSpec algorithmSpec) { in ObliviousHttpClient() argument 53 mObliviousHttpKeyConfig = keyConfig; in ObliviousHttpClient() 63 public static ObliviousHttpClient create(ObliviousHttpKeyConfig keyConfig) in create() argument 65 HpkeAlgorithmSpec hpkeAlgorithmSpec = HpkeAlgorithmSpec.fromKeyConfig(keyConfig); in create() 66 return new ObliviousHttpClient(keyConfig, hpkeAlgorithmSpec); in create()
|
D | ObliviousHttpRequest.java | 65 outputStream.write(requestContext().keyConfig().serializeOhttpPayloadHeader()); in serialize()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/jni/java/com/android/adservices/ohttp/algorithms/ |
D | HpkeAlgorithmSpecTest.java | 37 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in fromKeyConfig_createsHpkeAlgorithmSpec() local 39 HpkeAlgorithmSpec hpkeAlgorithmSpec = HpkeAlgorithmSpec.fromKeyConfig(keyConfig); in fromKeyConfig_createsHpkeAlgorithmSpec() 52 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in fromKeyConfig_unsupportedKdf_throwsError() local 56 () -> HpkeAlgorithmSpec.fromKeyConfig(keyConfig)); in fromKeyConfig_unsupportedKdf_throwsError() 65 ObliviousHttpKeyConfig keyConfig = ObliviousHttpKeyConfig.fromSerializedKeyConfig(bytes); in fromKeyConfig_unsupportedAead_throwsError() local 69 () -> HpkeAlgorithmSpec.fromKeyConfig(keyConfig)); in fromKeyConfig_unsupportedAead_throwsError()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/adselection/encryption/ |
D | JoinEncryptionKeyParserTest.java | 156 ObliviousHttpKeyConfig keyConfig = mJoinEncryptionKeyParser.getObliviousHttpKeyConfig(key); in getObliviousHttpKeyConfig_returnsKeyConfig() local 157 assertThat(keyConfig.keyId()).isEqualTo(0x01); in getObliviousHttpKeyConfig_returnsKeyConfig() 158 assertThat(BaseEncoding.base16().lowerCase().encode(keyConfig.getPublicKey())) in getObliviousHttpKeyConfig_returnsKeyConfig() 160 assertThat(keyConfig.kemId()).isEqualTo(0x0020); in getObliviousHttpKeyConfig_returnsKeyConfig() 161 assertThat(keyConfig.kdfId()).isEqualTo(0x0001); in getObliviousHttpKeyConfig_returnsKeyConfig() 162 assertThat(keyConfig.aeadId()).isEqualTo(0x0001); in getObliviousHttpKeyConfig_returnsKeyConfig()
|
D | AuctionEncryptionKeyParserTest.java | 188 ObliviousHttpKeyConfig keyConfig = in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly() local 190 assertThat(keyConfig.keyId()).isEqualTo(52); in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly() 191 assertThat(keyConfig.getPublicKey()).isEqualTo(keyContent); in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly() 192 assertThat(keyConfig.kemId()).isEqualTo(0x0005); in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly() 193 assertThat(keyConfig.kdfId()).isEqualTo(0x0002); in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly() 194 assertThat(keyConfig.aeadId()).isEqualTo(0x0022); in getObliviousHttpKeyConfig_convertsKmsKeyIdToOhttpKeyIdCorrectly()
|
D | ObliviousHttpRequestContextMarshallerTest.java | 153 assertThat(expectedOhttpContext.keyConfig()) in test_getContext_success()
|
/packages/modules/AdServices/adservices/tests/unittest/fixtures/java/com/android/adservices/ohttp/ |
D | ObliviousHttpTestFixtures.java | 163 public ObliviousHttpKeyConfig keyConfig; field in ObliviousHttpTestFixtures.OhttpTestVector 173 ObliviousHttpKeyConfig keyConfig) { in OhttpTestVector() argument 181 this.keyConfig = keyConfig; in OhttpTestVector()
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/data/adselection/ |
D | DBEncryptionContext.java | 93 byte[] keyConfig, in create() argument 101 .setKeyConfig(keyConfig) in create() 120 public abstract Builder setKeyConfig(byte[] keyConfig); in setKeyConfig() argument
|
D | EncryptionContextDao.java | 72 .setKeyConfig(requestContext.keyConfig().serializeKeyConfigToBytes()) in persistEncryptionContext()
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/adselection/encryption/ |
D | ObliviousHttpRequestContextMarshaller.java | 77 Objects.requireNonNull(requestContext.keyConfig()); in insertAuctionEncryptionContext() 78 Objects.requireNonNull(requestContext.keyConfig().serializeKeyConfigToBytes()); in insertAuctionEncryptionContext() 88 .setKeyConfig(requestContext.keyConfig().serializeKeyConfigToBytes()) in insertAuctionEncryptionContext()
|
D | KAnonObliviousHttpEncryptorImpl.java | 80 ObliviousHttpClient.create(mObliviousRequestContext.keyConfig()); in decryptBytes()
|
D | ObliviousHttpEncryptorImpl.java | 96 ObliviousHttpClient client = ObliviousHttpClient.create(context.keyConfig()); in decryptBytes()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/data/adselection/ |
D | DBEncryptionContextTest.java | 54 ObliviousHttpKeyConfig keyConfig = in testBuildEncryptionContext_success() local 62 .setKeyConfig(keyConfig.serializeKeyConfigToBytes()) in testBuildEncryptionContext_success()
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/data/adselection/datahandlers/ |
D | DBValidator.java | 32 Objects.requireNonNull(requestContext.keyConfig().serializeKeyConfigToBytes()); in validateEncryptionContext()
|
/packages/modules/AdServices/adservices/tests/unittest/fixtures/java/android/adservices/adselection/ |
D | ObliviousHttpEncryptorWithSeedImpl.java | 97 ObliviousHttpClient client = ObliviousHttpClient.create(context.keyConfig()); in decryptBytes()
|