Lines Matching defs:nigori
13 // We name a particular Nigori instance (ie. a triplet consisting of a hostname,
17 const char kNigoriKeyName[] = "nigori-key";
30 scoped_ptr<Nigori> nigori(UnpackBootstrapToken(restored_bootstrap_token));
31 if (nigori.get())
32 AddKeyImpl(nigori.release());
91 // Create a bag of all the Nigori parameters we know about.
95 const Nigori& nigori = *it->second;
98 nigori.ExportKeys(key->mutable_user_key(),
103 // Encrypt the bag with the default Nigori.
110 // Create the new Nigori and make it the default encryptor.
111 scoped_ptr<Nigori> nigori(new Nigori);
112 if (!nigori->InitByDerivation(params.hostname,
118 return AddKeyImpl(nigori.release());
121 bool Cryptographer::AddKeyImpl(Nigori* initialized_nigori) {
122 scoped_ptr<Nigori> nigori(initialized_nigori);
124 if (!nigori->Permute(Nigori::Password, kNigoriKeyName, &name)) {
128 nigoris_[name] = make_linked_ptr(nigori.release());
150 Nigori nigori;
151 if (!nigori.InitByDerivation(params.hostname,
159 if (!nigori.Decrypt(pending_keys_->blob(), &plaintext))
180 bool Cryptographer::PackBootstrapToken(const Nigori* nigori,
183 DCHECK(nigori);
186 if (!nigori->ExportKeys(key.mutable_user_key(),
212 Nigori* Cryptographer::UnpackBootstrapToken(const std::string& token) const {
234 scoped_ptr<Nigori> nigori(new Nigori);
235 if (!nigori->InitByImport(key.user_key(), key.encryption_key(),
241 return nigori.release();
251 scoped_ptr<Nigori> new_nigori(new Nigori);