Home
last modified time | relevance | path

Searched refs:encode (Results 1 – 25 of 67) sorted by relevance

123

/system/security/identity/util/test/java/com/android/security/identity/internal/
DUtilUnitTests.java65 new CborEncoder(baos).encode(new CborBuilder() in prettyPrintMultipleCompleteTypes()
83 new CborEncoder(baos).encode(new UnicodeString("foobar")); in prettyPrintString()
90 new CborEncoder(baos).encode(new ByteString(new byte[]{1, 2, 33, (byte) 254})); in prettyPrintBytestring()
97 new CborEncoder(baos).encode(new UnsignedInteger(42)); in prettyPrintUnsignedInteger()
104 new CborEncoder(baos).encode(new NegativeInteger(-42)); in prettyPrintNegativeInteger()
111 new CborEncoder(baos).encode(new DoublePrecisionFloat(1.1)); in prettyPrintDouble()
115 new CborEncoder(baos).encode(new DoublePrecisionFloat(-42.0000000001)); in prettyPrintDouble()
119 new CborEncoder(baos).encode(new DoublePrecisionFloat(-5)); in prettyPrintDouble()
139 new CborEncoder(baos).encode(new SinglePrecisionFloat(-5f)); in prettyPrintFloat()
146 new CborEncoder(baos).encode(new HalfPrecisionFloat(1.1f)); in prettyPrintHalfFloat()
[all …]
/system/libcppbor/include/cppbor/
Dcppbor.h234 virtual uint8_t* encode(uint8_t* pos, const uint8_t* end) const = 0;
239 virtual void encode(EncodeCallback encodeCallback) const = 0;
251 void encode(OutputIterator i) const { in encode() function
252 return encode([&](uint8_t v) { *i++ = v; }); in encode()
258 std::vector<uint8_t> encode() const { in encode() function
261 encode(std::back_inserter(retval)); in encode()
271 encode([&](uint8_t v) { retval.push_back(v); }); in toString()
308 uint8_t* encode(uint8_t* pos, const uint8_t* end) const override { in encode() function
312 void encode(EncodeCallback encodeCallback) const override { in encode() function
354 using Item::encode;
[all …]
/system/libcppbor/src/
Dcppbor.cpp413 uint8_t* Bstr::encode(uint8_t* pos, const uint8_t* end) const { in encode() function in cppbor::Bstr
425 uint8_t* ViewBstr::encode(uint8_t* pos, const uint8_t* end) const { in encode() function in cppbor::ViewBstr
437 uint8_t* Tstr::encode(uint8_t* pos, const uint8_t* end) const { in encode() function in cppbor::Tstr
449 uint8_t* ViewTstr::encode(uint8_t* pos, const uint8_t* end) const { in encode() function in cppbor::ViewTstr
469 uint8_t* Array::encode(uint8_t* pos, const uint8_t* end) const { in encode() function in cppbor::Array
473 pos = entry->encode(pos, end); in encode()
479 void Array::encode(EncodeCallback encodeCallback) const { in encode() function in cppbor::Array
482 entry->encode(encodeCallback); in encode()
503 uint8_t* Map::encode(uint8_t* pos, const uint8_t* end) const { in encode() function in cppbor::Map
507 pos = entry.first->encode(pos, end); in encode()
[all …]
/system/keymint/tests/src/
Dlib.rs157 assert_eq!(hex::encode(got), test.want, "incorrect HKDF result for case {}", i); in test_hkdf()
336 hex::encode(&mac), in test_hmac()
364 assert_eq!(hex::encode(&cmac[..16]), want); in test_aes_cmac()
380 hex::encode(result), in test_ckdf()
434 assert_eq!(format!("{}{}", test.ct, test.tag), hex::encode(&got_ct)); in test_aes_gcm()
447 assert_eq!(test.msg, hex::encode(&got_pt)); in test_aes_gcm()
462 assert_eq!(test.msg, hex::encode(&got_pt)); in test_aes_gcm()
512 assert_eq!(test.ct, hex::encode(&got_ct)); in test_des()
519 assert_eq!(test.msg, hex::encode(&got_pt)); in test_des()
541 assert_eq!(hex::encode(got), test.want, "for input {}", hex::encode(test.msg)); in test_sha256()
[all …]
/system/libcppbor/tests/
Dcppbor_test.cpp461 EXPECT_EQ(buf.data() + buf.size(), map.encode(buf.data(), buf.data() + buf.size())); in TEST()
463 EXPECT_EQ(buf, map.encode()); in TEST()
466 map.encode(std::back_inserter(buf2)); in TEST()
470 map.encode([&](uint8_t c) { EXPECT_EQ(c, *iter++); }); in TEST()
476 EXPECT_EQ(nullptr, val.encode(buf.data(), buf.data() + buf.size())); in TEST()
482 EXPECT_EQ(nullptr, val.encode(buf.data(), buf.data() + buf.size())); in TEST()
485 EXPECT_EQ(nullptr, val.encode(buf.data(), buf.data() + buf.size())); in TEST()
491 EXPECT_EQ(nullptr, val.encode(buf.data(), buf.data() + buf.size())); in TEST()
494 EXPECT_EQ(nullptr, val.encode(buf.data(), buf.data() + buf.size())); in TEST()
501 EXPECT_EQ(nullptr, val.encode(buf.data(), buf.data() + buf.size())); in TEST()
[all …]
/system/libcppbor/
DREADME.md66 The set of `encode` methods in `Item` provide the interface for
70 and then call one of the `encode` methods, whichever is convenient for
75 std::vector<uint8_t> encoding = val.encode();
87 std::vector<uint8_t> encoding = val.encode();
111 std::vector<uint8_t> encoding = val.encode();
120 #### `encode` methods
122 There are several variations of `Item::encode`, all of which
127 * `bool encode(uint8\_t** pos, const uint8\_t* end)` encodes into the
130 returns false. This is the most efficient way to encode, into an
132 * `void encode(EncodeCallback encodeCallback)` calls `encodeCallback`
[all …]
/system/security/keystore2/src/sw_keyblob/
Dtests.rs368 assert_eq!(hex::encode(got), want, " for input length {input}"); in test_add_der_len()
405 assert_eq!(hex::encode(got), hex::encode(want), " for input {}", hex::encode(input)); in test_pkcs8_wrap_key_p256()
448 assert_eq!(hex::encode(got), hex::encode(want), " for input {}", hex::encode(input)); in test_pkcs8_wrap_key_p521()
/system/keymint/common/src/tag/
Dtests.rs57 assert_eq!(hex::encode(got_data), hex_data); in test_legacy_serialization()
61 assert!(data.is_empty(), "data left: {}", hex::encode(data)); in test_legacy_serialization()
137 assert_eq!(hex::encode(got), want, "mismatch for input IMEI {}", input); in test_increment_imei()
/system/security/identity/util/src/java/com/android/security/identity/internal/
DIso18013.java98 new CborEncoder(daBaos).encode(new CborBuilder() in buildDeviceAuthenticationCbor()
124 new CborEncoder(daBaos).encode(new CborBuilder() in buildReaderAuthenticationBytesCbor()
162 new CborEncoder(baos).encode(new CborBuilder() in buildSessionTranscript()
178 new CborEncoder(baos).encode(new CborBuilder() in buildSessionTranscript()
249 encoder.encode(builder.build()); in createItemsRequest()
DUtil.java103 encoder.encode(dataItem); in canonicalizeCbor()
296 encoder.encode(dataItems); in encodeCbor()
736 new CborEncoder(baos).encode(dataItem); in cborEncode()
942 new CborEncoder(daBaos).encode(new CborBuilder() in buildDeviceAuthenticationCbor()
968 new CborEncoder(daBaos).encode(new CborBuilder() in buildReaderAuthenticationBytesCbor()
993 new CborEncoder(baos).encode(buildCborTaggedByteString(encodedCbor)); in prependSemanticTagForEncodedCbor()
1200 new CborEncoder(baos).encode(new CborBuilder() in buildSessionTranscript()
1216 new CborEncoder(baos).encode(new CborBuilder() in buildSessionTranscript()
1286 encoder.encode(builder.build()); in createItemsRequest()
/system/keymaster/contexts/
Dpure_soft_remote_provisioning_context.cpp149 .add(-4670552 /* Subject Pub Key */, coseKey.encode()) in GenerateBcc()
153 .encode(); in GenerateBcc()
183 return cppbor::Array().add(sign1.moveValue()).add(std::move(bcc)).encode(); in BuildProtectedDataPayload()
218 auto signedDataPayload = cppbor::Array().add(challenge).add(cppbor::Bstr(csrPayload.encode())); in BuildCsr()
219 auto signedData = constructCoseSign1(devicePrivKey_, signedDataPayload.encode(), {} /* aad */); in BuildCsr()
/system/authgraph/wire/src/
Dfragmentation.rs126 let got: Vec<String> = fragmenter.map(hex::encode).collect(); in test_fragmentation()
162 assert_eq!(&hex::encode(got), want, "for input {frags:?}"); in test_reassembly()
181 assert_eq!(&hex::encode(got), input, "for max_size {max_size}"); in test_fragmentation_reassembly()
242 assert_eq!(hex::encode(rsp), req); in test_ta_fragmentation_wrapper()
/system/keymint/tests/src/bin/
Dencrypted-keyblob-parse.rs63 hex::encode(&keyblob.nonce), in process()
65 hex::encode(&keyblob.tag) in process()
/system/keymaster/cppcose/
Dcppcose.cpp241 .add(cppbor::Map().add(ALGORITHM, HMAC_256).canonicalize().encode()) in generateCoseMac0Mac()
244 .encode(); in generateCoseMac0Mac()
260 .add(cppbor::Map().add(ALGORITHM, HMAC_256).canonicalize().encode()) in constructCoseMac0()
311 .encode(); in createECDSACoseSign1Signature()
325 .encode(); in createCoseSign1Signature()
338 bytevec protParms = protectedParams.add(ALGORITHM, ES256).canonicalize().encode(); in constructECDSACoseSign1()
351 bytevec protParms = protectedParams.add(ALGORITHM, EDDSA).canonicalize().encode(); in constructCoseSign1()
403 cppbor::Array().add("Signature1").add(*protectedParams).add(aad).add(*payload).encode(); in verifyAndParseCoseSign1()
465 .encode(), in createCoseEncryptCiphertext()
478 .encode(); in constructCoseEncrypt()
[all …]
/system/extras/verity/fec/tests/
Dfec.py44 def encode(image, fec, roots): function
70 encode(image, temp_fec.name, roots)
/system/chre/apps/test/common/chre_cross_validator_sensor/src/
Dchre_cross_validator_sensor_manager.cc168 .values = {.funcs = {.encode = encodeFunc}, in makeDatapoint()
458 infoResponse.sensorName.funcs.encode = encodeSensorName; in handleInfoMessage()
500 .funcs = {.encode = encodeThreeAxisSensorDatapoints}, in makeSensorThreeAxisData()
520 .funcs = {.encode = encodeFloatSensorDatapoints}, in makeSensorFloatData()
540 .funcs = {.encode = encodeProximitySensorDatapoints}, in makeSensorProximityData()
560 .funcs = {.encode = encodeStepCounterSensorDatapoints}, in makeSensorStepCounterData()
/system/keymaster/android_keymaster/
Dandroid_keymaster.cpp419 std::vector<uint8_t> cosePublicKey = cose_public_key_map.canonicalize().encode(); in GenerateRkpKey()
427 std::vector<uint8_t> enc = macedKey->encode(); in GenerateRkpKey()
472 pubKeysToSign->encode()); in GenerateCsr()
482 std::vector<uint8_t> device_info = device_info_map->encode(); in GenerateCsr()
492 .encode()); in GenerateCsr()
535 std::vector<uint8_t> payload = coseEncrypted->encode(); in GenerateCsr()
577 auto csr_blob = csr->encode(); in GenerateCsrV2()
1049 .encode()); in GetRootOfTrust()
1058 .encode(); in GetRootOfTrust()
/system/keymint/ta/src/
Dcert.rs1068 val.encode(writer) in asn1_val()
1182 .encode(writer)?; in encode_value()
1192 .encode(writer)?; in encode_value()
1257 fn encode(&self, encoder: &mut impl der::Writer) -> der::Result<()> { in encode() method
1260 inner_len.encode(encoder)?; in encode()
1261 self.val.encode(encoder) in encode()
1397 assert_eq!(hex::encode(&got), want); in test_attest_ext_encode_decode()
1404 hex::encode(ExplicitTaggedValue { tag: 2, val: 16 }.to_der().unwrap()), in test_explicit_tagged_value()
1408 hex::encode(ExplicitTaggedValue { tag: 2, val: () }.to_der().unwrap()), in test_explicit_tagged_value()
1412 hex::encode(ExplicitTaggedValue { tag: 503, val: 16 }.to_der().unwrap()), in test_explicit_tagged_value()
[all …]
/system/security/provisioner/
Drkp_factory_extraction_lib_test.cpp246 const DeviceInfo kVerifiedDeviceInfo = {cborDeviceInfo.canonicalize().encode()}; in TEST()
253 const ProtectedData kProtectedData = {cborProtectedData.encode()}; in TEST()
334 .encode(); in TEST()
/system/keymint/common/src/crypto/
Dec.rs582 hex::encode(sig.r.as_bytes()), in test_sig_decode()
586 hex::encode(sig.s.as_bytes()), in test_sig_decode()
610 hex::encode(&cose_sig_data), in test_longer_sig_transmute()
635 hex::encode(&cose_sig_data), in test_short_sig_transmute()
/system/chre/tools/
Dtinysys_nanoapp_signer.py88 password = args.password.encode() if args.password else None
/system/chre/apps/test/common/shared/src/
Dsend_message.cc54 testResult.errorMessage = {.funcs = {.encode = encodeErrorMessage}, in makeTestResultProtoMessage()
/system/tools/mkbootimg/tests/
Dmkbootimg_test.py707 self.assertEqual(raw_cmdline, cmdline.encode() + b'\x00')
709 extra_cmdline.encode() + b'\x00')
735 self.assertEqual(raw_cmdline, cmdline.encode() + b'\x00')
761 vendor_cmdline.encode() + b'\x00')
/system/chre/apps/nearby/third_party/nanopb/
Dpb.h312 bool (*encode)(pb_ostream_t *stream, const pb_field_t *field, member
319 bool (*encode)(pb_ostream_t *stream, const pb_field_t *field,
360 bool (*encode)(pb_ostream_t *stream, const pb_extension_t *extension); member
/system/extras/verity/fec/
Dmain.cpp172 static int encode(image& ctx, const std::vector<std::string>& inp_filenames, in encode() function
403 return encode(ctx, inp_filenames, fec_filename); in main()

123