Searched refs:ptext (Results 1 - 5 of 5) sorted by relevance

/fuchsia/zircon/system/utest/crypto/
H A Dcipher.cpp152 Bytes iv, ptext; local
154 ASSERT_OK(ptext.Randomize(len));
159 EXPECT_ZX(encrypt.Encrypt(ptext.get(), len, ctext), ZX_ERR_BAD_STATE);
163 EXPECT_OK(encrypt.Encrypt(ptext.get(), 0, ctext));
167 EXPECT_ZX(encrypt.Encrypt(ptext.get(), len, nullptr), ZX_ERR_INVALID_ARGS);
170 EXPECT_ZX(encrypt.Decrypt(ptext.get(), len, ctext), ZX_ERR_BAD_STATE);
173 EXPECT_OK(encrypt.Encrypt(ptext.get(), len, ctext));
177 EXPECT_ZX(encrypt.Encrypt(ptext.get(), len, ctext), ZX_ERR_BAD_STATE);
187 Bytes iv, ptext; local
189 ASSERT_OK(ptext
225 Bytes iv, ptext; local
290 Bytes iv, ptext; local
358 Bytes iv, ctext, ptext; local
[all...]
H A Daead.cpp142 Bytes iv, ptext, ctext; local
145 ASSERT_OK(ptext.Randomize(PAGE_SIZE));
148 EXPECT_ZX(sealer.Seal(ptext, &nonce, &ctext), ZX_ERR_BAD_STATE);
152 EXPECT_ZX(sealer.Seal(ptext, nullptr, &ctext), ZX_ERR_INVALID_ARGS);
153 EXPECT_ZX(sealer.Seal(ptext, &nonce, nullptr), ZX_ERR_INVALID_ARGS);
156 EXPECT_ZX(sealer.Open(nonce, ctext, &ptext), ZX_ERR_BAD_STATE);
159 EXPECT_OK(sealer.Seal(ptext, &nonce, &ctext));
160 ASSERT_OK(ptext.Resize(0));
161 EXPECT_OK(sealer.Seal(ptext, &nonce, &ctext));
165 EXPECT_ZX(sealer.Seal(ptext,
173 Bytes iv, ptext, ctext, result; local
237 Bytes ptext, aad, iv, ctext, tag, result; local
478 Bytes ptext, aad, iv, ctext, tag, result; local
[all...]
/fuchsia/zircon/system/ulib/crypto/include/crypto/
H A Daead.h57 // Encrypts data from |ptext| to |ctext|, based on the parameters set in |InitSeal|. Saves the
61 zx_status_t Seal(const Bytes& ptext, uint64_t* out_nonce, Bytes* out_ctext) { argument
62 return Seal(ptext, nullptr, 0, out_nonce, out_ctext);
64 zx_status_t Seal(const Bytes& ptext, const Bytes& aad, uint64_t* out_nonce, Bytes* out_ctext) { argument
65 return Seal(ptext, aad.get(), aad.len(), out_nonce, out_ctext);
68 // Decrypts data from |ctext| to |ptext|, based on the parameters set in |InitOpen|.
89 zx_status_t Seal(const Bytes& ptext, const uint8_t* aad, size_t aad_len, uint64_t* out_nonce,
/fuchsia/zircon/system/ulib/crypto/
H A Daead.cpp114 zx_status_t AEAD::Seal(const Bytes& ptext, const uint8_t* aad, size_t aad_len, uint64_t* out_nonce, argument
124 size_t ptext_len = ptext.len();
139 ptext.get(), ptext_len, aad, aad_len) != 1) {
170 xprintf("bad parameter(s): ctext.len=%zu, ptext=%p\n", ctext_len, out_ptext);
/fuchsia/zircon/system/ulib/zxcrypt/
H A Dvolume.cpp599 crypto::Bytes ptext, ctext; local
603 if ((rc = ptext.Copy(data_key_.get(), data_key_.len(), data_key_off)) != ZX_OK ||
604 (rc = ptext.Copy(data_iv_.get(), data_iv_.len(), data_iv_off)) != ZX_OK ||
607 (rc = aead.Seal(ptext, header_, &nonce, &ctext)) != ZX_OK) {
674 crypto::Bytes ptext, ctext, data_key; local
690 (rc = aead.Open(nonce, ctext, header_, &ptext)) != ZX_OK ||
691 (rc = data_iv_.Copy(ptext.get() + iv_off, iv_len)) != ZX_OK) {
694 memcpy(key_buf, ptext.get() + key_off, key_len);

Completed in 33 milliseconds