Sortix
Sortix Download Manual Development Source Code News Blog More
current nightly

Sortix cross-nightly manual

This manual documents Sortix cross-nightly. You can instead view this document in the latest official manual.

NAME

BN_kronecker — Kronecker symbol

SYNOPSIS

#include <openssl/bn.h>
int
BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);

DESCRIPTION

BN_kronecker() computes the Kronecker symbol (a | b), which generalizes the Legendre and Jacobi symbols for arbitrary integer numbers b.

RETURN VALUES

BN_kronecker() returns -1, 0, or 1 in case of success or -2 on error.

SEE ALSO

BN_CTX_new(3), BN_gcd(3), BN_mod_sqrt(3), BN_new(3)
Henri Cohen, A Course in Computational Algebraic Number Theory, Springer, Berlin, 1993, Algorithm 1.4.10.

HISTORY

BN_kronecker() first appeared in OpenSSL 0.9.7 and has been available since OpenBSD 3.2.
Copyright 2011-2025 Jonas 'Sortie' Termansen and contributors.
Sortix's source code is free software under the ISC license.
#sortix on irc.sortix.org
@sortix_org