1898 {
1899 int i;
1900 for (i = 0; i < 128 *
count; i++) {
1902 }
1903 for (i = 0; i <
count; i++) {
1905 }
1906
1907 {
1908
1910 secp256k1_scalar_set_int(&
s, 1);
1911 CHECK(secp256k1_scalar_is_one(&
s));
1912 secp256k1_scalar_negate(&o, &
s);
1913 secp256k1_scalar_add(&o, &o, &
s);
1914 CHECK(secp256k1_scalar_is_zero(&o));
1915 secp256k1_scalar_negate(&o, &o);
1916 CHECK(secp256k1_scalar_is_zero(&o));
1917 }
1918
1919 {
1920
1922 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL,
1923 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL
1924 );
1925 CHECK(secp256k1_scalar_check_overflow(&overflowed));
1926 }
1927
1928 {
1929
1930
1931
1932
1933
1943 unsigned char chal[33][2][32] = {
1944 {{0xff, 0xff, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00,
1945 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
1946 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
1947 0xff, 0xff, 0x03, 0x00, 0xc0, 0xff, 0xff, 0xff},
1948 {0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00,
1949 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,
1950 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1951 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff}},
1952 {{0xef, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
1953 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
1954 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1955 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
1956 {0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
1957 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
1958 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff,
1959 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x80, 0xff}},
1960 {{0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
1961 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
1962 0x80, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00,
1963 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x00},
1964 {0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x80,
1965 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xe0,
1966 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00,
1967 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff}},
1968 {{0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
1969 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,
1970 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
1971 0x00, 0x1e, 0xf8, 0xff, 0xff, 0xff, 0xfd, 0xff},
1972 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
1973 0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0xe0,
1974 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,
1975 0xf3, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00}},
1976 {{0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x00,
1977 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
1978 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0x00,
1979 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff},
1980 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
1981 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1982 0xff, 0x1f, 0x00, 0x00, 0x80, 0xff, 0xff, 0x3f,
1983 0x00, 0xfe, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff}},
1984 {{0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xfc, 0x9f,
1985 0xff, 0xff, 0xff, 0x00, 0x80, 0x00, 0x00, 0x80,
1986 0xff, 0x0f, 0xfc, 0xff, 0x7f, 0x00, 0x00, 0x00,
1987 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},
1988 {0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
1989 0x00, 0x00, 0xf8, 0xff, 0x0f, 0xc0, 0xff, 0xff,
1990 0xff, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,
1991 0xff, 0xff, 0xff, 0x07, 0x80, 0xff, 0xff, 0xff}},
1992 {{0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,
1993 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
1994 0xf7, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0x00,
1995 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0},
1996 {0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff,
1997 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
1998 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,
1999 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}},
2000 {{0x00, 0xf8, 0xff, 0x03, 0xff, 0xff, 0xff, 0x00,
2001 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
2002 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
2003 0xff, 0xff, 0x03, 0xc0, 0xff, 0x0f, 0xfc, 0xff},
2004 {0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff,
2005 0xff, 0x01, 0x00, 0x00, 0x00, 0x3f, 0x00, 0xc0,
2006 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2007 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}},
2008 {{0x8f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2009 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,
2010 0xff, 0x7f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,
2011 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},
2012 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2013 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2014 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2015 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},
2016 {{0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff,
2017 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2018 0xff, 0xff, 0x03, 0x00, 0x80, 0x00, 0x00, 0x80,
2019 0xff, 0xff, 0xff, 0x00, 0x00, 0x80, 0xff, 0x7f},
2020 {0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
2021 0x00, 0xc0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff,
2022 0xbf, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00,
2023 0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00}},
2024 {{0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff,
2025 0xff, 0xff, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff,
2026 0xff, 0xff, 0xff, 0x00, 0x80, 0x00, 0x00, 0x80,
2027 0xff, 0x01, 0xfc, 0xff, 0x01, 0x00, 0xfe, 0xff},
2028 {0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
2029 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2030 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
2031 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00}},
2032 {{0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
2033 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2034 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2035 0x7f, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80},
2036 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2037 0x00, 0xf8, 0xff, 0x01, 0x00, 0xf0, 0xff, 0xff,
2038 0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
2039 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},
2040 {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2041 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2042 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2043 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x00},
2044 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
2045 0xfc, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0x3f,
2046 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0xff,
2047 0xff, 0xff, 0xff, 0xff, 0x0f, 0x7e, 0x00, 0x00}},
2048 {{0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
2049 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,
2050 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2051 0xff, 0xff, 0x1f, 0x00, 0x00, 0xfe, 0x07, 0x00},
2052 {0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff,
2053 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2054 0xff, 0xfb, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
2055 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60}},
2056 {{0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00,
2057 0x80, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x03,
2058 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2059 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
2060 {0xff, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0xff, 0xff,
2061 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2062 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2063 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00}},
2064 {{0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
2065 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2066 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2067 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
2068 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2069 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff,
2070 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,
2071 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff}},
2072 {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
2073 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2074 0xc0, 0xff, 0xff, 0xcf, 0xff, 0x1f, 0x00, 0x00,
2075 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80},
2076 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2077 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff,
2078 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x7e,
2079 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},
2080 {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2081 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff,
2082 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
2083 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00},
2084 {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
2085 0xff, 0xff, 0x7f, 0x00, 0x80, 0x00, 0x00, 0x00,
2086 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
2087 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff}},
2088 {{0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x80,
2089 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
2090 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
2091 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},
2092 {0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2093 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x80,
2094 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
2095 0xff, 0x7f, 0xf8, 0xff, 0xff, 0x1f, 0x00, 0xfe}},
2096 {{0xff, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0xff,
2097 0xff, 0x03, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00,
2098 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2099 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07},
2100 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
2101 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
2102 0xff, 0xff, 0xff, 0xff, 0x01, 0x80, 0xff, 0xff,
2103 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00}},
2104 {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2105 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2106 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2107 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
2108 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2109 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
2110 0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,
2111 0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x40}},
2112 {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2113 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2114 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2115 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
2116 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2117 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2118 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2119 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},
2120 {{0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2121 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2122 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2123 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
2124 {0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2125 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2126 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2127 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}},
2128 {{0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xc0,
2129 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2130 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
2131 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f},
2132 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
2133 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,
2134 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,
2135 0xff, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff}},
2136 {{0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2137 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2138 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2139 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
2140 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2141 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2142 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2143 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}},
2144 {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2145 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
2146 0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,
2147 0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x40},
2148 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2149 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2150 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2151 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}},
2152 {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2153 0x7e, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00,
2154 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
2155 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
2156 {0xff, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff,
2157 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x80,
2158 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00,
2159 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}},
2160 {{0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00,
2161 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
2162 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01,
2163 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff},
2164 {0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff,
2165 0xff, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0xff, 0xff,
2166 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2167 0xff, 0x3f, 0x00, 0x00, 0xc0, 0xf1, 0x7f, 0x00}},
2168 {{0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
2169 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff,
2170 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
2171 0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x00},
2172 {0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01,
2173 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
2174 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f,
2175 0x00, 0x00, 0xfc, 0xff, 0xff, 0x01, 0xff, 0xff}},
2176 {{0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
2177 0x80, 0x00, 0x00, 0x80, 0xff, 0x03, 0xe0, 0x01,
2178 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xfc, 0xff,
2179 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},
2180 {0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
2181 0xfe, 0xff, 0xff, 0xf0, 0x07, 0x00, 0x3c, 0x80,
2182 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff,
2183 0xff, 0xff, 0x07, 0xe0, 0xff, 0x00, 0x00, 0x00}},
2184 {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
2185 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2186 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf8,
2187 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80},
2188 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2189 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x80, 0x00,
2190 0x00, 0x00, 0x00, 0xc0, 0x7f, 0xfe, 0xff, 0x1f,
2191 0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0xfe, 0xff}},
2192 {{0xff, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 0x00,
2193 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83,
2194 0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,
2195 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xf0},
2196 {0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
2197 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00,
2198 0xf8, 0x07, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,
2199 0xff, 0xc7, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff}},
2200 {{0x82, 0xc9, 0xfa, 0xb0, 0x68, 0x04, 0xa0, 0x00,
2201 0x82, 0xc9, 0xfa, 0xb0, 0x68, 0x04, 0xa0, 0x00,
2202 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x03, 0xfb,
2203 0xfa, 0x8a, 0x7d, 0xdf, 0x13, 0x86, 0xe2, 0x03},
2204 {0x82, 0xc9, 0xfa, 0xb0, 0x68, 0x04, 0xa0, 0x00,
2205 0x82, 0xc9, 0xfa, 0xb0, 0x68, 0x04, 0xa0, 0x00,
2206 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x03, 0xfb,
2207 0xfa, 0x8a, 0x7d, 0xdf, 0x13, 0x86, 0xe2, 0x03}}
2208 };
2209 unsigned char res[33][2][32] = {
2210 {{0x0c, 0x3b, 0x0a, 0xca, 0x8d, 0x1a, 0x2f, 0xb9,
2211 0x8a, 0x7b, 0x53, 0x5a, 0x1f, 0xc5, 0x22, 0xa1,
2212 0x07, 0x2a, 0x48, 0xea, 0x02, 0xeb, 0xb3, 0xd6,
2213 0x20, 0x1e, 0x86, 0xd0, 0x95, 0xf6, 0x92, 0x35},
2214 {0xdc, 0x90, 0x7a, 0x07, 0x2e, 0x1e, 0x44, 0x6d,
2215 0xf8, 0x15, 0x24, 0x5b, 0x5a, 0x96, 0x37, 0x9c,
2216 0x37, 0x7b, 0x0d, 0xac, 0x1b, 0x65, 0x58, 0x49,
2217 0x43, 0xb7, 0x31, 0xbb, 0xa7, 0xf4, 0x97, 0x15}},
2218 {{0xf1, 0xf7, 0x3a, 0x50, 0xe6, 0x10, 0xba, 0x22,
2219 0x43, 0x4d, 0x1f, 0x1f, 0x7c, 0x27, 0xca, 0x9c,
2220 0xb8, 0xb6, 0xa0, 0xfc, 0xd8, 0xc0, 0x05, 0x2f,
2221 0xf7, 0x08, 0xe1, 0x76, 0xdd, 0xd0, 0x80, 0xc8},
2222 {0xe3, 0x80, 0x80, 0xb8, 0xdb, 0xe3, 0xa9, 0x77,
2223 0x00, 0xb0, 0xf5, 0x2e, 0x27, 0xe2, 0x68, 0xc4,
2224 0x88, 0xe8, 0x04, 0xc1, 0x12, 0xbf, 0x78, 0x59,
2225 0xe6, 0xa9, 0x7c, 0xe1, 0x81, 0xdd, 0xb9, 0xd5}},
2226 {{0x96, 0xe2, 0xee, 0x01, 0xa6, 0x80, 0x31, 0xef,
2227 0x5c, 0xd0, 0x19, 0xb4, 0x7d, 0x5f, 0x79, 0xab,
2228 0xa1, 0x97, 0xd3, 0x7e, 0x33, 0xbb, 0x86, 0x55,
2229 0x60, 0x20, 0x10, 0x0d, 0x94, 0x2d, 0x11, 0x7c},
2230 {0xcc, 0xab, 0xe0, 0xe8, 0x98, 0x65, 0x12, 0x96,
2231 0x38, 0x5a, 0x1a, 0xf2, 0x85, 0x23, 0x59, 0x5f,
2232 0xf9, 0xf3, 0xc2, 0x81, 0x70, 0x92, 0x65, 0x12,
2233 0x9c, 0x65, 0x1e, 0x96, 0x00, 0xef, 0xe7, 0x63}},
2234 {{0xac, 0x1e, 0x62, 0xc2, 0x59, 0xfc, 0x4e, 0x5c,
2235 0x83, 0xb0, 0xd0, 0x6f, 0xce, 0x19, 0xf6, 0xbf,
2236 0xa4, 0xb0, 0xe0, 0x53, 0x66, 0x1f, 0xbf, 0xc9,
2237 0x33, 0x47, 0x37, 0xa9, 0x3d, 0x5d, 0xb0, 0x48},
2238 {0x86, 0xb9, 0x2a, 0x7f, 0x8e, 0xa8, 0x60, 0x42,
2239 0x26, 0x6d, 0x6e, 0x1c, 0xa2, 0xec, 0xe0, 0xe5,
2240 0x3e, 0x0a, 0x33, 0xbb, 0x61, 0x4c, 0x9f, 0x3c,
2241 0xd1, 0xdf, 0x49, 0x33, 0xcd, 0x72, 0x78, 0x18}},
2242 {{0xf7, 0xd3, 0xcd, 0x49, 0x5c, 0x13, 0x22, 0xfb,
2243 0x2e, 0xb2, 0x2f, 0x27, 0xf5, 0x8a, 0x5d, 0x74,
2244 0xc1, 0x58, 0xc5, 0xc2, 0x2d, 0x9f, 0x52, 0xc6,
2245 0x63, 0x9f, 0xba, 0x05, 0x76, 0x45, 0x7a, 0x63},
2246 {0x8a, 0xfa, 0x55, 0x4d, 0xdd, 0xa3, 0xb2, 0xc3,
2247 0x44, 0xfd, 0xec, 0x72, 0xde, 0xef, 0xc0, 0x99,
2248 0xf5, 0x9f, 0xe2, 0x52, 0xb4, 0x05, 0x32, 0x58,
2249 0x57, 0xc1, 0x8f, 0xea, 0xc3, 0x24, 0x5b, 0x94}},
2250 {{0x05, 0x83, 0xee, 0xdd, 0x64, 0xf0, 0x14, 0x3b,
2251 0xa0, 0x14, 0x4a, 0x3a, 0x41, 0x82, 0x7c, 0xa7,
2252 0x2c, 0xaa, 0xb1, 0x76, 0xbb, 0x59, 0x64, 0x5f,
2253 0x52, 0xad, 0x25, 0x29, 0x9d, 0x8f, 0x0b, 0xb0},
2254 {0x7e, 0xe3, 0x7c, 0xca, 0xcd, 0x4f, 0xb0, 0x6d,
2255 0x7a, 0xb2, 0x3e, 0xa0, 0x08, 0xb9, 0xa8, 0x2d,
2256 0xc2, 0xf4, 0x99, 0x66, 0xcc, 0xac, 0xd8, 0xb9,
2257 0x72, 0x2a, 0x4a, 0x3e, 0x0f, 0x7b, 0xbf, 0xf4}},
2258 {{0x8c, 0x9c, 0x78, 0x2b, 0x39, 0x61, 0x7e, 0xf7,
2259 0x65, 0x37, 0x66, 0x09, 0x38, 0xb9, 0x6f, 0x70,
2260 0x78, 0x87, 0xff, 0xcf, 0x93, 0xca, 0x85, 0x06,
2261 0x44, 0x84, 0xa7, 0xfe, 0xd3, 0xa4, 0xe3, 0x7e},
2262 {0xa2, 0x56, 0x49, 0x23, 0x54, 0xa5, 0x50, 0xe9,
2263 0x5f, 0xf0, 0x4d, 0xe7, 0xdc, 0x38, 0x32, 0x79,
2264 0x4f, 0x1c, 0xb7, 0xe4, 0xbb, 0xf8, 0xbb, 0x2e,
2265 0x40, 0x41, 0x4b, 0xcc, 0xe3, 0x1e, 0x16, 0x36}},
2266 {{0x0c, 0x1e, 0xd7, 0x09, 0x25, 0x40, 0x97, 0xcb,
2267 0x5c, 0x46, 0xa8, 0xda, 0xef, 0x25, 0xd5, 0xe5,
2268 0x92, 0x4d, 0xcf, 0xa3, 0xc4, 0x5d, 0x35, 0x4a,
2269 0xe4, 0x61, 0x92, 0xf3, 0xbf, 0x0e, 0xcd, 0xbe},
2270 {0xe4, 0xaf, 0x0a, 0xb3, 0x30, 0x8b, 0x9b, 0x48,
2271 0x49, 0x43, 0xc7, 0x64, 0x60, 0x4a, 0x2b, 0x9e,
2272 0x95, 0x5f, 0x56, 0xe8, 0x35, 0xdc, 0xeb, 0xdc,
2273 0xc7, 0xc4, 0xfe, 0x30, 0x40, 0xc7, 0xbf, 0xa4}},
2274 {{0xd4, 0xa0, 0xf5, 0x81, 0x49, 0x6b, 0xb6, 0x8b,
2275 0x0a, 0x69, 0xf9, 0xfe, 0xa8, 0x32, 0xe5, 0xe0,
2276 0xa5, 0xcd, 0x02, 0x53, 0xf9, 0x2c, 0xe3, 0x53,
2277 0x83, 0x36, 0xc6, 0x02, 0xb5, 0xeb, 0x64, 0xb8},
2278 {0x1d, 0x42, 0xb9, 0xf9, 0xe9, 0xe3, 0x93, 0x2c,
2279 0x4c, 0xee, 0x6c, 0x5a, 0x47, 0x9e, 0x62, 0x01,
2280 0x6b, 0x04, 0xfe, 0xa4, 0x30, 0x2b, 0x0d, 0x4f,
2281 0x71, 0x10, 0xd3, 0x55, 0xca, 0xf3, 0x5e, 0x80}},
2282 {{0x77, 0x05, 0xf6, 0x0c, 0x15, 0x9b, 0x45, 0xe7,
2283 0xb9, 0x11, 0xb8, 0xf5, 0xd6, 0xda, 0x73, 0x0c,
2284 0xda, 0x92, 0xea, 0xd0, 0x9d, 0xd0, 0x18, 0x92,
2285 0xce, 0x9a, 0xaa, 0xee, 0x0f, 0xef, 0xde, 0x30},
2286 {0xf1, 0xf1, 0xd6, 0x9b, 0x51, 0xd7, 0x77, 0x62,
2287 0x52, 0x10, 0xb8, 0x7a, 0x84, 0x9d, 0x15, 0x4e,
2288 0x07, 0xdc, 0x1e, 0x75, 0x0d, 0x0c, 0x3b, 0xdb,
2289 0x74, 0x58, 0x62, 0x02, 0x90, 0x54, 0x8b, 0x43}},
2290 {{0xa6, 0xfe, 0x0b, 0x87, 0x80, 0x43, 0x67, 0x25,
2291 0x57, 0x5d, 0xec, 0x40, 0x50, 0x08, 0xd5, 0x5d,
2292 0x43, 0xd7, 0xe0, 0xaa, 0xe0, 0x13, 0xb6, 0xb0,
2293 0xc0, 0xd4, 0xe5, 0x0d, 0x45, 0x83, 0xd6, 0x13},
2294 {0x40, 0x45, 0x0a, 0x92, 0x31, 0xea, 0x8c, 0x60,
2295 0x8c, 0x1f, 0xd8, 0x76, 0x45, 0xb9, 0x29, 0x00,
2296 0x26, 0x32, 0xd8, 0xa6, 0x96, 0x88, 0xe2, 0xc4,
2297 0x8b, 0xdb, 0x7f, 0x17, 0x87, 0xcc, 0xc8, 0xf2}},
2298 {{0xc2, 0x56, 0xe2, 0xb6, 0x1a, 0x81, 0xe7, 0x31,
2299 0x63, 0x2e, 0xbb, 0x0d, 0x2f, 0x81, 0x67, 0xd4,
2300 0x22, 0xe2, 0x38, 0x02, 0x25, 0x97, 0xc7, 0x88,
2301 0x6e, 0xdf, 0xbe, 0x2a, 0xa5, 0x73, 0x63, 0xaa},
2302 {0x50, 0x45, 0xe2, 0xc3, 0xbd, 0x89, 0xfc, 0x57,
2303 0xbd, 0x3c, 0xa3, 0x98, 0x7e, 0x7f, 0x36, 0x38,
2304 0x92, 0x39, 0x1f, 0x0f, 0x81, 0x1a, 0x06, 0x51,
2305 0x1f, 0x8d, 0x6a, 0xff, 0x47, 0x16, 0x06, 0x9c}},
2306 {{0x33, 0x95, 0xa2, 0x6f, 0x27, 0x5f, 0x9c, 0x9c,
2307 0x64, 0x45, 0xcb, 0xd1, 0x3c, 0xee, 0x5e, 0x5f,
2308 0x48, 0xa6, 0xaf, 0xe3, 0x79, 0xcf, 0xb1, 0xe2,
2309 0xbf, 0x55, 0x0e, 0xa2, 0x3b, 0x62, 0xf0, 0xe4},
2310 {0x14, 0xe8, 0x06, 0xe3, 0xbe, 0x7e, 0x67, 0x01,
2311 0xc5, 0x21, 0x67, 0xd8, 0x54, 0xb5, 0x7f, 0xa4,
2312 0xf9, 0x75, 0x70, 0x1c, 0xfd, 0x79, 0xdb, 0x86,
2313 0xad, 0x37, 0x85, 0x83, 0x56, 0x4e, 0xf0, 0xbf}},
2314 {{0xbc, 0xa6, 0xe0, 0x56, 0x4e, 0xef, 0xfa, 0xf5,
2315 0x1d, 0x5d, 0x3f, 0x2a, 0x5b, 0x19, 0xab, 0x51,
2316 0xc5, 0x8b, 0xdd, 0x98, 0x28, 0x35, 0x2f, 0xc3,
2317 0x81, 0x4f, 0x5c, 0xe5, 0x70, 0xb9, 0xeb, 0x62},
2318 {0xc4, 0x6d, 0x26, 0xb0, 0x17, 0x6b, 0xfe, 0x6c,
2319 0x12, 0xf8, 0xe7, 0xc1, 0xf5, 0x2f, 0xfa, 0x91,
2320 0x13, 0x27, 0xbd, 0x73, 0xcc, 0x33, 0x31, 0x1c,
2321 0x39, 0xe3, 0x27, 0x6a, 0x95, 0xcf, 0xc5, 0xfb}},
2322 {{0x30, 0xb2, 0x99, 0x84, 0xf0, 0x18, 0x2a, 0x6e,
2323 0x1e, 0x27, 0xed, 0xa2, 0x29, 0x99, 0x41, 0x56,
2324 0xe8, 0xd4, 0x0d, 0xef, 0x99, 0x9c, 0xf3, 0x58,
2325 0x29, 0x55, 0x1a, 0xc0, 0x68, 0xd6, 0x74, 0xa4},
2326 {0x07, 0x9c, 0xe7, 0xec, 0xf5, 0x36, 0x73, 0x41,
2327 0xa3, 0x1c, 0xe5, 0x93, 0x97, 0x6a, 0xfd, 0xf7,
2328 0x53, 0x18, 0xab, 0xaf, 0xeb, 0x85, 0xbd, 0x92,
2329 0x90, 0xab, 0x3c, 0xbf, 0x30, 0x82, 0xad, 0xf6}},
2330 {{0xc6, 0x87, 0x8a, 0x2a, 0xea, 0xc0, 0xa9, 0xec,
2331 0x6d, 0xd3, 0xdc, 0x32, 0x23, 0xce, 0x62, 0x19,
2332 0xa4, 0x7e, 0xa8, 0xdd, 0x1c, 0x33, 0xae, 0xd3,
2333 0x4f, 0x62, 0x9f, 0x52, 0xe7, 0x65, 0x46, 0xf4},
2334 {0x97, 0x51, 0x27, 0x67, 0x2d, 0xa2, 0x82, 0x87,
2335 0x98, 0xd3, 0xb6, 0x14, 0x7f, 0x51, 0xd3, 0x9a,
2336 0x0b, 0xd0, 0x76, 0x81, 0xb2, 0x4f, 0x58, 0x92,
2337 0xa4, 0x86, 0xa1, 0xa7, 0x09, 0x1d, 0xef, 0x9b}},
2338 {{0xb3, 0x0f, 0x2b, 0x69, 0x0d, 0x06, 0x90, 0x64,
2339 0xbd, 0x43, 0x4c, 0x10, 0xe8, 0x98, 0x1c, 0xa3,
2340 0xe1, 0x68, 0xe9, 0x79, 0x6c, 0x29, 0x51, 0x3f,
2341 0x41, 0xdc, 0xdf, 0x1f, 0xf3, 0x60, 0xbe, 0x33},
2342 {0xa1, 0x5f, 0xf7, 0x1d, 0xb4, 0x3e, 0x9b, 0x3c,
2343 0xe7, 0xbd, 0xb6, 0x06, 0xd5, 0x60, 0x06, 0x6d,
2344 0x50, 0xd2, 0xf4, 0x1a, 0x31, 0x08, 0xf2, 0xea,
2345 0x8e, 0xef, 0x5f, 0x7d, 0xb6, 0xd0, 0xc0, 0x27}},
2346 {{0x62, 0x9a, 0xd9, 0xbb, 0x38, 0x36, 0xce, 0xf7,
2347 0x5d, 0x2f, 0x13, 0xec, 0xc8, 0x2d, 0x02, 0x8a,
2348 0x2e, 0x72, 0xf0, 0xe5, 0x15, 0x9d, 0x72, 0xae,
2349 0xfc, 0xb3, 0x4f, 0x02, 0xea, 0xe1, 0x09, 0xfe},
2350 {0x00, 0x00, 0x00, 0x00, 0xfa, 0x0a, 0x3d, 0xbc,
2351 0xad, 0x16, 0x0c, 0xb6, 0xe7, 0x7c, 0x8b, 0x39,
2352 0x9a, 0x43, 0xbb, 0xe3, 0xc2, 0x55, 0x15, 0x14,
2353 0x75, 0xac, 0x90, 0x9b, 0x7f, 0x9a, 0x92, 0x00}},
2354 {{0x8b, 0xac, 0x70, 0x86, 0x29, 0x8f, 0x00, 0x23,
2355 0x7b, 0x45, 0x30, 0xaa, 0xb8, 0x4c, 0xc7, 0x8d,
2356 0x4e, 0x47, 0x85, 0xc6, 0x19, 0xe3, 0x96, 0xc2,
2357 0x9a, 0xa0, 0x12, 0xed, 0x6f, 0xd7, 0x76, 0x16},
2358 {0x45, 0xaf, 0x7e, 0x33, 0xc7, 0x7f, 0x10, 0x6c,
2359 0x7c, 0x9f, 0x29, 0xc1, 0xa8, 0x7e, 0x15, 0x84,
2360 0xe7, 0x7d, 0xc0, 0x6d, 0xab, 0x71, 0x5d, 0xd0,
2361 0x6b, 0x9f, 0x97, 0xab, 0xcb, 0x51, 0x0c, 0x9f}},
2362 {{0x9e, 0xc3, 0x92, 0xb4, 0x04, 0x9f, 0xc8, 0xbb,
2363 0xdd, 0x9e, 0xc6, 0x05, 0xfd, 0x65, 0xec, 0x94,
2364 0x7f, 0x2c, 0x16, 0xc4, 0x40, 0xac, 0x63, 0x7b,
2365 0x7d, 0xb8, 0x0c, 0xe4, 0x5b, 0xe3, 0xa7, 0x0e},
2366 {0x43, 0xf4, 0x44, 0xe8, 0xcc, 0xc8, 0xd4, 0x54,
2367 0x33, 0x37, 0x50, 0xf2, 0x87, 0x42, 0x2e, 0x00,
2368 0x49, 0x60, 0x62, 0x02, 0xfd, 0x1a, 0x7c, 0xdb,
2369 0x29, 0x6c, 0x6d, 0x54, 0x53, 0x08, 0xd1, 0xc8}},
2370 {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2371 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2372 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2373 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
2374 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2375 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2376 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2377 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},
2378 {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2379 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2380 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2381 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
2382 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2383 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2384 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2385 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}},
2386 {{0x27, 0x59, 0xc7, 0x35, 0x60, 0x71, 0xa6, 0xf1,
2387 0x79, 0xa5, 0xfd, 0x79, 0x16, 0xf3, 0x41, 0xf0,
2388 0x57, 0xb4, 0x02, 0x97, 0x32, 0xe7, 0xde, 0x59,
2389 0xe2, 0x2d, 0x9b, 0x11, 0xea, 0x2c, 0x35, 0x92},
2390 {0x27, 0x59, 0xc7, 0x35, 0x60, 0x71, 0xa6, 0xf1,
2391 0x79, 0xa5, 0xfd, 0x79, 0x16, 0xf3, 0x41, 0xf0,
2392 0x57, 0xb4, 0x02, 0x97, 0x32, 0xe7, 0xde, 0x59,
2393 0xe2, 0x2d, 0x9b, 0x11, 0xea, 0x2c, 0x35, 0x92}},
2394 {{0x28, 0x56, 0xac, 0x0e, 0x4f, 0x98, 0x09, 0xf0,
2395 0x49, 0xfa, 0x7f, 0x84, 0xac, 0x7e, 0x50, 0x5b,
2396 0x17, 0x43, 0x14, 0x89, 0x9c, 0x53, 0xa8, 0x94,
2397 0x30, 0xf2, 0x11, 0x4d, 0x92, 0x14, 0x27, 0xe8},
2398 {0x39, 0x7a, 0x84, 0x56, 0x79, 0x9d, 0xec, 0x26,
2399 0x2c, 0x53, 0xc1, 0x94, 0xc9, 0x8d, 0x9e, 0x9d,
2400 0x32, 0x1f, 0xdd, 0x84, 0x04, 0xe8, 0xe2, 0x0a,
2401 0x6b, 0xbe, 0xbb, 0x42, 0x40, 0x67, 0x30, 0x6c}},
2402 {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2403 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
2404 0x45, 0x51, 0x23, 0x19, 0x50, 0xb7, 0x5f, 0xc4,
2405 0x40, 0x2d, 0xa1, 0x73, 0x2f, 0xc9, 0xbe, 0xbd},
2406 {0x27, 0x59, 0xc7, 0x35, 0x60, 0x71, 0xa6, 0xf1,
2407 0x79, 0xa5, 0xfd, 0x79, 0x16, 0xf3, 0x41, 0xf0,
2408 0x57, 0xb4, 0x02, 0x97, 0x32, 0xe7, 0xde, 0x59,
2409 0xe2, 0x2d, 0x9b, 0x11, 0xea, 0x2c, 0x35, 0x92}},
2410 {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
2411 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
2412 0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,
2413 0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x40},
2414 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2415 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2416 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2417 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}},
2418 {{0x1c, 0xc4, 0xf7, 0xda, 0x0f, 0x65, 0xca, 0x39,
2419 0x70, 0x52, 0x92, 0x8e, 0xc3, 0xc8, 0x15, 0xea,
2420 0x7f, 0x10, 0x9e, 0x77, 0x4b, 0x6e, 0x2d, 0xdf,
2421 0xe8, 0x30, 0x9d, 0xda, 0xe8, 0x9a, 0x65, 0xae},
2422 {0x02, 0xb0, 0x16, 0xb1, 0x1d, 0xc8, 0x57, 0x7b,
2423 0xa2, 0x3a, 0xa2, 0xa3, 0x38, 0x5c, 0x8f, 0xeb,
2424 0x66, 0x37, 0x91, 0xa8, 0x5f, 0xef, 0x04, 0xf6,
2425 0x59, 0x75, 0xe1, 0xee, 0x92, 0xf6, 0x0e, 0x30}},
2426 {{0x8d, 0x76, 0x14, 0xa4, 0x14, 0x06, 0x9f, 0x9a,
2427 0xdf, 0x4a, 0x85, 0xa7, 0x6b, 0xbf, 0x29, 0x6f,
2428 0xbc, 0x34, 0x87, 0x5d, 0xeb, 0xbb, 0x2e, 0xa9,
2429 0xc9, 0x1f, 0x58, 0xd6, 0x9a, 0x82, 0xa0, 0x56},
2430 {0xd4, 0xb9, 0xdb, 0x88, 0x1d, 0x04, 0xe9, 0x93,
2431 0x8d, 0x3f, 0x20, 0xd5, 0x86, 0xa8, 0x83, 0x07,
2432 0xdb, 0x09, 0xd8, 0x22, 0x1f, 0x7f, 0xf1, 0x71,
2433 0xc8, 0xe7, 0x5d, 0x47, 0xaf, 0x8b, 0x72, 0xe9}},
2434 {{0x83, 0xb9, 0x39, 0xb2, 0xa4, 0xdf, 0x46, 0x87,
2435 0xc2, 0xb8, 0xf1, 0xe6, 0x4c, 0xd1, 0xe2, 0xa9,
2436 0xe4, 0x70, 0x30, 0x34, 0xbc, 0x52, 0x7c, 0x55,
2437 0xa6, 0xec, 0x80, 0xa4, 0xe5, 0xd2, 0xdc, 0x73},
2438 {0x08, 0xf1, 0x03, 0xcf, 0x16, 0x73, 0xe8, 0x7d,
2439 0xb6, 0x7e, 0x9b, 0xc0, 0xb4, 0xc2, 0xa5, 0x86,
2440 0x02, 0x77, 0xd5, 0x27, 0x86, 0xa5, 0x15, 0xfb,
2441 0xae, 0x9b, 0x8c, 0xa9, 0xf9, 0xf8, 0xa8, 0x4a}},
2442 {{0x8b, 0x00, 0x49, 0xdb, 0xfa, 0xf0, 0x1b, 0xa2,
2443 0xed, 0x8a, 0x9a, 0x7a, 0x36, 0x78, 0x4a, 0xc7,
2444 0xf7, 0xad, 0x39, 0xd0, 0x6c, 0x65, 0x7a, 0x41,
2445 0xce, 0xd6, 0xd6, 0x4c, 0x20, 0x21, 0x6b, 0xc7},
2446 {0xc6, 0xca, 0x78, 0x1d, 0x32, 0x6c, 0x6c, 0x06,
2447 0x91, 0xf2, 0x1a, 0xe8, 0x43, 0x16, 0xea, 0x04,
2448 0x3c, 0x1f, 0x07, 0x85, 0xf7, 0x09, 0x22, 0x08,
2449 0xba, 0x13, 0xfd, 0x78, 0x1e, 0x3f, 0x6f, 0x62}},
2450 {{0x25, 0x9b, 0x7c, 0xb0, 0xac, 0x72, 0x6f, 0xb2,
2451 0xe3, 0x53, 0x84, 0x7a, 0x1a, 0x9a, 0x98, 0x9b,
2452 0x44, 0xd3, 0x59, 0xd0, 0x8e, 0x57, 0x41, 0x40,
2453 0x78, 0xa7, 0x30, 0x2f, 0x4c, 0x9c, 0xb9, 0x68},
2454 {0xb7, 0x75, 0x03, 0x63, 0x61, 0xc2, 0x48, 0x6e,
2455 0x12, 0x3d, 0xbf, 0x4b, 0x27, 0xdf, 0xb1, 0x7a,
2456 0xff, 0x4e, 0x31, 0x07, 0x83, 0xf4, 0x62, 0x5b,
2457 0x19, 0xa5, 0xac, 0xa0, 0x32, 0x58, 0x0d, 0xa7}},
2458 {{0x43, 0x4f, 0x10, 0xa4, 0xca, 0xdb, 0x38, 0x67,
2459 0xfa, 0xae, 0x96, 0xb5, 0x6d, 0x97, 0xff, 0x1f,
2460 0xb6, 0x83, 0x43, 0xd3, 0xa0, 0x2d, 0x70, 0x7a,
2461 0x64, 0x05, 0x4c, 0xa7, 0xc1, 0xa5, 0x21, 0x51},
2462 {0xe4, 0xf1, 0x23, 0x84, 0xe1, 0xb5, 0x9d, 0xf2,
2463 0xb8, 0x73, 0x8b, 0x45, 0x2b, 0x35, 0x46, 0x38,
2464 0x10, 0x2b, 0x50, 0xf8, 0x8b, 0x35, 0xcd, 0x34,
2465 0xc8, 0x0e, 0xf6, 0xdb, 0x09, 0x35, 0xf0, 0xda}},
2466 {{0xdb, 0x21, 0x5c, 0x8d, 0x83, 0x1d, 0xb3, 0x34,
2467 0xc7, 0x0e, 0x43, 0xa1, 0x58, 0x79, 0x67, 0x13,
2468 0x1e, 0x86, 0x5d, 0x89, 0x63, 0xe6, 0x0a, 0x46,
2469 0x5c, 0x02, 0x97, 0x1b, 0x62, 0x43, 0x86, 0xf5},
2470 {0xdb, 0x21, 0x5c, 0x8d, 0x83, 0x1d, 0xb3, 0x34,
2471 0xc7, 0x0e, 0x43, 0xa1, 0x58, 0x79, 0x67, 0x13,
2472 0x1e, 0x86, 0x5d, 0x89, 0x63, 0xe6, 0x0a, 0x46,
2473 0x5c, 0x02, 0x97, 0x1b, 0x62, 0x43, 0x86, 0xf5}}
2474 };
2475 secp256k1_scalar_set_int(&
one, 1);
2476 for (i = 0; i < 33; i++) {
2477 secp256k1_scalar_set_b32(&x, chal[i][0], &
overflow);
2479 secp256k1_scalar_set_b32(&y, chal[i][1], &
overflow);
2481 secp256k1_scalar_set_b32(&r1, res[i][0], &
overflow);
2483 secp256k1_scalar_set_b32(&r2, res[i][1], &
overflow);
2485 secp256k1_scalar_mul(&z, &x, &y);
2486 CHECK(!secp256k1_scalar_check_overflow(&z));
2487 CHECK(secp256k1_scalar_eq(&r1, &z));
2488 if (!secp256k1_scalar_is_zero(&y)) {
2489 secp256k1_scalar_inverse(&zz, &y);
2490 CHECK(!secp256k1_scalar_check_overflow(&zz));
2491 secp256k1_scalar_inverse_var(&zzv, &y);
2492 CHECK(secp256k1_scalar_eq(&zzv, &zz));
2493 secp256k1_scalar_mul(&z, &z, &zz);
2494 CHECK(!secp256k1_scalar_check_overflow(&z));
2495 CHECK(secp256k1_scalar_eq(&x, &z));
2496 secp256k1_scalar_mul(&zz, &zz, &y);
2497 CHECK(!secp256k1_scalar_check_overflow(&zz));
2498 CHECK(secp256k1_scalar_eq(&
one, &zz));
2499 }
2500 }
2501 }
2502}
void run_scalar_set_b32_seckey_tests(void)