Lines Matching refs:key

51  * Verify if the given 'key' is correct.
55 g_eli_mkey_verify(const unsigned char *mkey, const unsigned char *key)
62 * The key for HMAC calculations is: hmkey = HMAC_SHA512(Derived-Key, 0)
64 g_eli_crypto_hmac(key, G_ELI_USERKEYLEN, "\x00", 1, hmkey, 0);
76 * If two HMACs are equal, 'key' is correct.
85 g_eli_mkey_hmac(unsigned char *mkey, const unsigned char *key)
91 * The key for HMAC calculations is: hmkey = HMAC_SHA512(Derived-Key, 0)
93 g_eli_crypto_hmac(key, G_ELI_USERKEYLEN, "\x00", 1, hmkey, 0);
104 * Find and decrypt Master Key encrypted with 'key' at slot 'nkey'.
105 * Return 0 on success, > 0 on failure, -1 on bad key.
108 g_eli_mkey_decrypt(const struct g_eli_metadata *md, const unsigned char *key,
120 * The key for encryption is: enckey = HMAC_SHA512(Derived-Key, 1)
122 g_eli_crypto_hmac(key, G_ELI_USERKEYLEN, "\x01", 1, enckey, 0);
136 if (g_eli_mkey_verify(tmpmkey, key)) {
149 * Find and decrypt Master Key encrypted with 'key'.
151 * Return 0 on success, > 0 on failure, -1 on bad key.
155 const unsigned char *key, unsigned char *mkey, unsigned *nkeyp)
164 error = g_eli_mkey_decrypt(md, key, mkey, nkey);
182 g_eli_mkey_encrypt(unsigned algo, const unsigned char *key, unsigned keylen,
189 * To calculate HMAC, the whole key (G_ELI_USERKEYLEN bytes long) will
192 g_eli_mkey_hmac(mkey, key);
194 * The key for encryption is: enckey = HMAC_SHA512(Derived-Key, 1)
196 g_eli_crypto_hmac(key, G_ELI_USERKEYLEN, "\x01", 1, enckey, 0);
198 * Encrypt the Master-Key and HMAC() result with the given key (this
199 * time only 'keylen' bits from the key are used).
210 * When doing encryption only, copy IV key and encryption key.
211 * When doing encryption and authentication, copy IV key, generate encryption
212 * key and generate authentication key.
225 * The authentication key is: akey = HMAC_SHA512(Data-Key, 0x11)
239 * Precalculate SHA256 for HMAC key generation.