NTRU: add explicit cast for MS compiler
This commit is contained in:
parent
722b510358
commit
f772093fd4
@ -23,9 +23,9 @@ auxiliary-submitters:
|
|||||||
- Zhenfei Zhang
|
- Zhenfei Zhang
|
||||||
implementations:
|
implementations:
|
||||||
- name: clean
|
- name: clean
|
||||||
version: https://github.com/jschanck/ntru/tree/4699d70a reference implementation
|
version: https://github.com/jschanck/ntru/tree/00f73a7f reference implementation
|
||||||
- name: avx2
|
- name: avx2
|
||||||
version: https://github.com/jschanck/ntru/tree/4699d70a avx2 implementation
|
version: https://github.com/jschanck/ntru/tree/00f73a7f avx2 implementation
|
||||||
supported_platforms:
|
supported_platforms:
|
||||||
- architecture: x86_64
|
- architecture: x86_64
|
||||||
operating_systems:
|
operating_systems:
|
||||||
|
@ -7,7 +7,7 @@ static inline uint8_t mod3(uint8_t a) { /* a between 0 and 9 */
|
|||||||
a = (a >> 2) + (a & 3); /* between 0 and 4 */
|
a = (a >> 2) + (a & 3); /* between 0 and 4 */
|
||||||
t = a - 3;
|
t = a - 3;
|
||||||
c = t >> 5;
|
c = t >> 5;
|
||||||
return t ^ (c & (a ^ t));
|
return (uint8_t) (t ^ (c & (a ^ t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return -1 if x<0 and y<0; otherwise return 0 */
|
/* return -1 if x<0 and y<0; otherwise return 0 */
|
||||||
|
@ -23,9 +23,9 @@ auxiliary-submitters:
|
|||||||
- Zhenfei Zhang
|
- Zhenfei Zhang
|
||||||
implementations:
|
implementations:
|
||||||
- name: clean
|
- name: clean
|
||||||
version: https://github.com/jschanck/ntru/tree/4699d70a reference implementation
|
version: https://github.com/jschanck/ntru/tree/00f73a7f reference implementation
|
||||||
- name: avx2
|
- name: avx2
|
||||||
version: https://github.com/jschanck/ntru/tree/4699d70a avx2 implementation
|
version: https://github.com/jschanck/ntru/tree/00f73a7f avx2 implementation
|
||||||
supported_platforms:
|
supported_platforms:
|
||||||
- architecture: x86_64
|
- architecture: x86_64
|
||||||
operating_systems:
|
operating_systems:
|
||||||
|
@ -7,7 +7,7 @@ static inline uint8_t mod3(uint8_t a) { /* a between 0 and 9 */
|
|||||||
a = (a >> 2) + (a & 3); /* between 0 and 4 */
|
a = (a >> 2) + (a & 3); /* between 0 and 4 */
|
||||||
t = a - 3;
|
t = a - 3;
|
||||||
c = t >> 5;
|
c = t >> 5;
|
||||||
return t ^ (c & (a ^ t));
|
return (uint8_t) (t ^ (c & (a ^ t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return -1 if x<0 and y<0; otherwise return 0 */
|
/* return -1 if x<0 and y<0; otherwise return 0 */
|
||||||
|
@ -23,9 +23,9 @@ auxiliary-submitters:
|
|||||||
- Zhenfei Zhang
|
- Zhenfei Zhang
|
||||||
implementations:
|
implementations:
|
||||||
- name: clean
|
- name: clean
|
||||||
version: https://github.com/jschanck/ntru/tree/4699d70a reference implementation
|
version: https://github.com/jschanck/ntru/tree/00f73a7f reference implementation
|
||||||
- name: avx2
|
- name: avx2
|
||||||
version: https://github.com/jschanck/ntru/tree/4699d70a avx2 implementation
|
version: https://github.com/jschanck/ntru/tree/00f73a7f avx2 implementation
|
||||||
supported_platforms:
|
supported_platforms:
|
||||||
- architecture: x86_64
|
- architecture: x86_64
|
||||||
operating_systems:
|
operating_systems:
|
||||||
|
@ -7,7 +7,7 @@ static inline uint8_t mod3(uint8_t a) { /* a between 0 and 9 */
|
|||||||
a = (a >> 2) + (a & 3); /* between 0 and 4 */
|
a = (a >> 2) + (a & 3); /* between 0 and 4 */
|
||||||
t = a - 3;
|
t = a - 3;
|
||||||
c = t >> 5;
|
c = t >> 5;
|
||||||
return t ^ (c & (a ^ t));
|
return (uint8_t) (t ^ (c & (a ^ t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return -1 if x<0 and y<0; otherwise return 0 */
|
/* return -1 if x<0 and y<0; otherwise return 0 */
|
||||||
|
@ -23,9 +23,9 @@ auxiliary-submitters:
|
|||||||
- Zhenfei Zhang
|
- Zhenfei Zhang
|
||||||
implementations:
|
implementations:
|
||||||
- name: clean
|
- name: clean
|
||||||
version: https://github.com/jschanck/ntru/tree/4699d70a reference implementation
|
version: https://github.com/jschanck/ntru/tree/00f73a7f reference implementation
|
||||||
- name: avx2
|
- name: avx2
|
||||||
version: https://github.com/jschanck/ntru/tree/4699d70a avx2 implementation
|
version: https://github.com/jschanck/ntru/tree/00f73a7f avx2 implementation
|
||||||
supported_platforms:
|
supported_platforms:
|
||||||
- architecture: x86_64
|
- architecture: x86_64
|
||||||
operating_systems:
|
operating_systems:
|
||||||
|
@ -7,7 +7,7 @@ static inline uint8_t mod3(uint8_t a) { /* a between 0 and 9 */
|
|||||||
a = (a >> 2) + (a & 3); /* between 0 and 4 */
|
a = (a >> 2) + (a & 3); /* between 0 and 4 */
|
||||||
t = a - 3;
|
t = a - 3;
|
||||||
c = t >> 5;
|
c = t >> 5;
|
||||||
return t ^ (c & (a ^ t));
|
return (uint8_t) (t ^ (c & (a ^ t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return -1 if x<0 and y<0; otherwise return 0 */
|
/* return -1 if x<0 and y<0; otherwise return 0 */
|
||||||
|
Loading…
Reference in New Issue
Block a user