FreeBSD/contrib/ntp/libntp/authkeys.c
/*
 * authencrypt - generate message authenticator
 *
 * Returns length of authenticator field, zero if key not found.
 */
generate message authenticator
Returns length of authenticator field, zero if key not found.
generate message authenticator Returns length of authenticator field zero if key not found .
size_t
authencrypt(
	keyid_t		keyno,
	u_int32 *	pkt,
	size_t		length
	)
{
	authencryptions++;
	pkt[length / 4] = htonl(keyno);
	if (0 == keyno) {
		return 4;
	}
	if (!authhavekey(keyno)) {
		return 0;
	}
	return MD5authencrypt(cache_type, cache_secret, pkt, length);
}
size_t authencrypt ( keyid_t keyno , u_int32 * pkt , size_t length ) { authencryptions ++ ; pkt [ length / 4 ] = htonl ( keyno ) ; if ( 0 == keyno ) { return 4 ; } if ( ! authhavekey ( keyno ) ) { return 0 ; } return MD5authencrypt ( cache_type , cache_secret , pkt , length ) ; }
authencrypt - generate message authenticator
 Returns length of authenticator field, zero if key not found.
authencrypt - generate message authenticator Returns length of authenticator field zero if key not found .
/*
	 * A zero key identifier means the sender has not verified
	 * the last message was correctly authenticated. The MAC
	 * consists of a single word with value zero.
	 */